Arduino Automatic Watering System (Garduino)

by Roomber in Circuits > Arduino

1657 Views, 9 Favorites, 0 Comments

Arduino Automatic Watering System (Garduino)

ready.png

I made an arduino based watering system for my chilies while I'm away from home.
I happened to made this one as a web server which I can monitor from LAN and from home automation system (Hassio).
This is still under construction, I will be adding more pumps and will figure out how to add more analogic soil moisture sensors. I should also add an ON/OFF switch. One of the most important upgrade that will make batteries to last longer is by adding a sleep functionality to this web server and setting communication from http to mqtt.

This whole process started when I saw this project.
I had bme280 and wemos d1 mini laying around from project that monitored coffee brewer temperature/humidity at the office, so that I wouldn't need to go and check if it was brewed (yes, I am lazy).
I added bme280 to this project also but had several problems with it which I haven't really got time to fix because watering worked fine while I was on my summer vacation for a week.

Supplies

For this project you'll need following supplies:

  • Wemos D1 mini (I had normal one but you should get pro and be sure it's voltage regulator is not cheap one so that it will power up nicely with a bit worn battery too!)
  • 18650 Li-Ion battery or few. I salvaged mine from old laptop and found 4 working ones
  • 18650 battery holder for the amout of batteries you need. I used four and connected them parallel
  • TP4056 battery charging board
  • Capacitive Soil Moisture sensor v1.2 (which cames uninsulated so you should add some non conductive epoxy on sides and over all soldered components. I have heard that hotglue works also but I used epoxy)
  • BME280 temperature and humidity sensor
  • 5.5V 0.66W 120mA Monocrystalline Mini Solar Panel Photovoltaic Panel (Or more powerfull one, I think this is not enough).
  • 1N5819 diode
  • 6V submersible waterpump
  • 5V Relay module to controll pump. I choosed module that has 5 relays just to be ready for upgrading
  • fiber protoboard
  • and ofcourse some wire
  • One waterresistant box which can hold all electronics in side.
  • food grade silicon tube. Mine was uncolored and innerdiameter was approx 5mm diameter.

Wiring Diagram

5.5V 0.66W 120mA Monocrystalline Mini Solar Panel Photovoltaic Panel.jpg

This is definately not a technical wiring documentation, but added this to demonstrate how I wired this one.
Give me a comment if you need any help with this one!

Insulate Soil Moisture Sensor

kosteusanturi.jpeg

Use hot glue and epoxy to insulate corners of this sensor. I used hot glue near wire connection terminal just to be sure epoxy will not get stuck in there.

Arduino Code

I attached this arduino code. It will have some copy/paste code from other projects.
I personally had some problems with this one and all was related to bme library I had.

Problem was that I wasn't able to connect on server.
Quick fix to solve this one is to remove or add comment on lines 125 and 126

So if everything worked as it should you can add you home automation server to read json from 192.168.1.241/json


I think this should be changed to use mqtt protocol and have sleep functionality enabled.
When I do this with mqtt I will make this to post readings to my HASSIO and then continue sleeping.

Just to note, this file is made in quite a rush when I needed it just to handle watering while I was on my vacation.
I think I should change privacy settings on this one in github, if you want to add something to this project :)

Salvaging Batteries From Laptop Batterypack

batteries.jpeg

In this step you should be in extra caution!
These batteries can explode with guite a power but that hasn't ever happened to me.
Batterycase is usually very tight and might even be glued. I used a little heat from hairdryer and flathead screwdriver to carve this open. After that I disconnected welded metal strip from batteries.

Connect Everything Up and Secure With Some Electrical Tape

piirikuva.jpeg
kaikkiläjässäkuva.jpeg
relekuva.jpeg
wemoskuva.jpeg
bmekuva.jpeg

I attached an picture of mine protoboard and everything else that I tucked inside the case.

I drilled some holes in case for wires (moisture sensor and waterpump).

Connect Silicon Tube

Pumppukuva.jpeg
reikäputki.jpeg

After that I connected silocon tube to submersible waterpump. It was a tight fit, but if yours end up being loose I recommend to use some zipties to secure that in place.

I sliced the tube in few places and tucked some bbq sticks on holes that came up too large. This way I was able to use one pump for multiple plants and everyone got watered guite equally! :D