Plants Use Twitter to Tell You to Water Them 88
ptorrone noted a Make article about twittering your plants just in case you need that sort of thing in your life. And you do. He says
"The gang from Botanicalls used one of Adafruit's new open source hardware ethernet shields for Arduino (open hardware too) to make some plants talk — and now you can too! That's right, having your houseplants Twitter you when they need water and more! You can see what one of the plants is doing now..."
Re:Arduino is a great platform (Score:3, Informative)
Certainly, though the details depend on the kind of light; since you say a dimmer, I'll assume you mean a normal 120V incandescent. It would be easier with LEDs or low voltage DC lights, harder with fluorescents.
Warning: this is a high voltage circuit. Don't kill yourself, observe normal precautions, etc. Mistakes might well fry you or the circuit. Also, in an effort to keep this as simple as possible, the wiring will not be to code -- as in, both sides of the light bulb will be potentially "hot", so you could electrocute yourself from *either* contact on the socket, not just the central one. The zeroth thing to install in this circuit is an appropriate fuse and a main power switch. A GFCI outlet wouldn't be a bad idea.
One other poster suggested a triac, but those might be a bit of a pain to work with. An easier answer might be the following. First, you need an isolated DC power source for the controller -- anything coming through a transformer is fine, but from eg a computer power supply is not fine. Next, you put a full-wave rectifier [wikipedia.org] in front of the light bulb, so that it's effectively running on DC voltage (it's varying amplitude, but all the same polarity). Verify that the light bulb lights up at full brightness at this point.
Next, connect the minus end of your rectified light bulb supply and your circuit ground together. You now need a power N-channel MOSFET [wikipedia.org]. It should have a voltage rating of at least 200V and a current rating several times the nominal bulb current (eg 60W bulb at 120V = 0.5A, use a MOSFET rated for at least 5A surge currents). The source connects to ground, the drain connects to one side of the bulb, and the gate connects to a pin on the microcontroller. Add another rectifier diode from the transistor drain to the rectified positive voltage, oriented so it normall doesn't conduct -- this is a freewheel diode to make sure that any inductive load the bulb presents doesn't hurt the transistor. (When you turn off the bulb very rapidly, current will continue to flow briefly, possibly overvoltaging the transistor. It shouldn't actually be an issue, but it might be, so add the diode.) Lastly, the other side of the bulb connects to the rectified wall current.
You should now have an electronically controlled light bulb -- when the gate voltage is high (roughly 4-8V, the 5V from the controller will work fine), the bulb should be on; when it's low (pulse width modulate the bulb -- basically, turn it on and off quickly, about 1000 times per second should work well. To control the brightness, simply vary how long it's turned on. So a "dim" setting might be on 200us, off 800us, and "bright" might be on 800us, off 200us. Fully on and fully off are easy.
Lastly, get a simple 5V relay capable of switching the light bulb on and off, controlled by the microcontroller. Any time the light bulb is completely off, turn it off with both the relay and the MOSFET. When the bulb is off, both sides of it are hot and a hazard; the relay fixes that. Be sure to include a freewheel diode so the relay coil doesn't damage the microcontroller.
This circuit will cause electrical noise; there's some chance some electronics operating near it will be unappreciative, but it shouldn't be too bad.
Hopefully that's easy enough to understand. Email me if you have questions.
Re:What is a "ethernet shield"?? (Score:2, Informative)
Re:Yeah, like my plants need to remind me to water (Score:3, Informative)
For office plants, I'd suggest getting something cooler than a philo to keep your aloe company, like maybe a nice Haworthia (an Aloe relative). I've never tested this out, but they are supposed to be able to thrive in relatively low light conditions, like an office, and thanks to their small size, they're space conservant. My favorite member of the genus is H. limafolia [davesgarden.com] (especially the rarer nigra and varigate [davesgarden.com] forms). An office cactus might become light stretched and sickly unless you've got a corner cube with a window, but it never hurts to try. There are lots of cool and moderately easy things to try growing; my personal favorite are succulent members of the Euporbia genus, and the Haworthia mentioned above, but there are also nice genera like Echeveria, Crassula, Gasteria, Aeonium, Senecio, Pachypodium, Kalanchoe, Aloe (there are way cool things [davesgarden.com] out there besides aloe vera), and in the cactus family, Mammillaria, Lobivia, Austrocylindropuntia, Tephrocactus, Oreocereus, Myrtillocactus, Hylocereus, Pereskiopsis, and many others.
All those genera have some species that are easy to grow, provided they're kept dry between their weekly, biweekly, or monthly waterings, depending on species and season (except Pereskiopsis and, to a lesser extent, Hylocereus, jungle cacti that don't mind being wet). If they're too wet they will rot, the number one killer of potted cacti and succulents. If you decide to try your hand at them, don't worry if you rot a few; everyone does. Many of them can be found at your local Lowes, Home Depot, or Wal-Mart, probably in crappy soil with a flower glued to them dying from lack of/too much water and not enough light. Worst case scenario you're out a few bucks, best case you've made yourself a lifelong friend.
They might need to be rotated between work and a window at home every now and again, depending on how much much light they're getting, but I guarantee your cube will look better if its loaded with spiky, colorful, and otherwise strange plants that look like they came from another planet.