IoT Fully Automatic Watering System

by taichirabbit123 in Circuits > Arduino

575 Views, 3 Favorites, 0 Comments

IoT Fully Automatic Watering System

IMG_20230128_191312.jpg

Inspiration:

Watering plants have always been a part of my mum’s daily life since I could remember. However, she had always been complaining they were too difficult to maintain as they always ended up either being overwatered or underwatered. Last year in my Year 6 Science class, I learnt that plants are very individual and different plants require different level of moisture in growth, so I decided to build this ‘smart’ IoT watering system. It has been working so well in helping my mum to maintain her plants both indoor and outdoor. The image above is an underwatered lucky bamboo, and its leaves are becoming more and more yellow.

Supplies

0.jpg

Schematic and Flow Chart

Schematic_Final V3_2023-01-19 (3).png
Blank board.png

I have also included a flow chart to help explain the logistics behind this syntax. Below are the connections for the circuit.

Bme280:

VIN - 5V

GND - GND

SCK - GPIO18

SDO/MOSI - GPIO19

SDI/MISO - GPIO23

CS - GPIO5


Moisture Sensor:

AOUT - A0(ADS115)


Relay:

S - GPIO26

ADS1115

ezgif-5-a6072a356d.jpg

You might be wondering why I've included "ADS1115" into this device. This IC plays an important role into this system, especially for ESP32 boards. Because the capacitive soil sensor relies on analog communication to ESP32 and the built-in ADC converter has a low resolution, where adding an external ADC converter would be vital. This device requires high resolution analog signals, as the soil moisture is being predicted from these analog readings. The above image demonstrates this principle. (Image Credit to W4krl.com)

Unlike ESP32's notorious 12bit ADC, the ADS1115, also known as 16Bit ADC, can convert analog to digital using the linear ratio (voltage vs ADC). The ADS already has a built-in 10K resistor pull-down to ground. So the address for ADS I2C is (0x48) by default. We do not need any wiring towards the ADDR pin.

Link the Device to Blynk

Screenshot 2023-01-20 203453.png
Untitled.png
Datastreams.png
webdashboard.png
  1. Sign up or log in into your Blynk Account
  2. Click "New Template" and choose hardware as "ESP32" and connection as "WiFi"
  3. Click on "New Device", and choose "From Template"
  4. Choose the template which you just created, and to finish click "Done"
  5. When you have finished creating the device, click on "Device info" and you would be able to see the device's template ID, device name, and AuthToken
  6. After, click "Edit Dashboard" to create the datastreams for this device
  7. Double click to insert gauges into the dashboard
  8. I have shown how I have configured the datastreams/web dashboard in the above image, follow the datastreams and configure them for your Datastreams
  9. Repeat these steps for the other datastreams, and the web dashboard

Upload the Codes to ESP32

Code.png

Change the highlighted credentials with your own information.

The code can be found here.

Note:

For the "Air Value" and "Water Value", please calibrate these values, as they differ from every moisture sensor.

Calibrate your Capacitve Soil Sensor with the following link:

Sensor Callibration For ADS1115

Bringing It All Together

IMG_20230121_183832.jpg
IMG_20230121_183554.jpg
IMG_20230121_183538.jpg
IMG_20230121_183847.jpg
IMG_20230121_183903.jpg
IMG_20230121_183758.jpg
  1. Gather all the required materials for this project
  2. Before attaching them in-place, check and design how they would fit into the container
  3. Glue the ESP32 core board at the bottom of the container
  4. Add all the sensors to ESP32, and attach the wiring to it
  5. For me, I used double-sided sticky tape to glue the sensors into the container
  6. Personally, my easiest way of drilling holes into the container is using a soldering iron, otherwise other ways would possibly crack the container
  7. Attach the hoses to the solenoid valve, and you can fit any sprinkler onto the other side of the hose! This is the sprinkler I've chosen for my device
  8. I've attached an extension cord for the capacitive soil sensor, so the sensor could reach further to the soil
  9. After your done!!!

The First Test

0.jpg
0.jpg
0.jpg
0.jpg
0.jpg
0.jpg

I have used silicon to waterproof and fill the gaps of the container, so it is weather-tolerant. So far, everything's working correctly, and I've connected the water tap to the solenoid valve, and another hose to the sprinkler, which would automate watering my plants. The capacitive soil sensor would easily corrode from the water, or rain, and I've used pcb varnish to waterproof the pcb.

Disclaimer: I've tried nail polish to waterproof them, but the chemicals in the nail polish ended up making the capacitive soil sensor not functional, outputting NO data. Do Not Use Nail Polish to waterproof pcb. I will highly recommend pcb varnish, as they are made just for this purpose.

This device can also be used in indoors, by using a "Indoor Tap adapter" which can be found here. So this device is pretty much compatible with indoors and outdoors.

Thank You for reading, and feel free to leave your opinion in the comments!