|
Soldering iron |
|
|
Soldering Iron Wire Welding Lead Roll |
DIY Automatic Plant Watering System with 2 in 1 board
When you hear the term ‘smart garden’, one of the things that comes to your mind is a system that measures soil moisture and irrigates your plants automatically. With this type of system, you can water your plants only when needed and avoid over-watering or under-watering.
This project shows how to make an Arduino based automatic plant watering system. In fact, the idea of making an automatic plant watering system came up with the thought that my plants would be waterless before I went on summer vacation. The soil moisture sensor, water pump motor and some pipe in my workshop came to mind and I wanted to make project.
Step 1: How It Works?
Take a look at how it works, I think it's been a useful project for your plants or at least give you some ideas. The project is based on Arduino microcontroller. Only, as can be seen in the video, I used a microcontroller prototype that I designed myself. Of course, you can use all other Arduino models in this project. So why did I need a special board? I've explained that in the next step.
Step 2: The Working Principle of the Automatic Plant Watering System
First, let's look at the working principle to understand the requirements of the automatic plant watering system. The plant needs water as the soil dries, and we need to somehow get the water together with the plant soil. If the plant soil is sufficiently watered, we should stop watering. So what hardware or components do we need to do this automatically?
A soil moisture sensor probe should measure the soil moisture, the data read by the probe is sent to a microcontroller via the soil moisture sensor. The microcontroller processes the read data according to the specified commands (like threshold value) and communicates with a motor driver to start the water pump motor. However, in some projects a relay can be used to trigger the motor. The motor driver runs the water pump motor and water flow is through the pipes connected to the water pump motor. When the soil moisture sensor probe reaches the specified threshold, the system returns to the beginning and the water flow is stopped. This is executed as a loop by the microcontroller.
Then the list of components and hardware that we will mainly need is as follows:
- Your Plants
- Soil Moisture Sensor
- Microcontroller
- Motor Driver
- Water Pump Motor
- Pipe
- Some Jumper Wires for Connections
- Water Bucket
- Power Supply
Step 3: Which Microcontroller and Motor Driver?
As I mentioned before, you can use any model of Arduino microcontroller (such as UNO, Nano, Mega). As long as the connections are made correctly, the shared source code will run smoothly.
However, if I was going to use an Arduino microcontroller, I would also need a motor driver or maybe even a relay. If we used a model like an Arduino UNO in the project, we would have to create a circuit using the following motor drivers together:
L293D Motor Driver Shield (It makes it difficult to connect extra sensors)
L293D Motor Driver IC Chip (It needs a breadboard and needs complex wiring)
L298N Motor Driver Module (It needs extra wiring)
If you are going to use an Arduino model, the circuit can be a bit complicated. To avoid this complexity, I created a prototype and got PCB printing service from PCBWay. On my design board I used an ATmega328P, an L293D motor driver, a CH341 chip to program it easily via USB.
In addition, you can use this board in your different projects another from the plant watering system. For example, this board allows you to control Servo motor, 2 DC motors and many sensors. I used this board again for the 5 in 1 robot project and I created a robot tank that works in 5 different modes with 1 board. If you want to browse, the project link is below:
If you do not want to deal with complex circuits, you can easily get this PCB I designed from the Gerber link below. You can get high quality and low budget PCB service from PCBWay.
Step 4: 2 in 1 Microcontroller (built-in Motor Driver)
While designing the PCB prototype, I took care to choose components that are easy to find and solderable. On my design board I used an ATmega328P, an L293D motor driver, a CH341 chip to program it easily via USB. Only, the CH341 USB chip may seem a bit difficult to solder. But using a simple soldering iron, drop a small amount of solder on the pads on the PCB where the chip will be mounted, then align the chip legs correctly and heat the chip legs with solder. You can check out the project video for this process.
You can use the designator table I shared for the positions of the components on the PCB.
Step 5: Programming (Source Code)
Before proceeding to the circuit connections step, I recommend that you upload the source code. Because, if you connect your computer via USB to program the board while the water pump motor is connected to the circuit, your computer may be damaged.
Use any Arduino model or the 2 in 1 board I designed, the source code is compatible with both. When uploading the code, the BOARD selection for the 2-in-1 board should be Arduino UNO. If you are using any of the other Arduino models (such as UNO, Nano, Mega), you should choose the board according to the model you use. You will need to download and use the Arduino IDE editor to open and upload the code https://www.arduino.cc/en/software
Get the Source Code: https://create.arduino.cc/editor/mertarduinotech/84e7e83e-6232-47a1-9a47-2b7b31ad28d8/preview
Step 6: Connections - Soil Moisture Sensor
How Soil Moisture Sensor works? The working of the soil moisture sensor is pretty straightforward.
The fork-shaped probe with two exposed conductors, acts as a variable resistor (just like a potentiometer) whose resistance varies according to the water content in the soil.
The sensor includes a probe to make a measurement and a module to be able to connect with the Arduino.
The module produces an output voltage according to the resistance of the probe and convert to digital signal with LM393 High Precision Comparator. And is made available at the Digital Output (DO) pin.
The soil moisture sensor is easy to use and only has 4 pins to connect. 3 pins were used in this project.
- DO (Digital Output) pin gives Digital output of internal comparator circuit. You can connect it to any digital pin on an Arduino. Digital 6 pin is used in the project.
- VCC pin supplies power for the sensor. It is recommended to power the sensor with between 3.3V – 5V.
- GND is a ground connection.
Finally, the sensor connections are completed by making the power and ground connections between the module and the probe.
Step 7: Connections - Water Pump
I used the 2-in-1 board I designed myself in the project and it includes a built-in L293D motor driver. Therefore, motor connections become easier. But if you are going to use a different Arduino board and an external motor driver, the connections may be a bit more complicated. First of all, you should get basic information about "how to use" the motor driver you will use.
The built-in L293D motor output pins on the board are directly connected to the input voltage of the board and the power to the motor is controlled via the digital pins connected to the ATmega328P. The supply voltage of the board is separated for motor control and microcontroller. That is, the motor gets its power directly from the power supply and does not damage the board.
6V - 12V water pump usually has two pins:
- Negative (-) pin needs to be connected to OUTPUT1 pin of the L293D motor driver.
- Positive (+) pin (red) needs to be connected to OUTPUT2 pin of the L293D motor driver.
Power Supply Connections:
- 7.4V - 9V power supply positive (+) pin needs to be connected to VS pin of the L293D motor driver.
- 7.4V - 9V power supply negative (-) pin needs to be connected to GND pin of the L293D motor driver.
L293D motor driver and Arduino connections:
- L293D motor driver INPUT1 pin needs to be connected to Digital 2 pin of the Arduino.
- L293D motor driver INPUT2 pin needs to be connected to Digital 4 pin of the Arduino.
- L293D motor driver VSS pin needs to be connected to +5V pin of the Arduino.
Step 8: Sensing Soil Moisture
The module has a built-in potentiometer for sensitivity adjustment of the digital output (DO). You can set a threshold by using a potentiometer; So that when the moisture level exceeds the threshold value, the module will output LOW otherwise HIGH. This setup is very useful when you want to trigger an action when certain threshold is reached. For example, when the moisture level in the soil crosses a threshold, you can activate motor driver to start pumping water. Apart from this, the module has two LEDs. The Power LED will light up when the module is powered. The Status LED will light up when the digital output goes LOW.
By turning the knob of the potentiometer, you can set a threshold. So that when the moisture level exceeds the threshold value, the Status LED will light up and the module will output LOW.
Now to calibrate the sensor, insert the probe into the water when your plant is ready to be watered and adjust the pot clockwise so that the Status LED is ON and then adjust the pot back counterclockwise just until the LED goes OFF. That’s it your sensor is now calibrated and ready for use.
If you want to see this process in more detail, you can take a look at the shared project video.
Step 9: Let's Complete the Installation!
If everything is ready, let's build the automatic watering system. Of course, choose your plants for this. In this project, I decided to put 3 plants in the watering system at the same time.
- I used a storage box to protect the electronic components from water. I made holes for the pipe and wires with an old soldering tool.
- I used some rods to fix the water pipe. I fixed the rods in the plant soil and installed the water pipe at the appropriate height to act as a sprinkler. I used a few cable ties to fixed it.
- Fix the soil moisture sensor probe in the soil. I recommend placing it away from the water pipe so that the water does not touch the probe.
- Fix the other end of the water hose to a bucket of water and everything is ready to start the system!
Thank you for reading my project. If you have questions, please leave a comment, I will answer as soon as possible.
int sensorPin = 6;
int sensorData;
// Motor A connections
int in1 = 2;
int in2 = 4;
void setup() {
pinMode(sensorPin, INPUT);
// Set all the motor control pins to outputs
pinMode(in1, OUTPUT);
pinMode(in2, OUTPUT);
// Turn off motors - Initial state
digitalWrite(in1, LOW);
digitalWrite(in2, LOW);
}
void loop() {
sensorData = digitalRead(sensorPin);
if (sensorData == true){
waterPump();
}
else{
stopPump();
}
}
// This function lets you control spinning direction of motors
void waterPump() {
// Turn on motor A
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
}
void stopPump() {
// Turn on motor A
digitalWrite(in1, LOW);
digitalWrite(in2, LOW);
}
DIY Automatic Plant Watering System with 2 in 1 board
*PCBWay community is a sharing platform. We are not responsible for any design issues and parameter issues (board thickness, surface finish, etc.) you choose.
- Comments(0)
- Likes(3)
- Engineer Sep 10,2023
- Engineer Apr 18,2023
- PCBWay Support Team Aug 25,2021
- 1 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
-
9design
-
8usability
-
9creativity
-
8content
More by MERT KILIC
- Build a simple 3D printed CNC plotter machine Hi friends, do you remember this Mini CNC Plotter machine that uses hobby stepper motors and a few 3...
- Circuit Activity Board - Educational Electronics Circuit Activity Board – A Hands-On Project to Learn Basic ElectronicsIn this project, we're going t...
- Build a Simple 3D Wall Lighting Hi friends, this project shows how to make and control 3D hexagonal LED lighting panels. The project...
- Robot Sumo Board Robot-sumo, or pepe-sumo, is a sport in which two robots attempt to push each other out of a circle ...
- ESP32 Mecanum Wheels Robot and Bluetooth Gamepad Controller In this project we will see how to make an ESP32 Mecanum Wheels Robot which is capable of moving in ...
- DIY Motorized WiFi Roller Blind - ESP8266 & Blynk In this project we will see how to control a roller blind via a smartphone application. The reason w...
- Pet Feeder Controlled Via WiFi - ESP8266 How It Works?As you can see, a 3D design was used for the pet feeder. ESP8266-based Wemos D1 Mini bo...
- ESP8266 Two Wheel Robot (NodeMCU and Stepper Motor) Generally, robot cars are built on a chassis with 2 DC motor wheels and a bovine wheel. While surfin...
- 3D Printed Rotating Table Board with Arduino Nano and 28BYJ-48 Stepper Motor This project shows how to make a 3D printed Rotating Table using Arduino and a hobby stepper motor. ...
- Hand Gesture Controller for Robotic Hand Gesture Controller for RoboticThe hand gesture controller makes it possible to control applicat...
- How To Make DIY Remote Control Hoverboat at Home In this video, I showed you how to make your own hoverboat from materials available at home and chea...
- How to Make DIY Arduino Gesture Control Robot at Home Parts Required for Receiver (Tank):1) Robot Tank Chassis - https://bit.ly/3j8y2Q52) Arduino Nano V3 ...
- DIY Circuit Activty Board with Paperclips | MAKER | STEM You can be creative and design your own circuit and add different sensors (other LEDs...). The idea ...
- ATtiny85 Wearable Activity Tracking Watch How to make the wearable activity tracking watch? This is a wearable gadget designed to vibrate when...
- Face With Animatronic Eyes, Motion Detection and Voice Are you ready to create something both eerie and captivating? This project combines 3D printing, ser...
- Build a simple 3D Arduino Mini CNC Plotter Hi friends, we will see how to make a simple and awesome mini CNC plotter machine in this project. I...
- Build a simple 3D Sphere Drawing Robot (SphereBot - EggBot - EggDuino) Hi friends in this video we will see how to make a simple and awesome sphere drawing robot. Actually...
- Multiple Stepper Motor Controller Board I will show you how to turn such a complex Arduino multi-step motor circuit into a professional prot...
-
-
-
-
-
-
3D printed Enclosure Backplate for Riden RD60xx power supplies
154 1 1 -
-