Wireless Soil Moisture Sensor

11,008

65

15

Introduction: Wireless Soil Moisture Sensor

About: Arduino, Alexa, etc.

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
  • Support

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

Step 3: 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.

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.

Simply solder a male DC cable to the solar panel, place in a sunny location and attach to the moisture sensor.

IoT Challenge

Runner Up in the
IoT Challenge

2 People Made This Project!

Recommendations

  • Puzzles Speed Challenge

    Puzzles Speed Challenge
  • "Can't Touch This" Family Contest

    "Can't Touch This" Family Contest
  • CNC Contest 2020

    CNC Contest 2020

15 Discussions

1
RichardM194
RichardM194

4 weeks ago

I'm having issues were the sleep mode just locks up the D1 Mini, I've jumped D0 and RST but still using your Blynk setup it just lockes up and I have to hit the reset button. Any Ideas?

0
marcosarnus
marcosarnus

Reply 15 days ago

Same here, after sleeptime has passed it shows only gibberish:
"Sleeping...
⸮HA⸮G⸮⸮"

edit: It worked by jumping D0 and RST. Check if you're not jumping D8 instead.

0
cabuu
cabuu

Reply 4 weeks ago

Connect it to the USB and see if it's reporting anything in the serial monitor within Arduino. Feel free to post here if you need help deciphering any messages.

0
RichardM194
RichardM194

Reply 4 weeks ago

When I get home I'll give it a try. Thank you

0
ackbad
ackbad

4 months ago

are there any better apps to use that are free?

0
woodnboats
woodnboats

Reply 8 weeks ago

If by "better" you mean "prettier" check out Virtuino. It's free in a limited form and $9.95 for the full version. Since you make your own server on your own computer (or even on the ESP) there is no usage charge.

Blynk is free also if you use just the free Energy Credits, but you can also put it on your own server, which gives you unlimited Energy and no limits on usage. There is no charge for the server software or the phone app.

0
chayanforyou
chayanforyou

Question 7 months ago

How you've calibrated wet/dry levels?

Annotation 2019-12-21 123944.jpg
0
ramirezkj1
ramirezkj1

8 months ago

Hi, I am new to this. I keep getting this error and don't know how to fix it please help.

Sensor_error.png
0
MarioM264
MarioM264

Question 11 months ago

hi i m not programmer so i dont understand whats this message:
In function 'void myTimerEvent()':
Soil_Moisture_Sensor_v1_21:227:9: error: 'bridge1' was not declared in this scope
bridge1.virtualWrite(V1,1);

0
Mattat01
Mattat01

Reply 9 months ago

MarioM264 - Just comment that line out. I believe the author was using it to send data to his irrigation system and it is not necessary for the sensor to work.

0
cabuu
cabuu

Reply 1 year ago

You calibrate within the Blynk app, there are sliders where you can set the moisture wet/dry thresholds.