• 2010
  • Nov
  • 28

Arduino and Touch Technology - I

1110.jpg I hope to get to the point were I will be able to have a black-lit touch button build by combining an LED a touch sensor and some acrylic board or glass. Since I have never done touch sensing before I decided to approach this vision with some experiments. This is the first experiment.

Getting started with Phidgets

The easy starting point to touch sensing can be found at phidgets.com. As it turns out the “phidgets 1110” is based on the ATMEL QT110-IG (yep, a magnifying glass came in handy)- an SMD capacitive sensor.
Unfortunately that chip is being discontinued and replaced by a new series (more on that in a later post).

In general the phidgets.com touch sensor seems to be quite straight forward. It only consists of the QT110, 3 SMD capacitors, as well as a single SMD resistor, and the molex connector.

The ATMEL QT series seems to be the agreed standard for button replacement solutions.
Phidgets solutions provides for an easy start into touch sensing … which is the first experiment in this series:

Bill of Material

Circuit

This is almost too simple - but here come the step-by step instructions.
arduinowithphidgets1110.jpg

  1. connect the phidget (molex) cable to the 1110 sensor. It only snaps in one way.
  2. Now take the toothpick or pencil or even a pocket knife and carefully remove the connector on the other end of the cable. You end up with the bare crimp connectors.
  3. Cut your pin headers into 2 sets of 6 and 2 sets of 8 (we only need one 6 pin header and one 8 pin header for this - but it doesn’t hurt to have them handy anyways). Attach them to the arduino - long side into the female headers on the arduino board.
  4. Connect the red cable crimp connector to the 5V pin, connect the black connector to the GND pin and connect the white connector to the digital pin 7.

Firmware

Just use the Arduino button example:

/*
 * Button
 * by DojoDave <http://www.0j0.org>
 *
 * Turns on and off a light emitting diode(LED) connected to digital  
 * pin 13, when pressing a pushbutton attached to pin 7. 
 *
 * http://www.arduino.cc/en/Tutorial/Button
 */
 
int ledPin = 13;                // choose the pin for the LED
int inputPin = 7;               // choose the input pin (for a pushbutton)
int val = 0;                    // variable for reading the pin status

void setup() {
  pinMode(ledPin, OUTPUT);      // declare LED as output
  pinMode(inputPin, INPUT);     // declare pushbutton as input
}

void loop(){
  val = digitalRead(inputPin);  // read input value
  if (val == HIGH) {            // check if the input is HIGH
    digitalWrite(ledPin, LOW);  // turn LED OFF
  } else {
    digitalWrite(ledPin, HIGH); // turn LED ON
  }
}

Experiments

You will find that the Touch sensor needs about 10 seconds to calibrate after that it is ready to recognize any finger approaching. If the finger stays close it will be part of the recalibration taking place over a 10 seconds time window.
The sensor works very well though a picture frame glass as well as though some acrylic glass I had sitting around. It seems to work fine. The auto calibration is a great feature but needs to be considered when building a firmware using the QT110 - it has to ignore all readying for the initial 10 seconds after boot up.

more to come

This was almost too easy - I am excited about this and already ordered parts for the next experiment from digi-key and sparkfun. Unfortunately Jameco which is just up the street (101) from my place does not carry the parts for the next experiment - thus I had to shell out more for postage than for the parts.
The next experiment will include building the actual touch sensor from scratch instead of just interfacing with one from phidgets.com.