How-To: Make Twine see the light with a photoresistor
Heya! Risto here. Ever since I’ve started using Twine to monitor the temperature in my house, I’ve found myself obsessing over my home’s energy consumption. Using the data I’ve been logging with Twine and ThingSpeak, I have been dissecting my utility bill to find out if the majority of my electricity is being consumed by my not so cool air conditioning unit. Turns out that although my AC is the main culprit, it’s not alone.
I suspect that my bad habit of leaving the light on in my garage for days at a time isn’t helping matters. I’ll step into the garage to grab some tools and walk out with my hands full, thinking “I’ll be right back,” only to realize much later that I never turned off the light. What to do??? Hrmmmmm… Ahha! Lightbulb!
With nothing but my Twine, a breakout board, and a cheap photoresistor, I now get a friendly reminder every time I leave the light on. Here’s how:
First, grab a photoresistor from your favorite electronic component distributor, or RadioShack, and insert the photoresistor’s leads (I clipped mine short) into the GND and IN terminals of your Twine’s breakout board (polarity doesn’t matter). You may want to experiment with wiring a small value resistor in line with the photoresistor if it’s too sensitive to the light you are trying (or not trying) to detect. In my case no extra resistor was necessary, but some may find a 560 to 1.5k resistor helpful.
Next, save a rule to your Twine to let you know when light is present. The breakout board will trigger as “closed” when the photoresistor detects light and “open” when light isn’t detected. My rule states that WHEN the breakout board is closed for 5 minutes, THEN text me a reminder to turn it off. The rule should look something like this:
Now, all that’s left is to put your Twine where you want to be able to sense light. I sat my Twine on a shelf out of the way and made sure the photoresistor was looking in the direction of my primary light source.
After trying this setup out for a few days, I found out that it would also tell me if I left the garage door open during the day because of the sunlight shining in. Two birds with one Twine!
I now take solace in the fact that Twine has got my back; hasta la vista, outrageous electric bill. Now if only I could get my roommate to turn off the stereo when he leaves…