HOME MADE
LINEAR TOUCH POTENTIOMETER
Our linear touch potentiometer will be a voltage divider, in which the variable resistor is constructed by ourselves.
Our variable resistor can be made out of any conductive material that has the potential to supply us
(a microcontroller pin) with varying voltage.
Either by changing its conductivity when touched, bent, or when the length that is inside the circuit is reduced.
To find out which material is the best in terms of conductivity and linearity
I want to compare three cheap and inspiring materials.
Conductive Ink
Can be used, drawn or printed, on different materials, also on paper. Contains powdered silver and carbon.
Graphite
Graphite Sticks are usually used for drawings. Lines on paper have no uniformed conductivity, but its fun to experiment with that as well
Video Tape
In fact a thin inked polymer strip. The ink is conductive and since it is printed by a machine it has a uniform conductivity.
The videotape has high resistivity and its surface is very fragile, any scratch will alter the resistance linearity.
I tested the resistance of these materials with my multimeter.
The videotape was the most reliable, linear and useful material.
It is flexible and less messy to work with then the ink or the graphite.
Videotape gaines 100 Ohm resistance with every added inch in length.
I decided to use videotape for a touch sensor and used the paper by Rodolphe Koehly,
Denis Curtil and Marcelo M. Wanderley (NIME06) to construct it.
Linearity of the 3 materials in comparison:

,

MY SLEEP POSITION SENSOR
I build three touch sensors. Two for the x and one for the y direction.
I wanted to measure the position of my head on a pillow during the night.
Since the Videotape is thin, the whole sensor was tight enough to sleep on it.
The sensors are made out of a metal surface on which I put two spacers. On top of the spacers I fixed the videotape.
Between the left spacer and the videotape goes the power supply (5 Volt), in order to send voltage through the tape
("Between" because the conductive side of the tape has to look down). Under the other spacer there is a cable that goes to ground.
It starts receiving voltage from the metal surface, as soon as the videotape is pressed down on and by that connected to the metal surface.
Depending on the distance between the touch point (on which the videotape touches the metal) and ground, the resistance is higher or lower.
The varying voltage goes though the cable to my Arduino microcontroller pin.
There has to be a fixed resistor as well, that provides a path to ground.
The current will follow the path of least resistance, from the 5V source through the variable resistor to the microcontroller pin.
If my variable resistor has the minimum of 150 kOhm resistance, the fixed resistor on the
other end of the voltage divider has to have 150 kOhm, setting the bottom of the voltage range.
Arduino reads the incoming data as bytes. After 3 incoming bytes Arduino sends a sign to the computer, in my case a capital "A".
The software responsible for the serial communication between Arduino and the computer is "Processing".
After Processing has received 3 bytes and the capital "A" from Arduino, it sends an "A" back.
After that Arduino continues to deliver the next three bytes. Through this "call and response" function,
Processing can tell apart, which information comes from which sensor.
The three different inputs from the three different sensors are visualized by a little head on the computer screen,
changing its position with the position of the head on the pillow.

,
PROCESSING CODE
import processing.serial.*;
PImage f;
int bgcolor; // background color
int fgcolor; // fill color
Serial port; // the serial port
int[] serialInArray = new int[3]; // where we'll put what we receive
int serialCount = 0; // a count of how many bytes we receive
float xpos, ypos; // Starting position of the face
boolean firstContact = false; // whether we've heard from the microcontroller
void setup() {
size(900, 900);
noStroke();
f= loadImage ("face.png");
frameRate (5);
xpos = width/2;
ypos = height/2;
println(Serial.list());
port = new Serial(this, Serial.list()[0], 9600);
port.write(65); // send a capital A to start the microcontroller sending
}
void draw() {
background(fgcolor);
image ( f, (-xpos)+450, fgcolor+400);
while (port.available() > 0) {
serialEvent();
firstContact = true;
}
if (firstContact == false) {
delay(200);
port.write(65);
}
}
void serialEvent() {
processByte((char)port.read());
}
void processByte(char inByte) {
// add the latest byte from the serial port to array:
serialInArray[serialCount] = inByte;
serialCount++;
// if we have 3 bytes:
if (serialCount > 2 ) {
xpos = (float)serialInArray[0];
ypos = (float)serialInArray[1];
fgcolor = (int)serialInArray[2];
// send a capital A to request new sensor readings:
//port.write(65);
println (xpos + "\t" + ypos + "\t" +fgcolor);
// reset serialCount:
serialCount = 0;
}
port.write(65); // send a capital A to start the microcontroller sending
}
ARDUINO CODE
int potPin = 0; // Analog input pin 0 that the right sensor is attached to
int potValue = 0; // value read from the pot0
int potPin1 = 1; //Analog input pin 1 that the left sensor is attached to
int potValue1 = 0; // value read from the pot1
int potPin2 = 2; //Analog input pin 1 that the left sensor is attached to
int potValue2 = 0; // value read from the pot2
int inByte;
void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
pinMode(potPin, INPUT);
pinMode(potPin1, INPUT);
pinMode(potPin2, INPUT);
}
void loop() {
while (Serial.available() > 0) {
// get incoming byte:
inByte = Serial.read();
potValue = analogRead(potPin); // read the pot value
potValue1 = analogRead(potPin1); // read the pot value
potValue2 = analogRead(potPin2); // read the pot value
potValue = potValue/4; // pmw pot value divided by 4 to fit in a byte
potValue1 = potValue1/4;
potValue2 = potValue2/4;
// Serial.println("potValue");
Serial.print(potValue,BYTE);
// Serial.println("potValue1");
Serial.print(potValue1,BYTE);
//Serial.println("potValue2");
Serial.print(potValue2,BYTE);
// Serial.print(potValue1, BYTE); // print the pot value back to the debugger pane
// Serial.print(potValue2, BYTE);
delay(10); // wait 10 milliseconds before the next loop
}
}
VIDEO DOCUMENTATION
SLEEPING ON THE HEAD POSITION SENSOR:
http://www.youtube.com/watch?v=tMsIPaZ78b4
VISUALIZATION OF HEAD POSITION SENSOR DATA:
http://www.youtube.com/watch?v=60xvvtAzH20
special thanks too:
http://recherche.ircam.fr/equipes/temps-reel/nime06/proc/nime2006_230.pdf