Skip to main content

How to build your own flex sensor

You will need:

  • Velostat
  • Copper tape
  • Foam
  • Soldering kit
  • Silicon wire (thin threaded wire is also fine)
  • Tape of some sort

Image of Tape, Foam, Copper tape, Silicon Wire and velostat

Image of Tape, Foam, Copper tape, Silicon Wire and velostat showing wire should be 30-40 centimeters in length (and you need 2) copper tape should be about 11cm and foam & velostat should be about 4cm by 12cm

Image showing the copper tape is soldered to the wires at the bottom and then stuck on to the foam

Image shows the sandwhiching of the velostat between the 2 copper stips and foam

Images shows the foam and velostat 'sandwhich' being taped together

Images shows the measuring of the resistance when the flex sensor is flat and bended, and that it differs

Arduino wiring:

The images shows the wiring of a flex sensor and led on a breadbaord connected to the arduino leonardo

Arduino code:

/*

Simple code to light up an LED based on resistance sensor 
Matt Jarvis - Creative Computing  Institute

*/

int ledPin = 3;   	// pin 3 has PWM
int flexPin = A0; 	// pin A0 is analog input

int value; 				// save analog value


void setup(){
  pinMode(ledPin, OUTPUT);  //Set pin 3 as 'output'
  Serial.begin(9600);       //Begin serial communication
}

void loop(){
  value = analogRead(flexPin);         	// Read and save analog value from resistor device
  Serial.println(value);               	// Print value to serial
  value = map(value, 700, 900, 0, 255);	// Map value from analogue (0-1023) to digital (0-255) (PWM) 
  analogWrite(ledPin, value);          	// Send PWM value to led
  delay(100);                          	// Small delay
}