I'm working on a project that requires me to use several different FSRs. I have successfully plugged in 3 of the FSR's into my breadboard and written code to output the three values however when I touch just one FSR, I get outputs for all three.
For example, I have FSR A, B and C.
If I touch FSR A and just FSR A, I get a ready (say 700). FSR B will then output a smaller value (say 400) while FSR C will output an even smaller value (say 50).
Each FSR requires its own load resistor. You can use the internal pullup on the analog input as the load resistor if the yields sufficient sensitivity.
For further insight I have three different FSR's and im running 10k from power to the FSR and 1m to ground. Im fairly certain I'm using the wrong resistors.
This is so helpful, thank you so much for taking the time.
Here are two images: one of my board and one schematic. I'm fairly certain that i'm just using the wrong resistors (im very new to this).
Here's my code, too:
#define FORCE_SENSOR_PIN_FSR1 A0 // the FSR and 10K pulldown are connected to A0
#define FORCE_SENSOR_PIN_FSR2 A1 // the FSR and 10K pulldown are connected to A1
#define FORCE_SENSOR_PIN_FSR5 A5 // the FSR and 10K pulldown are connected to A0
void setup() {
Serial.begin(9600);
}
void loop() {
int analogReading_FSR1 = analogRead(FORCE_SENSOR_PIN_FSR1);
int analogReading_FSR2 = analogRead(FORCE_SENSOR_PIN_FSR2);
int analogReading_FSR5 = analogRead(FORCE_SENSOR_PIN_FSR5);
Serial.print("FSR1 = ");
Serial.print(analogReading_FSR1); // print the raw analog reading
Serial.print(" ");
Serial.print("FSR2 = ");
Serial.print(analogReading_FSR2); // print the raw analog reading
Serial.print(" ");
Serial.print("FSR5 = ");
Serial.print(analogReading_FSR5); // print the raw analog reading
if (analogReading_FSR1 < 10) // from 0 to 9
Serial.println(" -> no pressure");
else if (analogReading_FSR1 < 200) // from 10 to 199
Serial.println(" -> light touch");
else if (analogReading_FSR1 < 500) // from 200 to 499
Serial.println(" -> light squeeze");
else if (analogReading_FSR1 < 800) // from 500 to 799
Serial.println(" -> medium squeeze");
else // from 800 to 1023
Serial.println(" -> big squeeze");
if (analogReading_FSR2 < 10) // from 0 to 9
Serial.println(" -> no pressure");
else if (analogReading_FSR2 < 200) // from 10 to 199
Serial.println(" -> light touch");
else if (analogReading_FSR2 < 500) // from 200 to 499
Serial.println(" -> light squeeze");
else if (analogReading_FSR2 < 800) // from 500 to 799
Serial.println(" -> medium squeeze");
else // from 800 to 1023
Serial.println(" -> big squeeze");
if (analogReading_FSR5 < 10) // from 0 to 9
Serial.println(" -> no pressure");
else if (analogReading_FSR5 < 200) // from 10 to 199
Serial.println(" -> light touch");
else if (analogReading_FSR5 < 500) // from 200 to 499
Serial.println(" -> light squeeze");
else if (analogReading_FSR5 < 800) // from 500 to 799
Serial.println(" -> medium squeeze");
else // from 800 to 1023
Serial.println(" -> big squeeze");
delay(500);
}
It is hard for me to see what goes where in the photo. Sorry, old eyes. Terminals are not labeled. A schematic would be less ambiguous.
The 2 terminal FSRs need only 1 load resistor. 10K is a reasonable value.
The 3 terminal FDR probably does not use a load resistor. it would be wired like a potentiometer. It looked like 3 terminals, but I blew it up and now see that it is 2, Sorry for the confusion on my part.
You are connecting the analog inputs to the wrong places. The 1M resistors are way to high in value to be of any use.
I hate Fritzing but will try to show how to wire the FSRs. Only 1 resistor needed if you use external resistors. No resistors needed if you wire the FSRs to ground and use the internal pullups.
One side of the FSR goes directly to Vcc. The other side goes to ground through a 10K (or so) load resistor. The analog input connects to the junction of the load resistor and the FSR terminal.
Or one side of the FSR goes direct to ground. The other side goes to Vcc through a load resistor. The analog input connects to the junction of the load resistor and the FSR terminal.
You can experiment with various values of the load resistor to tailor the sensitivities of the FSRs to your needs.
Let me know how it goes. If you need further assistance, ask away.
If your question was answered to your satisfaction, please mark the thread as solved so that other members do not waste their time opening the thread wanting to help only to find that the problem has been solved.