Smart Plant Watering System
This Project goes into the details for using the new MS01 Soil Moisture sensor and TH10 Smart switch to construct a watering system for indoor or outdoor plants.
For this project you will need:
- Sonoff MS01 Soil Sensor - Available from itead.cc
- Sonoff AL560 Sensor Extension cable (optional) - Available from itead.cc
- Sonoff TH10 WiFi Smart switch - Available from itead.cc
- a power extension lead - LINK
- water pump - LINK
- PVC flexible piping that will fit the water pump - Some pipe is included with the water pump above but you may need more depending on your distance from the plant pot.
- A water container - This can be anything watertight that the pump will fit in.
- A plant
All Sonoff products including the MS01 Soil Moisture sensor and the TH10 smart switch can be purchased from itead.cc
The aim of this project is to build a watering system that will water the plant when it requires water without needing to check the plant each day.
This is especially useful if you are going away and want your plants to stay hydrated while you can't tend to them.
The way the final project will work is pretty straightforward. The MS01 Soil Moisture sensor and TH10 will control when the water pump turns on and off depending on how wet the soil is. The water pump will be placed into the water container and the PVC pipe will join the water pump to the plant.
What makes the TH10 and TH16 Smart Switches so versatile is they can be used in so many different ways depending on what sensor is attached to them. Currently they have a temperature probe which is waterproof, a temperature and humidity sensor and now the Soil Sensor.
Safety First!
As with all electrical projects, there is always an element of danger and the chance of electrocution. If you do not feel confident with working with electrical wiring then please consult an electrician. Always turn off the power from the fuse board and test before working on a circuit.
Build - Intelligent extension lead
The first task is to build an intelligent extension lead. To do this we need to combine the power extension lead and the TH10 smart switch together.
Plan where the best location along the extension lead for the TH10 to be wired. this should be close enough to the socket end of the lead that when the sensor is connected to the TH10 the lead is long enough to reach the plant. Remember that the AL560 extension cable can be used to extend the reach of the sensor if the included 0.5m cable is not long enough or you want to hide the switch further away from the plant pot.
Start off by cutting the power cable and you chosen spot. Them strip the cable back to expose the wire so that the TH10 can be wired in at this point. If you do not feel comfortable with wiring the switch please contact a local electrician how will be happy to help with this part. Once the wires are stripped you should have something like this.
Do the same with both the plug and socket sides of the wire.
Take the TH10 and unscrew the bottom plate as shown below.
Press down on each of the terminal point buttons and insert the corresponding wire into the terminals.
From the plug cable you should have a live, neutral and earth wire.
The live (Brown or Black) wire should be inserted in to the "Input L" terminal as marked on the case or the “L IN” as printed on the circuit board edge.
The Neutral (Blue)wire from the plug cable should be connected to either of the terminals labeled "N"
The Earth (green and yellow) wire from the plug cable should be connected to either terminal labeled "E".
now moving onto the wiring of the socket side.
The live (Brown or Black) cable show be connected to the terminal labeled "Output L" as marked on the case or the “L OUT” as printed on the circuit board edge.
The Neutral (Blue)wire from the socket cable should be connected to the free terminal labeled "N"
The Earth (green and yellow) wire from the socket cable should be connected to the free terminal labeled "E"
Once all the wires are connected to their correct terminals, double check the are all wired correctly and reattach the wire cover which will pinch the wire and hold them all in place.
Connect the MS01 Soil moisture sensor to the TH10 using the round socket on the side of the unit.
The Soil sensor can then be inserted into the soil of the plant as shown in the image below.
Adding the Device to the eWeLink App
Now it’s time to add the device to the app. This is the same process for all sonoff devices.
If you haven’t done so already, install the eWeLink app.
click here to install the Android app
or here for the IPhone app
Once installed, create an account or sign in.
At the bottom of the screen, click the blue plus button to start the pairing procedure. this can be seen in the screenshot below:
This will start the pairing process. the next screen will ask you to select a pairing mode. Select “compatible mode >” as this is the mode that always seems to work best. the Quick Pairing mode sometimes doesn’t find new devices.
Follow the instructions on screen to put the device in pairing mode. Once the device is in pairing mode, click “Next” in the app. the next screen will ask you to enter the wifi details that you want your next device to use. Make sure you are using a 2.4Ghz WiFi connection as all Sonoff Devices work on this frequency.
Enter you details and click “Next” again. The app when then start looking for the device.
Once the app finds the device it will transfer the wifi settings to it and restart the device. Some times you may have to repeat this stage several times in order for the app to pick up the device.
The final screen will ask you to name your device. Add a name and csave the changes. This then completes the setup process. Once the device is added, click in the device and go to settings. you will need to set the “inching setting to on and make sure that the firmware is on the latest version. if there is an update then allow the update to install the latest version. Once updated to return to the device screen.
Now to automate the switch depending on the soil moisture level. Click on "Auto" in the bottom left corner of the screen.
This will open a page that will let you add an automation. Click the "Add" button in the middle of the screen and add in the parameters for your automation. in the screenshot below shows that the switch will turn on if the soil moisture level or humidity is lower than 15%. The switch will then turn off once the MS01 Soil moisture sensor detects a moisture level of 25% or higher. This works well for my application but you may want to change this depending on what plants you are maintaining. click the save button on the top left to save the automation.
Now the device is in the eWeLink app it can also be added to Alexa if you wish. To do this just ask Alexa “Alexa, Discover new devices” the new device will then be found for you to use.
Build - Water Pump
Once the device has been added in the app, We can now start working on the water pump system.
Cut the PVC pipe to length and fix it to the water pump. a push fit will be fine for this no glue or adhesive is necessary. The PVC pipe should be long enough the reach from the bottom of the water container to the plant pot. secure the other end of the PVC pipe to the plant pot so that the end of the pipe is over the soil. The PVC pipe should be fitted to the spout on the top of the pump, like the one shown below.
Fill the water container and place the water pump with the PVC pipe into the container so they are fully submerged in the water.
Plug in the power adaptor of the pump into the socket of the power extension cable.
Thats it!
You should now have a functioning smart watering system. to test the system the MS01 soil moisture sensor can be removed from the soil for a second to ensure the pump turns on and starts pumping water.
There are so many applications for this type of set up, from watering a single house plant to watering large, outdoor rasied flower beds. Take a look at the gallery at the bottom of this page for a look at how I grew this project to be able to water an outdoor potted plant using hte MS01 Soil Moisture sensor and the TH10 using the Sonoff waterproof housing to keep all the electronics safe from the elements. If you would like more information on how to build this project please get in touch using the form on the Contact page.
This project was made possible using the Sonoff MS01 Soil moisture sensor and TH10 WiFi Smart Switch. Both of these devices are available for purchase from itead.cc
I hope you enjoy building this project and happy automating!