Working with sensors

This week in Physical Computing, we were introduced to digital and analog sensors, and we were tasked to make a simple application of our own with these sensors.

So I moseyed my way over to Tinkersphere to check out their goods. Light sensors, flex sensors, sound sensors… they had the whole shebang. I ended up choosing a temperature sensor, because I remembered that I had a motor, and I thought it’d be cool to get the motor to detect the temperature and automatically turn the fan on if it got too hot.

Temperature_sensor

I couldn’t figure out how to get the motor working though. It required 6 volts, and my arduino could only pump out 5. Turns out my microcontroller needed to hit the weights, but I was in a rush to finish so I saved the motor for later.

Instead, I decided to see if I could flash an LED if the temperature was at a certain level. I found a schematic on adafruit for using the temperature sensor, and I used that to set mine up. Here I am testing my LED

testing_the_led

While I was setting the temperature sensor up, that little bugger burned me badly twice. Turns out that if you plug in the sensor the wrong way, the current flowing through the sensor makes it extremely hot. The temperature readings were reaching over 455 degrees Fahrenheit.

I battled through the harsh and harrowing conditions though, and I was glad to see that my LED was working. I then printed to Serial the data that the temperature sensor was reading. The temperature of the room was steady around 23 degrees Celsius, and when I blew on the sensor, the temp raised to 25.

Blowing into my sensor gave me the idea of creating a breathalyzer of sorts. I briefly debated whether to measure alcohol, but I didn’t want people to take my circuit too seriously, so I instead decided to make my analog sensor to detect bad breath. Whenever someone breathes into the blow tube, a sign attached to my LED would light up indicating that the user had bad breath.

blowtube

It can’t differentiate between good or bad breath of course, instead just measuring a change in temperature. But I think everyone can afford to brush their teeth more often, so for the sake of this assignment, it didn’t matter too much.

Finding the right sensitivity to meet the conditional of when the LED would light up was a bit tricky. If the conditional temperature was set too low, the LED would take forever to turn off, and vice versa, if it was set too high, the LED would never turn on. Moreover, the temperature sensor took a while to regulate itself to the surrounding temperature once it was breathed on. Here’s my final product: