Sensor Experimentation
This week we started experimenting with sensors that we think might be helpful for our final project (a sound-sensitive lamp).Microphone Sound Sensor
The most important sensor that we're going to need is one that is able to detect sound, so we started with a Microphone Sound Sensor, and followed the Arduino source code found here.
Microphone with LED off |
I works by setting a threshold sound value at 0 (or LOW) for ambient silence, then if a sound is sensed above that threshold the sound value is changed to 1 (or HIGH). We also hooked up an LED that turns on if the sound value is 1/HIGH and remains off if the sound value is 0/LOW. We're going to keep experimenting with additional sound sensors and lights to find the right combination for our final approach, but this was a useful proof of concept to keep us moving forward.
Tilt Ball Switch
We also found an odd-looking tilt ball switch in a pile of arduino components and thought we'd experiment with how to use it. After watching this Youtube video about how it works, we decided to modify the Button example to work with the tilt ball switch instead of a button. We also added an additional LED to the breadboard, so we could have one green "On" light and one red "Off" light that would toggle on and off depending on the position of the tilt ball switch. One other modification we made was adding the output of the tilt switch to the serial monitor so we could see the value it was sending to the board. Here's are two example images of the "on" and "off" states:
"On" state |
No comments:
Post a Comment