WiFi Plant Watering ESP8266

53K45338

Intro: WiFi Plant Watering ESP8266

First off, please vote for me! Anyways......

So I was always forgetting to water my plants, and as a result they would get dry and sometimes even die. So I though it would be cool to be able to water my plants with my phone. Its connected to the internet via the ESP-01 module and can be used to water your plants or animals once a day for the duration of time you choose. The User Interface also allows you to water manually with the push of a button, and from anywhere in the world.

Items needed are as follows:

1. Blynk App (Android and iOS)

2. Vinyl Tubing - 10 feet 5/16 ID - 7/16 OD - $5.50

3. Brass Hose Fitting, Tee, 5/16" x 5/16" x 5/16" Barb - $6.71 (3D print your own or buy a plastic one)

4. DC 3.5V -9V 3W USB Submersible Water Pump - $3.79

5. LM2596 Digital Control Voltage Regulator DC Buck Converter Power Supply - $8.99 (I used this, but get the MP1584EN Adjustable Buck Converter)

6. ESP8266 ESP-01 Serial Wifi Wireless Transceiver Module - $5.92 (These can be found cheaper on ebay)

7. 1 Channel Relay Module - $4.25 (Shop around you can find these cheaper)

8. Any DC wall adapter 5VDC - FREE

9. Hammond 1591ESBK ABS Project Box Black (7"x4"x2" LxWxH) - $7.81

10. FT232RL 3.3V 5.5V FTDI USB to TTL Serial Adapter Module - $5.00

11. Breadboard(Prototyping Board)

12. Dupont Cable Assortment (M-M, M-F, F-F)

13. M3 Nylon Hex Spacers Screw Nut Plastic Stand-off Assortment

Total about $50 (The challenge is to do it cheaper ;)

STEP 1: Setting Up the ESP-01 for Programming

Programming an ESP-01 is like programming an Arduino, the benefits are its smaller and has WiFi, but the downside is it doesn't have a USB port to program it through. So to fix this we need a serial to USB adapter to program the ESP-01 using 3.3V, if you get the adapter shown above you can select 3.3V or 5V via the jumper. Now wire the ESP-01 to the adapter as shown in the image above. Since you have to make 2 connections to Power and 2 connections to Ground consider using a bread board (proto board), it makes this easier. Remember its important to make the connections to the ESP-01 temporary, as you will be using it later. Once your connections are established its time to move onto setting up the software.

STEP 2: Installation and Setup of Arduino IDE

Download and install Arduino IDE software. Once installed, run the software and on the top menu bar click File - Preferences and you'll see a field that says Additional Boards Manager URLS:. Copy and paste this into that field:

http://arduino.esp8266.com/stable/package_esp8266com_index.json

and Click OK


STEP 3: ...Setup Continued

On the top menu bar click Tools - Board: - Boards Manager and scroll down to verify that the ESP8266 by ESP8266 Community is INSTALLED. If so, click close and once again go to Tools - Board: - Boards Manager, and you'll now see a bunch of ESP8266 type boards that you can program using the Arduino IDE.

STEP 4: Add Blynk Library to Arduino IDE

Download the latest Blynk Release Library from GitHub to somewhere familiar like your desktop (it might download to your Downloads Folder). Right click on the file you just downloaded and select Extract All, (if Extract All is not available to you, download and use Winzip trial to Extract). Open the newly created folder and copy the contents to your Documents\Arduino\libraries folder. Its should look like the above pictures.

STEP 5: Take a Break and Get the Blynk App

So at this point you should have the ESP-01 wired to the adapter and the software setup and running. Good Job!

Get off your chair, stretch your legs, walk around and get yourself a beverage...you deserve it.

Next we'll get the Blynk App on your phone and get the token your going to need for the sketch. Then we'll choose our hardware settings in the IDE,and modify then upload the sketch to the ESP-01. You'll soon have an internet connected automated watering system for your favorite indoor plants!

STEP 6: Configure IDE Hardware Setting

Connect your USB to Serial adapter to your computer, the ESP-01 should be connected to it.

Download the attached sketch ".ino" file, then double click it and it should load into the Arduino IDE.

In the IDE click Tools - Boards and choose Generic ESP8266 Module.

Again click Tools - Port and choose the COM port of ESP-01 you just plugged into your computer. (Note you can unplug and re-plug the adapter to figure out which COM port it is)

Once again click Tools - Upload Speed and choose either 115200 or 9600. I'm using 115200 but if your code doesn't upload try 9600.

You have to change a few things in the sketch code, the "Auth Token", the "ssid" and the "password"

The next will show you where to get your "AUTH CODE"

STEP 7: Download the Blynk Android / IOS App

Get the Blynk App and your Auth Token

To start:

1. Download Blynk App: http://j.mp/blynk_Android or http://j.mp/blynk_iOS

2. Touch the QR icon and point the camera to the QR code above

3. Enjoy my app!

After the scan, a new Project will be created, all the widgets, settings and layout will be cloned. You would need enough Energy Balance to clone this Project.

Once you see the project on your phone, click the nut icon on the top right hand side of your screen. And that's where you'll find your "Auth Token".

STEP 8: Edit the Sketch Code

There are only 3 things you have to change for this to work for you at home.

1. The "Auth Token" (Covered in the previous step)

2. "ssid" (The name of your WiFi at home)

3. "Password" (The actual password to your WiFi at home)

And thats it! Your ready to Upload the Project!

Once the upload is complete disconnect everything from the ESP-01 and start assembling!

STEP 9: Drill/Melt Some Holes

Drill 2 holes, one on each end of the enclosure.Make them large enough to accommodate the ac/dc power adapter wire coming in and the wire of the water pump going out. This particular enclosure needs to have the lid shaped for the wires as well.

Lastly drill or melt some holes in the vinyl tubing, mine are about an inch apart. I believe 3/16' drill bit was used in my case.

STEP 10: Assemble Your Electronics

I used mostly dupont jumper wires that I cut to make PIN and Terminal connections easier. My 5V 550mA power plug came from an old Motorola cell phone charger that was not being used anymore. I cut the mini USB tip off of the charger and connected the negative and positive wires to the input of the Voltage Regulator and to the VCC and Ground pins of the Relay module. I also used the same positive wire and connected it to the comm terminal in the middle of the 3. The power wire from the water pump goes to the NO terminal of the relay, the bottom terminal in reference to the above picture. And the negative wire from the pump goes to the same ground as the relay and regulator.

The output of the regulator goes solely to the ESP-01. Positive goes to VCC and CH_PD and the negative goes to Ground.

Lastly connect GPIO2 to the Input Pin of the relay usualy label IN1.

I mounted everything on plastic standoffs, then hot glued the standoffs to the enclosure.

STEP 11: Assemble the Tubing

Use the Barbed Tee that you bought or 3D Printed and connect all the tubing together as shown above. Connect the tubing to the water pump and fill your vase with water!

I usually have GPIO2 set to water once a day, you can also switch GPIO2 from a timer widget to a button widget and water manually with your phone.

STEP 12: This Is What You Get!

Thank you following along, if you have any questions, please comment below.

35 Comments

Great project. Thank you. I made it but the pump out is on constantly. The output of the regulator goes solely to the ESP-01. "Positive goes to VCC and CH_PD and the negative goes to Ground." Does this mean CH_PD goes to VCC or ground? As written it could mean either way. I can see the esp on my router attached devices but the pump never cuts off. Appreciate any suggestions.

Thanks

I did a non-wifi watering electronic setup and I thing i learned is that the water reservoir needs to be lower than the plant or you get siphon effect. To fix this you would need a valve. Also need to account for power outage if you are using a timer setup - I did this by writing to flash of a HC12S.

A valve would not solve the siphon effect if reservoir higher than output, since the water flows in the same direction. I still haven't received the submersible pump which looks like TaNdie's : it may not sensitive to the siphon effect, and furthermore, I think some pressure is needed to flow through the tiny holes.

And I do not understand your concern about power outage : no power -> no ESP, no pump and probably no wifi either. I think when power comes back, the link will be re-established and watering will be available again.

I think the T is a luxury (allows to form a ring around the plant) : closing the end of the tube would do the job.

No siphon effect with this project, this pump has plenty of power to push water up, down, left or right. And power outages are not common, I think our plants would survive missing 1 watering.

Nice job, but a word of

CAUTION: The FT232RL module only provides 50mA of 3.3V current, while the ESP-01 may use up to 170mA when transmitting. While it is apparently working okay, you may have intermittent operation or early failure. This may be why you had occasional errors.

Super Sexy Instructable ! VOTED lol !

Love this, well done, ingenuity at its best !!

Quick Question about the Blynk App in your instructions;

"You would need enough Energy Balance to clone this Project."

is this 'Energy Balence' on the Blynk app like needing to put credit card/debit card/bank transfer funds into it in order to obtain this energy balence ?

May be a silly question lol

thx loads in advance and well done once again :))

Hopefully Blynk is still doing this, but they start you off with several thousand "Energy Points" for free. The amount they give should be enough to clone this project. If you ever delete the project you get the points back. But otherwise, if you need more than that, then you will be looking at purchasing more, and if you needed to do that, it's quite cheap....Happy tinkering and let me know if you have anymore questions...

Oh 1 small problem, just tried downloading the files, the last one seems to be broken, it keeps saying "Failed - No File" for the mp4 file at the end of your instructable, please help fix the link when you can, no rush and a great many thx in advance again :))

howdy and thanks so much for the answer - YOU ARE AWESOME MAN !! hehe really beautifully made instructable and device, really impressed & exactly what i need !

Maybe as a finishing touch, if you could email me a schematic or a sort of block-diagram of how to connect everything up, itll make it a bit easier for my dyslexic head lol

itll take me a few days otherwise but no big deal, this is an awesome project - cannot thank you ENOUGH !!!! :))

Hi,,

When I compile my project give the following error:

error: espcomm_upload_mem failed

What's it?

Thanks

I've had the same error in the past. Make sure you have the correct "Port " chosen in the IDE, and double check all your connections with the esp-01 and FTDI.

hi sir do you have the whole set to sell me

hi sir can I have the cost for the product. I am staying in Singapore

I'd probably put the tubing in the bottom of the pot so it's watered from the underside. This promotes root growth and avoids moist top soil which can become a problem (mold/pests). Besides that this seems like a really nice project with real world benefits. Congrats! :)

Thanks Eirinn, I think if you have good soil composition that promotes drainage you'll be fine. This project waters for 15 seconds, and at the end of that I have water beginning to come out the bottom. I've been watering like this for months, no mold, no pests and the biggest thriving indoor plant I've ever had.

Great Instructable, from my understanding, the timer is linked to a virtual pin and the push button linked to the physical gpio pin.

Would you mind to elaborate the coding for the simple timer on V5, or how the virtual pin knows which digital pin to use?

The code can definitely be improved, but in this most basic setup, the physical gpio pin is tied to the timer widget. But, if you want to, you can switch it to the button by simply removing it from the timer then placing it on the button in the app. You can t have the same gpio pin for 2 widgets.

V5 can be setup to show you the uptime of your device. Just in case you lose power you'll know how long its been running. You can use Value widget for this....

I am not getting esp8266 boards on my 1.6.7 version.
can you help me

Can you list where you bought all of your parts from?

More Comments