Windowfarm using Arduino for control
11:07 pm in Completed Window Farms, electronic components, posts with pitcures!, Projects in Process by nemanja
I started my WindowFarm about a month ago, working on it in my spare time. I wanted to interface it with a microcontroller for automation and used the ATMega168 (same as on the Arduino) to control a windshield wiper pump to move water through the system for 4 seconds every 10 minutes.
The construction of the actual WindowFarm setup is IMO pretty terrible-looking and very sloppy. I just wanted to get something working though, and the plants don’t seem to mind.
Here is a picture of the circuit:

And here is a picture of the complete WindowFarm:
I wrote a little bit of code for a Fonera Fon2100 router I had lying around, making the modifications to the OpenWRT firmware (version 8.09.1) running on there. It gives its web-interface a ‘Sensors’ link that AJAX-updates the analog pin values from the Arduino. Right now on my setup it is all just noise except pin 0 which has a photosensor on it that gives light readings near the window. It is the plan to turn on the lights in an 18-hour window if the light value falls below some threshold.
Here is a screenshot of OpenWRT’s modified web-interface:

I have the code for the Arduino sketch as well as the OpenWRT changes here: http://github.com/nemik/arduinoponics and more photos of the setup on my Flickr set here: http://www.flickr.com/photos/nemik/sets/72157622608195083/
I’m going to try to automate this more and more, hopefully also fix the construction.
Open to any suggestions or criticisms!

Rad!!!!! I totally love this! You are helping with one of the biggest issues with this system- pump timer control!! That has been a real constraint because the pump timers commonly available on the market at a low price point do not really give us enough control with this system. You want to be able to customize the cycle time as you change out the medium, the kind of plants, the size of the reservoir, and the drip rate in a reservoir system. If you’ve got great control over the pump, you can basically elimiate the reservoir at some point (theoretically) which makes wider adoption by apartment dwellers much more likely. People are wary of hanging a big volume of water up on the wall.
I had never tried a commercial timer because of the same reason, there was no way to get the control I wanted.
Granted, the control I have now is pretty limited and simple (run pump for 4 seconds every 10 minutes), but the web-facing router managing the settings of the microcontroller and collecting senor data make it pretty nicely configurable. I needed a short run-time since the pump has a low duty-cycle and would burn out if used for more than 7 seconds or so.
Britta, are there any specific parameters you would like to see that can be defined aside from the run-time and the time between runs? Not sure if they should vary depending on the time of day or whatever, but would be cool to get your input for this to make it better. I’m still fleshing all this out, it is in very-very initial stages but working surprisingly well.
I am also extremely wary of hanging a reservoir from above and chose to do it this way since the little pump is very cheap, and very strong. It is perfectly capable of moving the water the necessary ~4 feet now and I’m sure it’d have no trouble doing even 10 feet.
I’ll try to make an electronics schematic for the pump-timer circuit so others can reproduce it. But the Arduino code in my repository there is simple enough, just changing the “pump_run_seconds” and “pump_run_interval” variables and uploading the sketch to an Arduino would be enough. Of course, the Arduino would have to have the necessary transistors and stuff to turn on the pump, but the code itself is very easy. The next step will be to have those cycle parameters be changed from the same web-interface that the router exposes.
I just Googled for schematic electronics and Got your Page.Your Post Window Farmers — Blog — Windowfarm using Arduino for control is really Nice.Pl. keep posting on schematic electronics
Very cool idea!
I don’t know but this might be able to help you. Make had something about a “Garduino” unit in mid-2009. http://makezine.com/18/garduino/ this is a link to the code they used. Here is the build process for it as well http://www.instructables.com/id/Garduino_Gardening_Arduino
Again, it really is an awesome idea and I am stoked to see someone already going down this road. I am collecting supplies right now and hope to be able to build a nice system once I get into my new place in the windy city.
Wow. I feel very ignorant reading this. Seems rather over the top and complicated. I am looking for pump ideas that I can buy because I am not technical in any way shape or form. Kudos to your brain.
Just adding this link in case people decide to persue similar projects:
http://www.makershed.com/ProductDetails.asp?ProductCode=MKPS01
I love this type of building from scratch stuff but wouldnt it be easier to suggest using our computer’s serial data port to trigger small pump relays? We all have computers, relays are simple and cheap, AND timed control of serial data certianly must be widely available for free. Just a thought….
@Bill: The serial port of a PC is NOT a good option.
Not only do you have to reboot your PC whenever it crashes, but Windows(or any other OS) will ‘query’ the port, looking for attached plastic rodents and such, and generally be noisy.
Microcontrollers offers several major advantages:
1. They’re ‘deterministic’(mostly… ) and generally, their I/O pins are set as inputs when switched on, which is an ‘easy to handle’ state for attached electronics.
2. Reboots… Don’t happen. And when something does happen, a restart takes very little time.
3. No other SW running to make your life miserable.
How difficult would it be to have the system respond to additional sensors to change the frequency? I was thinking of temp (h2o & air), humidity, and light. It would take a lot of experimenting to come up with a program that was ideal, but It wouldn’t be a very difficult experiment if you had two of these going.
If your interested in trying this; I have some ideas as far as parameters, though I don’t know much about programing.
@Trygve Henriksen is absolutely right. The stuff that’s done very often in intervals and that must be reliable such as water and even lights, etc should be done in small and reliable code in a microcontroller. Now you can use the serial port to change parameters for those actions (change watering interval from 30 minutes to an hour) via the serial port or another way to talk to the computer.
But using the MCU as just a pass-through device to give a ‘regular’ computer more inputs/outputs isn’t a great idea.
@Owen that would not be too hard IMO and this is sorta the direction I was heading until I moved into a much smaller place and hence am not doing any further development on this setup or circuit. Parameters can always be tweaked endlessly and should be. The hard part seems to be designing a good interface to customize how certain inputs should change certain outputs. If it’s just in code that’s fine, but perhaps those kinds of things should be doing form some user-friendly GUI that can then update the microcontroller with those values. I started down that basic path by giving the web interface of the router the ability to change certain characteristics of the MCU, I guess now just more user controls would be needed.
Also @Owen, learning programming is for this kind of stuff is not too hard. Just start small and get an Arduino, have it listen to light/temp/humidity etc and then change some LED’s to simulate watering. There are TONNNNS of tutorials for that kind of stuff out there. Then just hook those LED outputs to a relay that controls a pump or lights or whatever, lots of tutorials for that too. Then later you could look into changing those from some web interface, but all that comes from step-by-step work.
@nemanja I am looking into doing something similar with my Windowfarm(which I am still designing). The idea is to use a grandfather clock like setup to run the pump(a mechanical pump geared with bike parts), with a brake that is controlled by sensors in the reservoirs or a moisture sensor in the soil, and a DC motor to re-wind the drum for the gears. The electrical parts will use a rechargeable battery that gets it’s charge from a solar panel as well as an alternator that taps into the power of the gears.
Its a convoluted plan, but if it works right, it will be totally independent of the power grid and I think entirely green. Any idea how viable running an arduino from a battery is? A friend suggested a Picaxe instead.
@nemanja I am looking into doing something similar with my Windowfarm(which I am still designing). The idea is to use a grandfather clock like setup to run the pump(a mechanical pump geared with bike parts), with a brake that is controlled by sensors in the reservoirs or a moisture sensor in the soil, and a DC motor to re-wind the drum for the gears. The electrical parts will use a rechargeable battery that gets it’s charge from a solar panel as well as an alternator that taps into the power of the gears.
Its a convoluted plan, but if it works right, it will be totally independent of the power grid and I think entirely green. Any idea how viable running an arduino from a battery is? A friend suggested a Picaxe instead.
p.s. Sorry if I posted this twice, it am having some sort of issue posting.
Joseph, that does sound pretty convoluted. I’m not sure how much energy a DC motor will need to drive mechanical bike parts. Perhaps a battery and solar charger could do that, but I imagine both of them would need to be large for that to work. Otherwise with a small solar cell, it won’t charge the battery enough to run.
Also, if your intention is to be ‘green’ I doubt a battery is the way to go. Even rechargeable ones need to be replaced and the environmental impact from production of most battery cells is IMO much worse than the methods used to produce electricity for the grid which is actually quite efficient. If you want to run this remotely in an area without access to the grid that’s another thing. But I don’t see this plan as being very ‘green’ if you do have access to the mains from a reliable power grid.