Introduction: 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
Step 1: 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
Once printed, remove the support structures from the main body to allow access to the D1 mini and charge controller.
Step 2: Build Your Electronics
Gather your components together, you will need:
- Capacitive Soil Moisture Sensor
- 18650 3.7V Battery
- 18650 Battery Holder
- TP4056 Charge Controller
- WS2812 RGB LED
- DC Jack
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.
Step 3: Configure Blynk
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.
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.
Step 4: 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...
Step 5: 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.
Step 6: 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
Simply solder a male DC cable to the solar panel, place in a sunny location and attach to the moisture sensor.
Runner Up in the