Desription
Through FSRs and a DC motor, I made a simple structure of automatic toilet paper hanger. It seems to be useful for disabled peoples or children.
Component
A roll of toilet paper, a sponge-cylinder, a DC motor, FSRs, Arduino board, Bread board, wires, diodes
Arduino Codes
int potPin = 0; // select the input pin for FSRs
int motorPin = 9; // select the pin for the Motor
int val = 0; // variable to store the value coming from the sensor
void setup() {
Serial.begin(9600);
}
void loop() {
val = analogRead(potPin); // read the value from the sensor, between 0 - 1024
Serial.println(val);
analogWrite(motorPin, val/4); // analogWrite can be between 0-255
}
<object width="425" height="350"> <param name="movie" value="http://www.youtube.com/v/AqVG0eCnWe8"> </param> <embed src="http://www.youtube.com/v/AqVG0eCnWe8" type="application/x-shockwave-flash" width="425" height="350"> </embed> </object>