Description
Arduino Pressure Sensitive Light Balloon
For this lab, I blew up a balloon (actually, a white cleaning glove), and used my hand to squeeze a Force Sensitive Resistor (FSR) connected to the back of the balloon. This turned on an LED that was behind the balloon, based on the amount of pressure that the hand is squeezing the balloon with. No squeeze is no light, easy is red, medium blue, hard green.
I found that the glove is the best diffuser I came across in my search of a diffuser. The LED could be inside of the balloon, with additional wires sticking out of the bottom, however, this would have been an unnecessarily difficult task (as far as soldering the LED, blowing the balloon up with wires sticking out, and tying), but the idea is obvious.
The input is the pressure from a hand squeezing on the balloon. The output is the balloon lighting up and changing colors as the hand squeezes it. This is an effective input/output coincidence.
Components Used
1- Arduino Board
3 – 220 Ω Resistors (for LEDs as visual indication of input
3 – LEDs (red, blue, green)
1– 10,000 Ω Resistors (for Force Sensitive Resistor, as resistance to ground)
1– Breadboard
1 – Force Sensitive Resistor (FSR)
Connecting wires
Code
/*
* Pressure Sensitive Light Balloon
* Takes the input from a resistive sensor, e.g., FSR connected to A0
* Shines 1 of 3 LEDs, at full brightness, depending on pressure being applied
* Light is seen through a balloon, either interiorly or behind
* A cleaning glove is used as diffuser, with hand pressing the FSR on back side.
*/
int sensorPinA0 = 0; // select the input pin for the sensor
int pinBlue = 11; // select the output pin for the LED
int pinRed = 10;
int pinGreen = 9;
int sensorValue = 0; // variable to store the value coming from the sensor
void setup() {
Serial.begin(9600);
}
void loop() {
sensorValue = analogRead(sensorPinA0); // read sensor value, usually 0-300
if (sensorValue == 0){ //if FSR not pressed, don’t shine a light
analogWrite(pinRed, 0);
analogWrite(pinBlue, 0);
analogWrite(pinGreen, 0); // analogWrite can be between 0-255
}
else if(sensorValue < 100){ //low FSR Value => print Red
analogWrite(pinRed, 255);
analogWrite(pinBlue, 0);
analogWrite(pinGreen, 0);
}
else if (sensorValue < 250){
analogWrite(pinRed, 0);
analogWrite(pinBlue, 255);
analogWrite(pinGreen, 0);
}
else{
analogWrite(pinRed, 0);
analogWrite(pinBlue, 0);
analogWrite(pinGreen, 255);
}
Serial.println(sensorValue); // writing the value to the PC via serial connection
delay(50); // rest a little...
}
- Login to post comments