HELLO THERE!!!
How are you, guys? I hope everyone is fine and in good condition always. Alright, this week, I wanted to share with you guys on a system that I made over the weekend. It is called the Automatic Plant Watering System. Without wasting more time, lets see the hardware and software needed in making this system.
HARDWARE:
1. Arduino UNO
SOFTWARE:
1. Arduino UNO
Ok now that all the items had been listed lets see the overall assembly of the circuit. I am sorry as my assembly of the circuit is a bit messy:
I'll divide the system into two circuits:
1. The soil moisture part
The soil moisture sensor usually comes with 4 pins (VCC,GND,A0(analog pin),D0(digital pin)). In this system I had used the VCC,GND, and A0 pins:
From soil moisture to Arduino:
VCC-->5V
GND-->GND
A0-->A0
2.Relay + Water pump connection
The relay comes with three pins( as shown in the relay image at the beginning of this post). The connection from relay to Arduino is as shown;
IN(in some relays it is names as S)-->Digital pin 8
VCC-->5V
GND-->GND
From the water pump to relay is shown as image below:
Now that the assembly of the circuit has been done. Let's view the code that is used to run the circuit:
int moist = A0;//moisture sensor pin
int relay = 8;//relay pin
void setup() {
// put your setup code here, to run once:
Serial.begin(9600); //serial communication begins at 9600bps
pinMode(relay, OUTPUT);//relay as OUTPUT
}
void loop() {
// put your main code here, to run repeatedly:
if (analogRead(0) >= 800)// if soil moisture reads value more than 800(dry).changeable
{
Serial.println(analogRead(0));//print the reading
digitalWrite(relay,LOW);//turn on the water pump
}
if (analogRead(0) < 800)//else
{
Serial.println(analogRead(0));//print the reading
digitalWrite(relay,HIGH);//turn off the water pump
Alright, that's the code, folks!! Upload the code and let the system run!! You can tinker around by changing the NC to NO connection from water pump to relay ( I used NC,btw) or change the soil moisture sensor condition value or even add some LED's or LCD display to display reading!! Many things can be done to tinker around this system. Before I end this post, I'll show the demonstration video I made for this system.
That's all from me guys. See you next week, till then HAPPY TINKERING!!!
How are you, guys? I hope everyone is fine and in good condition always. Alright, this week, I wanted to share with you guys on a system that I made over the weekend. It is called the Automatic Plant Watering System. Without wasting more time, lets see the hardware and software needed in making this system.
HARDWARE:
1. Arduino UNO
2.DC Water pump.(My water pump is exactly as below)
3.A relay(single channel)
4. A soil moisture sensor
SOFTWARE:
1. Arduino UNO
Ok now that all the items had been listed lets see the overall assembly of the circuit. I am sorry as my assembly of the circuit is a bit messy:
Don't worry... I will do my best to explain the circuit.. |
I'll divide the system into two circuits:
1. The soil moisture part
The soil moisture sensor usually comes with 4 pins (VCC,GND,A0(analog pin),D0(digital pin)). In this system I had used the VCC,GND, and A0 pins:
From soil moisture to Arduino:
VCC-->5V
GND-->GND
A0-->A0
The connection of the soil moisture sensor to Arduino |
2.Relay + Water pump connection
The relay comes with three pins( as shown in the relay image at the beginning of this post). The connection from relay to Arduino is as shown;
IN(in some relays it is names as S)-->Digital pin 8
VCC-->5V
GND-->GND
From the water pump to relay is shown as image below:
The connection of water pump to relay |
Now that the assembly of the circuit has been done. Let's view the code that is used to run the circuit:
int moist = A0;//moisture sensor pin
int relay = 8;//relay pin
void setup() {
// put your setup code here, to run once:
Serial.begin(9600); //serial communication begins at 9600bps
pinMode(relay, OUTPUT);//relay as OUTPUT
}
void loop() {
// put your main code here, to run repeatedly:
if (analogRead(0) >= 800)// if soil moisture reads value more than 800(dry).changeable
{
Serial.println(analogRead(0));//print the reading
digitalWrite(relay,LOW);//turn on the water pump
}
if (analogRead(0) < 800)//else
{
Serial.println(analogRead(0));//print the reading
digitalWrite(relay,HIGH);//turn off the water pump
Alright, that's the code, folks!! Upload the code and let the system run!! You can tinker around by changing the NC to NO connection from water pump to relay ( I used NC,btw) or change the soil moisture sensor condition value or even add some LED's or LCD display to display reading!! Many things can be done to tinker around this system. Before I end this post, I'll show the demonstration video I made for this system.
That's all from me guys. See you next week, till then HAPPY TINKERING!!!
This comment has been removed by the author.
ReplyDeleteHello, I'm doing this project now (with the same components as your project) may I ask, is the reading supposed to be that high (approx 800)? Because when I coded mine the reading states around 200-360 only (Highest I ever gotten was 369) and when I put it in the water to test it out, the reading is almost similar as when it wasn't in the water... Please help me! :'( (This project is due in 3 more weeks and I have a lot more to do)
ReplyDeleteBtw, if it is not too much to ask, can you please make a video of you assembling this project from scratch? It'll be really helpful for me!
Sorry for troubling you and thank you very much! :)
Hi natasha, sorry for the late reply(had some prob with gmail). About the readings for the soil moisture sensor, there should be major difference when you put it in and out of water. You might want to test with a different soil moisture sensor just in case. About making the video, i am not sure if i can make it as i am bit busy with some work.😅😅
DeleteThank you for your reply, my readings are now similar to yours, however I now have some problems with my water pump... It pumps water but it cannot be controlled like yours... Do you think there's something wrong with my relay or something else? But my relay's LED are both working fine
ReplyDelete*which means that my relay is working fine right? So why can't I control my water pump?
DeleteOk, there are few things you can try.
Delete1. Check if your relay is working. Upload a simple relay sketch and connect your led to relay to see if your relay is working as intended.
2. Check your water pump connection to arduino and relay. You made some mistake in the connection
3. If you are using more than one water pump in the same arduino board, i advise you not to do so as 2 water pumps will cause the circuit to be over burdened although connected to relay
4. Maybe the switching mechanism of the relay is a bit slow causing your water pump to respond slow. Try give it some time and see if the pump responds or not
Hey! I would just like to thank you for helping me with my problems. My project has been submitted already but I was still unable to solve my water pump problem so I decided to pull it out of my project altogether. Thank you again for your input and have a great day!
DeleteWater Pump Installation involves the process of fitting and configuring a water pump system to extract water from a source, such as a well, river, or reservoir, and deliver it to its intended destination. This process typically includes selecting an appropriate pump type based on factors like water source depth, required flow rate, and intended usage.
ReplyDelete