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.
Remove these ads by
Signing UpStep 1Component List
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)
| « Previous Step | Download PDFView All Steps | Next Step » |

















































Just a couple of thoughts on your over-all design:
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.
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.
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.
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.
news.bbc.co.uk/1/hi/world/asia-pacific/8365599.stm
When this project is complete, I may just take your advice! It makes sense having a control as you've mentioned.
Keep up the good work!