Wireless Soil Moisture Sensor
Create a wireless soil moisture sensor to remotely monitor your plants and remind you when to water. This project uses a D1 Mini micro-controller, 3D printable parts and the Blynk IoT platform.
The device can be used stand-alone or eventually integrated into a fully automated gardening system.
Here is a video summary of the sensor and all its features...
For more details of this and other similar projects see my website: http://www.cabuu.com
3D-Print Your Parts
Start by downloading and printing the 3 printable parts. The parts hold all the components neatly in place and are simple in design to facilitate printing on most 3D-printers. I used the following settings:
- 0.2mm layer height
- 20% Infill
- Support
Once printed, remove the support structures from the main body to allow access to the D1 mini and charge controller.
Build Your Electronics
Gather your components together, you will need:
- Capacitive Soil Moisture Sensor
https://www.banggood.com/Capacitive-Soil-Moisture-...
- 18650 3.7V Battery
https://www.banggood.com/2pcs-Basen-BS186Q-18650-3100mah-3_7V-40A-High-Drain-Flat-Top-Rechargeable-Li-ion-Battery-p-1038113.html?p=KF2715792233201409DJ&custlinkid=324507
- 18650 Battery Holder
https://www.banggood.com/5pcs-DIY-Battery-Box-Holder-Case-For-18650-Rechargeable-Battery-p-965083.html?rmmds=search&p=KF2715792233201409DJ&custlinkid=324508
- TP4056 Charge Controller
https://www.banggood.com/TP4056-Micro-USB-5V-1A-Lithium-Battery-Charging-Module-Board-TE585-Lipo-Charger-p-1225993.html?p=KF2715792233201409DJ&custlinkid=147635
- WS2812 RGB LED
https://www.banggood.com/10Pcs-DC-5V-3MM-x-10MM-WS...
- DC Jack
https://www.banggood.com/10pcs-5_5-x-2_1mm-DC-Power-Supply-Female-Jack-Socket-p-1062018.html?rmmds=search&cur_warehouse=CN&p=KF2715792233201409DJ&custlinkid=324512
Put together the electronics as shown in the schematic. Solder wires direct to the boards, alternatively you may use jumper wires. Keep the wires long enough that all components fit within their places in the housing but not so long that the lid won't close! Remember to solder the RST and D0 pins together to enable the deep sleep mode of the D1.
Configure Blynk
Install the Blynk app from the Google Play or Apple app Store and create a new project using the QR code above. Make note of the authentication code for your project.
In order to upload the sketch you will first need to install the esp8266 board and two libraries, if you haven't done so already.
To install the esp8266, add the following URL to the Additional Boards Manager URLs in the Preferences window of the Arduino IDE.
http://arduino.esp8266.com/stable/package_esp8266com_index.json
Now within Boards Manager, install the esp8266 board. Using the library manager, install the FastLED and Blynk libraries.
Download the Arduino sketch and configure it for your WiFi SSID, password and Blynk authentication token. Upload it to the D1 Mini using the micro USB connector. Check that each component of the device works before moving onto the next step. If something doesn't work check your connections carefully and rule out individual device failures by replacing them in turn.
Downloads
Assembly and Configuration
Assemble the components within the printed housing and insert a battery. Use a glue gun to hold everything in place and to secure the battery and sensor covers. The sensor is designed to be used indoors, if you want to use it outdoors you will need to weatherproof it first!
Place the sensor, load up the Blynk app and monitor! Adjust the wet/dry thresholds within the app until you find the correct settings for your particular sensor/soil/plant. And that's it, just remember to water when notified...
A Note About Power
The device is designed to be powered using a single 3.7V 14650 type battery. Depending on the battery capacity, using deep sleep mode, it should last approximately 2-3 weeks. The battery can be charged using a standard 5V USB connected to the micro-usb connector located on the charge controller.
For a more permanent source of power a solar panel may be connected to the DC jack at the top of the device.
Adding a Solar Panel
Adding a solar panel can create a near continuous source of power for many IoT devices. See my video for the theory behind this.
The DC jack at the top of the device can be used to attach a suitable solar panel, I recommend a 6V panel of approximately 4-5W.
- 6V 4.5W Solar Panel
https://www.banggood.com/custlink/GvD3YIs0PU
Simply solder a male DC cable to the solar panel, place in a sunny location and attach to the moisture sensor.