Checkout the schema diagram, Code and full list of Parts in the related article: github.com/SmartThingsDIY/arduino-uno-aws-irrigation-system Also, I'm moving all my electronics related video to their own channel for more focus, join me here and say Hi ru-vid.com/show-UCPLAcnOvckpVvFvzqWvUakw
Thank you for this video, the instructions and code are great and it worked perfectly once set up properly! One thing to note for others trying this is the Arduino itself also needs a power supply (not indicated in the wiring diagram). I thought I had set it up wrong when it wasn't working until I realised that was the issue. Trying it out on a couple of plants before expanding the system. Have you tried setting this up outdoors or only indoors? Definitely want to try the WiFi version once I'm comfortable with this set up. To power the pumps I'm using a power bank. To connect it, I took an old USB phone charging cable, cut the wires and wired positive and negative as indicated on the wiring diagram (using cable connectors where needed, not tape). You then connect the USB cable to the power bank. works like a charm and there's likely enough juice to last a good long while. If others looking to do this are complete newbies to programming for Arduino (like I was before starting this), I recommend watching Paul McWhorter's tutorials (search Arduino Tutorial on youtube). You only need to go up to tutorial 15 I think to understand enough of the basics to set this up.
I'm humbled by your comment. I've indeed forgotten about including the power supply for the Arduino and I'm glad you caught it. I'll pin your comment for visibility for others.
@@keanutype0896 The relay is there to open/close a water pump's circuit: When readings find that a plan soil is dry, the corresponding water pump needs to pump water, and that's achieved through the relay. It's like a switch you control with the Arduino code
@@WinTheCloud hello im same as him. but i dont know about the pump. do i really need to use Relay? is there other alternative? sorry i havent done any water pump related project and project related to relay as well
Great Video. I need some help. In every video people have been using the usb cable to power up the arduino. I have a 5V-1 amp adapter. When i am using the 5v adapter, the relay's led is working but solenoid valve doesn't close or open. but when i use usb cable, it works. so i used 12 v 500mA adapter to power arduino and it works again. I have a question, why it is;t working with 5v adapter?
I'm currently trying to wire this up myself. I'm a complete beginner and I'm stuck. I've got a 8-Channel Relay and am not able to figure out where to connect the COM connection point. Help would be very appreciated.
Be aware of the end delay... it may set your relay ON and 5 seconds later will read the sensor again... it may be to much water, if you have a small pot. And another thing. Find a way to power your sensors ONLY when you read sensorValue. Keeping your sensor powered all the time will destroy your sensor through electrolysis. Try some transistors, 2n2222 or alike, to power the probes when you're reading the value. Then you can check once a hour.
Thanks for the advise. I was thinking of connecting the sensor to a digital output pin rather than a power pin, then only send power to that pin when I want to read sensor data
@@WinTheCloud actually the advice is for those sensors with 2 elements. This kind of sensor it is better, still you can protect it's sides with some nail polish and electronics with some shrink tube. There's a video about this. I think Analog is better. I didn't got the kit for it yet, but I start on the code. I will put it up on github. It will also have qled display 128/64 ssd1306.
@@WinTheCloud I have some questions about your approach and data types you use. String eats up a lot of memory, char array fits better, in my opinion. And I couldn't figure it out why {"sensor1Value"=380.00,"sensor2Value"=400.00,...} and not simply {"380.00","400.00",...} You already know the first entry is sensor1Value and then follows sensor2Value and 3 and 4 is the latest one. Serial communication it is very Ssslllooowww, so you do better with shorter commands. 😉 Drop me a line so we can improve this code.
Having the system continually pump until saturation level is reached isn't a good way of doing it. By the time the sensor reads an acceptable water level, the other side of the plant pot could be water logged. A better way would be to take a self adjusting system: Let's say we want a moisture level of 20% and we'll start with a water pump time period of 4 seconds. The variable for pump seconds is X. 1. Wait an hour, and then take a reading. 2. If it's too dry, pump water for X seconds, go to step 3. If it's too wet, go back to step 1. 3. After a 10 minute wait time, another check is performed. Goto step 4. 4. (a) If the water level has not increased, increase pump time by 1 seconds and go back to step 2. (b) If water level is too high, decrease pump time by 1 seconds and go back to step 1. (c) If water level increased, but is still not sufficient, go back to step 3. Something like this would start off with rough controls. But after a few hours it would settle into a more efficient pattern.
I love your idea! Would you be open to pushing a PR explaining your solution and suggesting the code changes? I would love to have you as a contributor to the project: github.com/SmartThingsDIY/arduino-uno-aws-irrigation-system
@@WinTheCloud I'm a little rusty these days. I have not done much programming in a while - I'm still using VB6 :D I have no knowledge of more modern programming languages. However, I'd be happy to help in any way that I can. I'll give it a look. Thanks for the response.
I like the layout, If I can figure out how to add an LCD display to show what the four plants are doing...Dry, Wet or pump on or off. I am curious that as you water the pot and the probe gets a flow of water then turns off the pump are you really watering the plant enough? or is it over time that the soild will be come moist enough that the plant won't need water for longer periods of time? Just asking as to me it seems the plants not getting enough water. Again I like your layout and thanks for sharing it, greatly appreciate it.
It's true this device helps automate the process but it's a home DIY not tested nor calibrated for different temperatures, plants, seasons... So I add some water manually every now and then when I feel like it became a bit dry, just as a precaution...
Thank you for this video, the wiring and coding are clear but may i know what i should do with the coding if i'm planning to use only 1 sensor? Is there a difference in number of relay and what i should change in the coding? Thank you very much.
Nice video, one question about the code you wrote for this program. Are there any concerns with having all 4 pumps turn on at the same time? Thinking of a scenario where all plants need to get watered if power would be an issue or it would cause strain on the system. Thank you
hey man i like your works its very good,but i had a question did you use 2 AA 1.2v battry to power up the motors? and did you use 9v battery to powerup your aurduino?
I mean you can definitely use a LiPo rechargeable battery. This one for example, but it has only 600 mAh : www.amazon.ca/gp/product/B0795F139D I'm sure you can find higher capacity ones
You can use an external battery. Like those used for charging phones, in combination with a small sollar panel and u will never need to recharge. Fully automated sysetm
Ok what is the difference between AO and DO and which one is prefered. either analog or digital if that's what it meant. I'm still new to electrical robotics.
You got it. The Arduino board has Analogs pins and Digital pins. You will use digital pin modes when dealing with signals that are either "on" or "off", such as an LED, a switch. Analog inputs are used when you want to read the voltage potential of something. This is typically used to read analog sensors.
Thanks Somya! You can find a full list of parts + Code + Diagrams in the attached article github.com/SmartThingsDIY/arduino-uno-aws-irrigation-system (I always include the article in such videos, just make sure to check the description)
Hi there! Nice project. I have a question: Why not ok to just send the 5 volt directly from the Arduino towards the pump? Is the relais really necessary in this case? Cheers!
You can, but the relay give you more control. Think of it as a switch that turns on/off the pump throughout whatever logic you've put in your Arduino code
Bro if I wanted to get the moisture values as a percentage and I wanted that data on my laptop what do I do 🤔 because I want to get the moisture of the soil throughout the day as raw data to analyse
Yeah dude happy to help. For sensor 1 for example, the moisture level is read from Pin1 and stored in the variable "sensor1Value" github.com/MecaHumArduino/arduino-uno-aws-irrigation-system/blob/master/src/main.cpp#L134 For storing the value in the computer, I'd suggest adding an ESP8266 to the setup, which will allow your setup to connect to WiFi, then use the code from my other repo on it: github.com/MecaHumArduino/esp8266-01-aws-mqtt this code connects to WiFi and then sends whatever you want to an MQTT topic of your choice, which can be run on your computer
You're welcome, my friend :) I published sort of an update and used Amazon Alexa this time, make sure to give it a watch as well ;) ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-5X6wq9XWl10.html
This is super late, but when you connect the water pump to the relay, do you need to attach the wires from the water pump to the metal tip of the jumper wire, or do you have to strip the jumper wire?
I have another question yet again bro 😅 so basically I followed this exact guide same code and equipment, but it not working how it suppose to, the pump not coming on when I remove the sensor from the soil and when the pump do come on, it does not stop pumping water. I have the same code as you, Arduino works fine, relay works, the pumps all work( I even hooked up pump directly to the power source and all 4 pumps came on ) . The only difference is that you use a 9V to power your Arduino but I use a usb cable connected to my laptop. Do you think that causing the problem ?
Hum, my guess is the sensors need to be calibrated to your own numbers. You see the number "450" here github.com/MecaHumArduino/arduino-uno-aws-irrigation-system/blob/master/src/main.cpp#L137 ? This works for me but maybe you're using a newer version of the sensor that is calibrated differently - So put the sensor in water, note the number it output, pull it out of water and note that number again. Then use both of the number to detect when the sensor is wet and when it's dry
@@WinTheCloud the average highest value for when the sensor was dry was 581, the lowest average was 302 for wet. (I use average values because the 4 sensors gave slightly different readings) . So 450 is about 53 percent soil water moisture content which is perfect. Funny thing is that it works fine like how you demonstrated without the pumps connected. I would hear the relay turn on when sensor out of the soil, then I put it back in and relay turns off. But then I hook up the pumps to relay, it doesn't work like it supposed to( some pumps won't turn on and the ones that do would just keep pumping continuously). Even though the power supply could run all pumps at the same time. This thing giving me a headache.
That's definitely weird. I know it won't be easy but at this point, I'd go a few steps back: try to make it work with one sensor, one relay and one pump, this way you can try with different pumps, maybe the issue is a couple of pumps themselves... Let me know how it goes
Hi, I have 0 skills in coding and using Arduino. But I want to create this DIY project for my home plants so they'll be ok when I go away on vacation. My question is: I notice that at the wiring diagram, there's no breadboard, but when you test the thing, there's a breadboard connected there. Why didn't you put it on the diagram? Also, do you have a complete diagram with everything I'll need to get this project going? Thank you in advance!
Hi, great question. The breadboard is there to make things easier for when building your prototype, it offers a way to connect your components in a solderless way, but once the final schema is established, most tinkerers will chose to solder the components together, putting the breadboard aside to be used for another project. But sometimes I chose to keep the breadboard like in this little project instagram.com/p/CIrR6RBBCa-/
@@WinTheCloud Hei, thanks for the reply! So that means that I can follow your wiring diagram and will be good to go! That's great! I will proceed in buying the required components for this. Thank you very much!
Hi ! I want to do this for our research as a way to navigate plant's growth. I checked the codes and based on it, it has a delay of 500. Now im only a beginner in terms of coding and i would like to ask if there is a way to code the system to check the moisture of the soil only once an hour (other than extending the number for delay) so the moisture sensor will collect data only after 1hr has passed to maximize the efficiency of it to have a longer lifespan because ive seen some videos about moisture sensors being unusable due to being overused? I really appreciate if you took time to read this and reply to my message thank you. also really great video!!
First of all, old moisture sensors get worn easily, but the model I've included is the new version that provide better resistance to moisture. I have one on my basement for example running for nearly a year without an issue. Now to extend the reading period, rather than running a loop, you can put the whole board to sleep and wake it up after a set interval, do the reading, send it over WiFi then put it back to sleep, which has the benefit of tremendously extending the battery life. I've built that exact same thing in this video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-tnhnZ-Xe39E.html to which you can find all code and explanation here: github.com/SmartThingsDIY/esp32-talking-plant
@@WinTheCloud thanks for the clarification and also i really like the suggestion of yours but it needs a wifi and the thing is, we are trying to keep it an offline system as much as possible so that it can be used by people with no internet. thank you so much again for responding, i understand the things you meant and i appreciate it also. p.s ( the system is for our research so adding a wifi in the system would lead to adding more variables for our research and we only have limited time, so we built it as offline.)
I don't have this project running anymore, unfortunately, but this is the switch I used for power: amzn.to/3zAtoFk and this is the wiring diagram github.com/SmartThingsDIY/arduino-uno-aws-irrigation-system hope this helps
You got it. Arduino uses C++ as the it's main language. BTW checkout the Github article link in the description that contains a line by line code explanation