Disclaimer: The author assumes no liability for any incidental, consequential or other liability from the use of this information. All risks and damages, incidental or otherwise, arising from the use or misuse of the information contained herein are entirely the responsibility of the user. Although careful precaution has been taken in the preparation of this material, we assume no responsibility for omissions or errors.

This will form Part 1 of a series to achieve an automated indoor grow space.

What I'll cover in this instructable:
1) A Relay that switches a light on and off on a timer.
2) The use of a Light Dependent Resistor.
3) 3 x DS18B20 temperature sensors daisy-chained.
4) 2 x Moisture sensors.
5) The arduino sketch.
6) C# program, Serial interface, MySQL API.

Project Mission: Create a solution that will automate indoor plant growth, be safe and remotely manageable. Maybe include some external weather information. All aimed at learning new tools.

Project End Goals (What I ultimately want to achieve):
1) Measure temperature and light in the grow space, my room and outside, mostly because the data should be interesting and defines the environment in and around the grow space. Values to be saved in a database (MySQL in this case) and be graphed through MS Excel through an odbc connection. The light and temperature will also be used as control to ensure the light mentioned in point 2 below, does actually switch on.
2) Switch a 220volt light system on and off on a configurable timetable.
3) Measure soil moisture. I'm going to measure the moisture content in two pots and may even look into setting up checks for possible water overflow or leaks, as a control measure.
4) Switch a 220volt water pump on for a period of time to water the plants, when moisture levels drop below a certain threshold.
5) Control the temperature with the use of a fan/extractor fan.
6) Video Cam to remotely monitor. Website for remote access and control.

Warning: When working with water and electricity, place all plugs, connectors, relays, etc, higher than your plants and lights. Run cable's down. Insolate properly. Use common sense. Watch your humidity and condensation.

Step 1: Component List

You can scale your own project up or down, depending on your design needs.

Software used:
1) Arduino IDE. Refer to Arduino website on where to buy and how to setup your Arduino. I got my kit from Earthshine Design.
2) Microsoft Visual C# 2008 Express Edition.
3) MySQL. Many sources. Try http://sourceforge.net/projects/phpdev5/ Note this will install a host of other software that we might use in later parts of this series.
4) MySQL/Net 5.2.  I struggled a bit to get this API working in C#. Your luck may vary. This provides you with these definitions on the forms code:
using MySql.Data;
using MySql.Data.MySqlClient;
5) Microsoft Excel.
6) MySQL Connector/ODBC 5.1. For MS Excel to connect to MySQL through ODBC.
7) SendEmail
8) Fritzing
9) HeidiSQL

- I will not spend time explaining the installation of these. If there is enough interest I'll consider covering some in a later series, but most of the above is well documented already.

Hardware used:
1) Arduino Duemilanove
2) 1 x TIP-120 NPN Transistor
3) HFS41
4) 3 x DS18B20
5) 1 x 1N4001 Diode or others
6) 4 x Galvanized Nails
7) Some Cable (I like to use UTP Cat5 cable)
8) 1 x Light Dependent Resistor
9) A breadboard
10) PC or laptop
11) A grow light of sorts
12) Some Jumper Wire
13) Pots and plants.
14) 1 x 1.5Kohm resisor
15) 4 x 4.7Kohm resistor (Does not have to be exact)
You may do almost everything by using of mysql database recovery tool<br> <br> The article describes all the features here <a href="http://www.mysql.recoverytoolbox.com" rel="nofollow">http://www.mysql.recoverytoolbox.com</a>
Is the main use for this to grow pot? or should i get my mind out of the gutter?
Not sure why you'd want to grow pot, it isn't very nutritious, and eating it gives you the munchies. Not to mention the projects that pile up while napping...
Hey nice project. I'm just getting into micro-controllers (the Arduino platform specifically) myself and am contemplating something along these lines as a future project.<br> <br> Just a couple of thoughts on your over-all design:<br> <br> You seem to be taking a lot of readings for something that is relatively static - for example the plants should need only a small trickle of water over the course of a week, which means all you need to test for is a high/low condition and trigger a response for each (add water when low, alarm when high) when they are met. Similarly the grow light - you could use a simple timer on the Arduino itself connected to the light sensor to figure how much sunlight the plant has received, and how much more light it would need for the day. Ditto for the temperature sensor, and the timer would probably not even be necessary for that function.<br> <br> Juggling all these is well within the Arduino's capabilities, and polling a few times a day for sensor data to plot trends would be no problem at all.<br> <br> Conceptually it seems much simpler to me to do it this way instead of constantly collecting fresh data. I actually can't see it being much more complicated than the Arduino code you are already using, and you could put the whole thing on the Arduino instead of relying on a PC to house a relatively large database of information that changes very little. Except for catastrophe situations (something breaks and floods your setup, or something), nothing should need changing in the system more than twice a day (on/off for the lights), with watering a couple times a week, and temperature hopefully not at all.<br> <br> If you were to add an Xbee wireless module to the Arduino, you could run the entire system on the Arduino and only use the PC to collect statistical data (how much sun it got, daily moisture value, any temp spikes, etc) and make configuration changes.<br>
Thanks for the feedback on my project and you're correct in most of your statements. W.r.t. taking a lot of readings: When I started the project, I wanted data to work with and I therefore took a lot of readings. I wanted to be able to find trends on plant growth depending on conditions (light, water, humidity, temp), etc. It has however worked against me. MS Excel has a cap on how many data points one can plot in a graph. As it is currently, I can plot max about 4 months worth of data. To plot a years worth or maybe two years worth of data, I'll have to severely limit the amount of data I collect. W.r.t. letting the arduino do most of the work and/or using a timer on the arduino for the grow light: Because I ultimately want to be able to remotely control the environment, a PC to change things is essential. Hard coding a timer in arduino will be tough as well, since it does not have a real-time clock and by its nature it does not multitask well (how will one handle multiple timers?). But, there are many ways to kill a cat and depending on your ultimate goal I'm sure it could be done with the arduino alone. Lastly, I must mention that I have made plenty of changes, both to the code and the electronics. Variable fan speed (PWM) and ac moisture sensors to name a few changes. I&rsquo;ll be posting part II soon.
Yes I Love What You've Done I Was Actually Doing Some Research Into How Feasible It Would Be To Have Entirely Robotic Farms, And I Was Thinking Of Having Some Sort Of Mount For A Robotic Arm, And A Hydroponics System, How Much Do You Think This Would All Cost?<br />
I'm not entierly why you would need a robotic arm for, but I'd love hear more details.
To automate the harvesting.........<br />
Thought this might interest you<br /> <br /> <a href="http://news.bbc.co.uk/1/hi/world/asia-pacific/8365599.stm" rel="nofollow">news.bbc.co.uk/1/hi/world/asia-pacific/8365599.stm</a><br />
Very interesting, thanks for the link.
Looks great! Now even I can be a chef with fresh herbs in the kitchen. It would be interesting to plant some control specimens in your window sill. Please let me know how the project develops.<br />
<p>When this project is complete, I may just take your advice! It makes sense having a control as you've mentioned.</p>
ooooh i see your growing some curry plant.<br />
Yhea, I'm still not 100% sure what to actually plant once I've got everything working the way I want it to. Considering the size of my garden, at this stage, Chilli plants seem the most likely candidate.
That was Groovy man!<br /> Keep up the good work!<br />

About This Instructable




More by Lolander:Indoor Grow Space Automation Part 1 
Add instructable to: