Description
In this assignment, I designed an interactive ring which creates a buzzing noise when it's taken off. To accomplish this, I attached the Piezo speaker on top and attached the photocell to the bottom of the ring. When the ring is worn, the light reading will go under a certain threshold and the speaker will be turned off.
I spent quite a bit of time figuring out the construction for the device. First, I chose a ring that had a fairly wide surface to make the prototype easier to make (the ring's wide surface made it easier to tape down the speaker). The bottom part proved to be a big challenge. I initially tried using an FSR to detect whether the ring is worn, but this didn't work well, since it's hard to detect a touch when the sensor and input (finger) are both horizontal.
Following this discovery, I switched to using a photocell. I first tried using a rubber band to attach the photocell. However, after some trials, I found that the rubber band couldn't secure the photocell tight enough and the sensor moved too much as I put on and took off the ring. Following this discovery, I created an "extension" attached to the ring, which gave the photocell a flat surface to rest. Additionally, I decided to tape the photocell down which lowered the light reading (but this issue was easily solved by modifying the threshold in the code).
This device may be useful to remind the wearer to put the ring back on after s/he takes it off, e.g. when washing hands, etc. Another slightly irreverent application is for wedding/engagement rings, to constantly remind the wearer that s/he is in a relationship (if s/he takes it off to pretend that s/he isn't committed).
A video demo can be seen on this url: https://docs.google.com/file/d/0BzNIHWmnbWZ6YWVJSF9idGFXM1U/edit?usp=sharing
Components
1x 10k Ohm Resistor
1x 220 Ohm Resistor
1x Piezo Speaker
1x Photocell
1x Arduino Uno
1x Breadboard
1x Macbook Pro
Code
// set up sensor & speaker pins
int sensorPin = 0;
int speakerPin = 7;
// initial value
int val = 0;
void setup() {
pinMode(speakerPin, OUTPUT);
Serial.begin(9600);
Serial.println("ready");
}
void loop() {
digitalWrite(speakerPin, LOW);
// read sensor & adjust value
val = analogRead(sensorPin) / 5;
// print out val
Serial.println(val);
// turn off speaker if the ring is worn (the light sensor would detect very low light)
if (val < 120) {
// otherwise activate the speaker
} else {
for( int i=0; i<50; i++ ) {
digitalWrite(speakerPin, HIGH);
delayMicroseconds(100);
digitalWrite(speakerPin, LOW);
delayMicroseconds(100);
}
}
- Login to post comments