Arduino House Watering Automation

Arduino Plant Watering Drip Feed System – Part 2

Arduino Plant Watering Drip Feed System

Arduino Plant Watering Soil Humidity MonitoringIn the second part of this project, we will be looking at driving a water pump with the Arduino. Based on the moisture level in the soil, this will allow us to enable watering. Note that this may also be accomplished by a valve. In other words, if your water container is higher than the plant, you can open/close a valve thus releasing the liquid.

Required materials and hardware

Our Arduino Plant Watering system will require several items in the second part. I’ve pre-selected the following items:

Optional Hardware:

Connecting your Arduino Watering System

The connections for the arduino plant watering project are quite simple. You will need to connect the base of the transistor through the current limiting resistor and into the arduino digital pin. The emitter and collector of the BJT are used to toggle the relay. They need to go through the coil. When the coil is energized, the relay will close on the high voltage side. You will need to create a loop with the pump, relay high side and the 12v battery. View my video for detailed instructions on how to build the full circuit. You will have your Arduino watering system running in no time!

Here is the full wiring diagram for the circuit. Note: the humidity sensor itself connects to the red module you can see on the drawing.
Arduino Plant Watering

Programming the relay driver and the pump to turn on based on water level

CODE: FULL CODE ON GITHUB
In this part of the project, we are ready to water our plant. Most of the code is reapplied from part 1; the only difference being the driver for the relay and the condition to water the plant.
int waterPump = 13;
void setup() {
Serial.begin(9600);
pinMode(waterPump, OUTPUT);
}
void loop() {
int humidityRaw = analogRead(A0); // 1023 to 0 ===> 0 to 100%
int humidityReal = map(humidityRaw, 1023, 0, 0, 100);
Serial.println(humidityReal);
delay(100);
if (humidityReal < 90) { digitalWrite(waterPump, HIGH); }else{ digitalWrite(waterPump, LOW); } }

As you can see, the code is not extremely different than what we had in the first part of the tutorial for the automatic watering system. The major difference is the initialization of the relay pin and the check for the moisture level to be below 90%.

Conclusion

You should now have a fully implemented arduino plant watering system in your house. You can safely leave this running while you are on vacation or travelling. The biggest watch-out for this setup is the fact that a restive sensor will corrode overtime. It can either be replaced or triggered based on a timer which would prolong its life. Lastly, a respectable automatic watering system would have an integrated light system. I'll let you figure that one out.

Make sure to update me with any projects you've built!

Thank you for reading & watching!
- EEEnthusiast

Comments 1

  1. Hi, i’m new to Arduino. Your work is awesome. Can you email me the full circuit diagram? I would like to try and surely appreciate it very much 🙂

Leave a Reply

Your email address will not be published.

CommentLuv badge