FLEX SENSOR

 FLEX SENSOR

                                        Flex Sensor is used to detect bends in one direction.  Flex sensors are available in 2.2, 4.5 inches. For best outcomes, securely support the base and bottom portion and only let the actual flex sensor to bend. While using the flex sensor, make sure that the flex sensor should not bend beyond the usable range. We can interface flex sensor with Arduino to detect the bent in a direction.


Application:

  • Used in manufacturing virtual reality gloves.
  • Sensing a bend in product.
  • Used in industrial controls, computer peripherals, joysticks, and measuring devices.
  • These are also present in fitness products, musical instruments, and assistive technology systems of modern vehicles.

Sample Project With Arduino:

                                         In this we going to turn ON the LED whenever the bent is detected by the flex sensor.

Materials required:

  • Flex sensor
  • Arduino UNO
  • LED 
  • 220 Ohm resistor
  • 10k Ohm resistor
  • Jumper wires

Circuit:


Code:

const int ledPin = 3;  //pin 3 has PWM funtion

const int flexPin = A0;  //pin A0 to read 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 potentiometer

  Serial.println(value);   //Print value

  value = map(value, 700, 900, 0, 255);  //Map value 0-1023 to 0-255 (PWM)

  analogWrite(ledPin, value);   //Send PWM value to led

  delay(100);  //Small delay  }


Comments

Popular posts from this blog

Voice Record & Playback Module

GSM Sim800L

GPS