Soil Sensor with Arduino / ESP8266 / ESP32

Soil Sensor with Arduino / ESP8266 / ESP32 © CC BY-NC-SA

Soil Moisture Sensor is a modern, completely sealed capacitive 1-Wire moisture sensor with temperature sensor. How to use it with Arduino?

  • 11 views
  • 0 comments
  • 0 respects

Components and supplies

Apps and online services

About this project

The 1-Wire HARDWARIO Soil Sensor returns soil moisture humidity using relative values. Sensor is very sensitive and you can get range from 6500 when sensor is dry and 13000 when sensor is fully submerged into the water. Measuring is done by two copper strips inside the inner layers of the 4 layer PCB. This way the contacts are not exposed to direct humidity and do not oxidize.

It is also possible to use sensor to measure water level.

Schematics and more details could be found od HARDWARIO Developers portal.

Step 1: Connect Soil Sensor to Arduino

Soil Sensor can work with voltages from 3 to 5 V so you can use 3 or 5 V Arduino. It is using 1-Wire so your data pin must have 4.7 kOhms pull-up resistor to VCC pin.

Just connect VCC, GND wires and data pin to Arduino pin 7.

  • Red wire - Vcc (3 to 5 V)
  • Black wire - GND
  • Yellow wire - Pin 7 (add 4.7k pullup)

Step 2: Install SoilSensor and OneWire library

First, go to the Sketch > Include Library > Manage Libraries...

Search for SoilSensor library and click Install.

You will also need OneWire Library installed.

Step 3: Use example code

Go to File > Examples > SoilSensor and choose SoilSensorText example code

This code will print temperature and moisture every second over serial port with 9600 baud. Compile sketch and upload it.

Step 3: Receive data

Open Serial Monitor, set 9600 baud and here are your data from moisture sensor and temperature sensor.

Graphical display of values

You can also use second example SoilSensorPlot which will send you data in a format the Arduino Serial Plotter could display. Again, choose 9600 baud.

Code

Comments

Similar projects you might like

Using the YL-39 + YL-69 Soil Humidity Sensor with Arduino

Project tutorial by Sorin Trimbitas

  • 33,376 views
  • 6 comments
  • 20 respects

How to Use a Soil Moisture Sensor

by MisterBotBreak

  • 48,154 views
  • 13 comments
  • 48 respects

WiFi ESP8266 and DHT22 Sensor

Project tutorial by Hernanduino

  • 30,262 views
  • 7 comments
  • 28 respects

Telegram Bot with ESP8266

Project tutorial by Shebin Jose Jacob

  • 45,892 views
  • 44 comments
  • 79 respects

Soil Moisture Sensor With LCD Display

Project tutorial by Patel Darshil

  • 41,180 views
  • 12 comments
  • 59 respects
Add projectSign up / Login