Using FSR Sensor to Turn the led on

i am trying to power on led with FSR sensor but its not turning on , the FSR sensor

const int fsrPin = A0;   
const int ledPin = 13;  

void setup() {
  pinMode(ledPin, OUTPUT);  
  Serial.begin(9600);       
}

void loop() {
  int fsrValue = analogRead(fsrPin); 

  int threshold = 1;
  if (fsrValue > threshold) {
    digitalWrite(ledPin, HIGH); 
    Serial.println("Force!");
  }
  delay(100);  // Delay for stability
}

please need guide thank you

What value do you see if you print fsrValue ?

there is no print on serial monitor , its empty

Please post the sketch showing how you printed it

1 Like


now led is not turning on

The sketch that you posted does not print the value of fsrValue

i have tried to print Force on screen and meanwhile led turn on.

It is not the word "Force" that we are interested in, rather it i the value of fsrValue

Try this

void loop() {
  int fsrValue = analogRead(fsrPin); 
  Serial.println(fsrValue);
1 Like

i have change connections in led ,


now it turn on modifiying

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.