Relay controlled by FSR sensor

Hi, I would like ask, if anyone could help me to build arduino relay controlled by fsr sensor.
I would like to use for example this fsr sensor FSR, Force Sensing Resistor, Robot Force Sensors, Robot Pressure Sensor, Robot Touch Sensor

I would like to activate relay only during force. It means when I am pushing on the sensor the relay is activated, when I stop pushing, relay is automatically deactivated.

I need to press keyboard button by foot step. Now I have attached two wires to the keyboard button I want. When I short these two cables it will write the required character. Now i have to invent how to short these cables by foot step. I think slim fsr sensor under stick with footprint will work, but never get in touch with arduino. Could anyone help me? Thanks

The easiest approach would be to buy a foot switch, like this one.

jremington:
The easiest approach would be to buy a foot switch, like this one.

Foot switch, this is what I need. But this one is too big. I need to hide it under sticker. This equipment will be in the museum. So is should be little bit antivandal :slight_smile:

Google "arduino fsr" to learn how to connect and use an FSR with Arduino.

jremington:
Google "arduino fsr" to learn how to connect and use an FSR with Arduino.

jremington:
Google "arduino fsr" to learn how to connect and use an FSR with Arduino.

Hi, I did this. I do not have problem to connect and setup fsr. I do not know how to get work fsr with relay based on values coming from fsr sensor. I have never tried write a script.

Thanks David

infernus:
I have never tried write a script.

Trying to run before having learned to crawl is not going to work.
I suggest you put your project aside, and go through some of the basic examples that come with the IDE.
Leo..

Wawa:
go through some of the basic examples that come with the IDE.

.... at least one of which shows how to read and react to a potentiometer, which is pretty much how the fsr works when it's in a voltage divider.

I did it!

/* FSR spínač s jednomodoluvým relé

*/

int fsrPin = 0; // FSR sensor a 10K rezistor pripojeny k a0
int fsrReading; // analogové čtení z FSR rezistoru
int in1 = 8; //

void setup(void) {
// Výstup do serial console
Serial.begin(9600);
pinMode(in1, OUTPUT);
digitalWrite(in1, HIGH);
}

void loop(void) {
fsrReading = analogRead(fsrPin);

Serial.print("Analog reading = ");
Serial.print(fsrReading); // analogové čtení

// Nastavení akcí
if (fsrReading < 550) {
Serial.println(" - Zadny stisk");
digitalWrite(in1, HIGH);
} else if (fsrReading < 990) {
Serial.println(" - Lehký stisk");
} else if (fsrReading < 1200) {
Serial.println(" - Stisk");
digitalWrite(in1, LOW);
delay(100);
digitalWrite(in1, HIGH);
delay(180000);
}
delay(300);
}