This sketch is missing a short description
This project is for the Ecoduino by DFRobot.com and Damien Alexandre
Instructions:
1) *Optional* Go buy an AC to DC 9v 1A adapter with a 5.5mm x 2.1mm jack (search this on google). You can get these on ebay for $6, look where you are buying from so it doesn't take two months. This way you don't have to use 6 AA batteries to run the water pump.
2) Open up your kit and put everything together, do not hook up the water pump. You can watch this youtube video to help put it together, pause it to study. https://www.youtube.com/watch?v=QHyjk6f-ric
or use the DFrobot wiki: http://www.dfrobot.com/wiki/in...
Pay attention to the wiring for the two sensors, black is ground. Replace the battery pack with the AC to DC adapter. Wait until you are ready to experiment with watering (letting the water drain somewhere other than the plant) before plugging in the water pump, this way you don't spray water everywhere or drown your plant!
3) Plug your arduino into your computer with the usb. Go to www.codebender.com and sign up. This Ecoduino is called an Arduino Leonardo. Codebender will automatically download the drivers and test the Arduino. It should automatically connect to the correct COM port (usb port). If it fails, just select a different port. When uploading a sketch (program for the Arduino) it will reset the Arduino and your computer should make two beeps, and the Arduino LED's will flash. Here is the code for the Ecoduino:
https://codebender.cc/sketch:2...
Make sure you select Arduino Leonardo in the drop down menu, and the correct COM port and select upload!
4) When it says "Upload Successful" scroll down and Open Serial Monitor. Place the moisture sensor about an inch into compact soil. Make sure it is on the correct COM port and you will see:
Soil Moisture is : 80 ( This is the moisture Sensor that you placed into the soil. 0 = no moisture 100= freshly watered. I noticed that soil straight out of a bag is at 80.)
Humidity-Max is:79 (There is a blue potentiometer on your ecoduino, turn it with the included screwdriver clockwise to increase this number, counterclockwise decreases this number. When Soil Moisture is less than Humidity-Max, the water pump will turn on. You will need to experiment for a couple weeks to see when your plant actually needs watered and what the soil moisture is at that time.)
Temperature is :23.00 (The temperature in Celsius. 23C = 73.4F. The DHT11 sensor uses the humidity sensor as the control in the code, and also reads the temperature.)
The last of the code is self explanatory.
Pump is on!
The pump is shut down now!
Sometimes the code updates too quick and continues to water the plant too much. It is up to you to get the Ecoduino to water the plant correctly, which takes skill, patience, experimenting and possibly modifying the code to increase the time between tests or duration the water pump is turned on for. You can modify the code by selecting the Clone code button (must be signed up). The first "delay(2000);" is the time it takes to turn the pump off. The second "delay(2000);" is the time inbetween each test. When I started watering my plant, I used 500 for the first value and 60000 for the second value (.5 seconds of watering then waiting 60 seconds). With the potentiometer set at 80 (humidity max) so the soil would be nice and dry.
When you are comfortable with the settings, you can disconnect the Arduino from your computer, place it in the waterproof container and plug it in near your plant (or use the batteries) and the code will run on its own, set up a jug of water with the correct PH for your plant and the pump inside and you've automated your plant watering.
Hopefully this will help somebody, there are a lot of ways to do this but this is by far the easiest.
Embed This Sketch
Use the following HTML code to embed the sketch code above in your blog or website.
<iframe style="height: 510px; width: 100%; margin: 10px 0 10px;" allowTransparency="true" src="https://codebender.cc/embed/sketch:78916" frameborder="0"></iframe>
Embed The Serial Monitor
You can also embed the Serial Monitor section! Just use this HTML code.
<iframe style="height: 510px; width: 100%; margin: 10px 0 10px;" allowTransparency="true" src="https://codebender.cc/embed/serialmonitor" frameborder="0"></iframe>