On the eve of New Years, just after we finished tidying up the house and just prior to our awesome guests arriving, I found a few minutes to sit down and tinker with the Arduino kit. This time around, the lesson introduced a new type of thermal sensor as well as some creative uses for it. It was up to me to decide which application to choose… so, of course I was going to build a love machine (tester) and was going to prove once and for all, that programming was sexy.
Before I tell you the outcome of this very serious and accurate test of ones love capacity, I want to talk a little bit about the sensor that makes the magic happen. I used a resistance temperature detector (RTD, don’t worry, its not communicable), which is a small, three pronged electric sensor that has a variable resistor inside of its housing that adjusts based on the sensed temperature. In the case of a thermostat application, the sensor detects the temperature of a room/house, and adjusts the voltage that is sent back through the circuit it is attached to. Code inside of the thermostat does then determines if the heat needs to go on or off. Interestingly, the application for this little marvel in a thermostat, doesn’t differ that much from a love machine. I wonder which one came first?
The circuit build for the love machine was relatively easy:
An RTD, 3 LEDs, 3 220 ohm resistors, and of course, the Arduino. The green wire connects the middle prong of the RTD to analog “0” on the board. I think I have grasped the nuances of not frying the bread board or the Arduino (we’ll see as these circuits become more complex); the area that I am not as knowledgeable, is the syntax in programming for this thing. Code is below:
The need to test my love has yielded some understanding of Arduino syntax and functions. Serial.print allows me to monitor different values in real time through an interface between the Arduino and my PC. analogRead is new, as well as the difference between an integer and floating point variable (hint: its a decimal point and processing power).
Lets not get too bogged down on the technical aspects of the program; what all of this text and wiring does, is allow me to place my finger on a sensor and determine how “hot” I am by lighting up a series of LEDs. 1 LED is “cold fish”, 2 LEDs is “loveable”, and 3 LEDs is “Hot Tamale! The result of the test is entirely based on the temperature of the persons finger… or whatever appendage is touching the device. (stop being gross).
After I uploaded the code to the board, I let her rip. The result? Well, see for yourself:
3 lights, all lit up. I’m not sure which is a better example of the love machine. The Arduino…. or me. =)