Tubolar Stretch Sensor Tutorial

Tubolar Stretch Sensor Tutorial © GPL3+

How to read the value of a Tubolar Stretch Sensor with your Arduino.

  • 2,447 views
  • 0 comments
  • 6 respects

Components and supplies

Ard lilusb
Arduino LilyPad USB
×1
Tubolar Stretch Sensor (10cm peace)
×1
10 1k 1/4w resistor
×1

About this project

Connect the sensor to the power supply

The Tubolar Stretch Sensor is an analog textile sensor that changes its resistivity when it is pulled and stretched. It is useful for creating variable voltage divider that can be easily read by an Arduino.

Connect the input to the sensor

Connect one end of the sensor to the 5V pin of the Lilypad. Then you need to connect the other end to ground through a 1 kOhm resistor like shown in the picture.

How to read values with the Arduino

Now connect the analog input pin A5 of the Arduino to the end of the sensor connected to the resistor.

How to read the sensor value with Arduino

The sensor changes its resistance if you stretch it. This will change the voltage read by the Arduino.

The value read will change the blinking frequency of the LED.

int sensorPin = A5;    // select the input pin for the sensor
int ledPin = 13;      // select the pin for the LED
int sensorValue = 0;  // variable to store the value coming from the sensor
 
void setup() {
  // declare the ledPin as an OUTPUT:
  pinMode(ledPin, OUTPUT);
}
 
void loop() {
  // read the value from the sensor:
  sensorValue = analogRead(sensorPin);
  // turn the ledPin on
  digitalWrite(ledPin, HIGH);
  // stop the program for <sensorValue> milliseconds:
  delay(sensorValue);
  // turn the ledPin off:
  digitalWrite(ledPin, LOW);
  // stop the program for for <sensorValue> milliseconds:
  delay(sensorValue);
}

Code

Code snippet #1Arduino
int sensorPin = A5;    // select the input pin for the sensor
int ledPin = 13;      // select the pin for the LED
int sensorValue = 0;  // variable to store the value coming from the sensor

void setup() {
  // declare the ledPin as an OUTPUT:
  pinMode(ledPin, OUTPUT);
}

void loop() {
  // read the value from the sensor:
  sensorValue = analogRead(sensorPin);
  // turn the ledPin on
  digitalWrite(ledPin, HIGH);
  // stop the program for <sensorValue> milliseconds:
  delay(sensorValue);
  // turn the ledPin off:
  digitalWrite(ledPin, LOW);
  // stop the program for for <sensorValue> milliseconds:
  delay(sensorValue);
}

Comments

Similar projects you might like

PIR Sensor Tutorial - With Or Out Arduino

by Tarantula3

  • 3,435 views
  • 2 comments
  • 21 respects

Analog Textile Press Button Tutorial

Project tutorial by Arduino_Scuola

  • 1,873 views
  • 0 comments
  • 7 respects

Soft potentiometer tutorial

Project tutorial by Arduino_Scuola

  • 1,868 views
  • 0 comments
  • 0 respects

Getting started with IMU (6 DOF) motion sensor

Project tutorial by Aritro Mukherjee

  • 72,531 views
  • 19 comments
  • 42 respects

Smoke Detection using MQ-2 Gas Sensor

by Aritro Mukherjee

  • 213,167 views
  • 36 comments
  • 133 respects

Portable Arduino Temp/Humidity Sensor with LCD

Project tutorial by ThothLoki

  • 153,323 views
  • 115 comments
  • 185 respects
Add projectSign up / Login