Automatic Plant Watering
First off I know this probably has been done to death , I am new to Arduino so it was a fun project and also I learned a few things. That was my intent was to gain some knowledge here, as I have added into the INO file that there was a lot of smart people that did the hard work and I just manipulated it to do what I wanted. This is a Peach tree that I started from seed , was not very good at watering it so that was my inspiration for this project.
Supplies
Arduino Uno or a Nano
2 Galvanized nails
a few resistors ,if adding leds you will need to use a ballast resistor for each ,I used 220 ohm because that is what I had.
10K resistor for the moisture sensor
Leds , 5mm
ECG85 transistor and a 220 ohm resistor for bias voltage
some jumper wires
a pump , I used a 6vdc
Create You Sketch for Arduino
This is the sketch that gets downloaded to the Arduino, make sure that you know which com port that the cable is plugged into . This is pretty simple, when Arduino is connected , look at the pull down menu (tools) and you will see the com port.
When you have that , then just load the file to the board .
Downloads
Building the Circuit
You will need a bread board and a few led's as well as some jumper wires ,follow the image to create the project.
Just a note here ,depending on what you use for a pump , you will need to use the correct voltage on the bottom rail. I used a 6vdc pump I had lying around. The Arduino will not tolerate that voltage for switching on the pump, it will damage the board. i used a ECG85 NPN transistor as seen in the image which will handle the pump. There are other ways of doing this with a Logic N MOSFET or a NPN 2n222 transistor, I just used what I had lying around.. Also a good Idea is to use a diode across the pump +and - terminals. I also used a three color led but you can use any led, just make sure that there is a resistor for ballast or you will not have an led left.
Polarity: NPN
Maximum Collector Power Dissipation (Pc):
0.6 W Maximum Collector-Base Voltage |Vcb|:
70 V Maximum Collector-Emitter Voltage |Vce|:
70 V Maximum Collector Current |Ic max|: 0.4 A
Make the Moisture Sensor
You can buy one or simply make your own, found this idea on the net , all I did was get 2 casing nails because they are galvanized and solder wire to each of them. I marked a line on the nail so that when I insert it into the soil I can use it for a reference mark, should check at approximately the root level. You can solder wires onto the nails and then push them through a plastic cap like a milk carton cap to make it easier to use.
I find the readings to be pretty accurate for my use. I used a 10K resistor to create a voltage divider , that is how the sensor sends data back to the Arduino There is some calculations that you can manipulate to your desired output, also you can change the values to read the output 0-1024 or percentage ,currently they are both printed out. You can also monitor the values on the serial monitor or plot to the plotter, just select it from menu, if you have the serial monitor open and try to open the plotter window, it will not open until you turn off the serial monitor. Above you can see the outputs to the serial monitor and one of the plotter.