Mechanical Part
Description
I was curious to see if I could diffuse and concentrate the pressure on the FSR. I had a small clamp (reversible spreader) that I could use to control the pressure, and a sheep-shaped PEZ doll whose forelegs and backlegs are of a different size, so I could do a sort of controlled experiment. I attached the forelegs of the sheep to the clamp using the crocodile clips that were part of the helping hand I use to solder. Then I sat the sheep on the arduino board, with the FSR between its forelegs, and started to close the clamp. The LED turned on, but it didn't seem that its brightness increased with the tightness of the clamp. I tried the same procedure with the forelegs, but the results were the same. I failed, but the experiment was amusing. And as you can see from the sheep smiling face, no sheep was harmed during this experiment.
Parts
FSR breadboard set-up (1 LED, 1 FSR, two resistors, wires)
1 PEZ sheep
1 clamp
2 crocodile clips
Code
/*
* Resistive Sensor Input
* Takes the input from a resistive sensor, e.g., FSR or photocell
* Dims the LED accordingly, and sends the value (0-255) to the serial port
*/
int sensorPin = 0; // select the input pin for the sensor
int ledPin = 13; // select the output pin for the LED
int val = 0; // variable to store the value coming from the sensor
void setup() {
Serial.begin(9600);
}
void loop() {
val = analogRead(sensorPin); // read the value from the sensor, 0-1023
analogWrite(ledPin, val/4); // analogWrite (dimming the LED) can be between 0-255
Serial.println(val/4); // writing the value to the PC via serial connection
delay(50); // rest a little...
}
Photos

Sheep forelegs

Sheep forelegs LED on

Sheep hindlegs

Sheep hindlegs LED on