Skip to main content

How to build your own flex sensor

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

Making a bend sensor instructions.003.jpegImage of Tape, Foam, Copper tape, Silicon Wire and velostat

Making a bend sensor instructions.004.jpegImage 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

Making a bend sensor instructions.006.jpegImage showing the copper tape is soldered to the wires at the bottom and then stuck on to the foam

Making a bend sensor instructions.007.jpegImage shows the sandwhiching of the velostat between the 2 copper stips and foam

Making a bend sensor instructions.008.jpegImages shows the foam and velostat 'sandwhich' being taped together

Making a bend sensor instructions.009.jpegImages shows the measuring of the resistance when the flex sensor is flat and bended, and that it differs

Arduino wiring:

Screenshot 2023-10-23 at 14.10.31.pngThe 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
}