🤗 Please consider subscribing to my YouTube channel Your subscription goes a long way in backing my work. if you feel more generous, you can buy me a coffee
Wireless "SOILSENS-V5W" and Wired "SOILSENS-V5"
The SOILSENS-V5W is a reliable wireless capacitive soil moisture sensor that utilizes ESP-NOW or Wi-Fi
for connectivity. It includes a soil temperature sensor, an air humidity and temperature sensor, and a light intensity sensor. One of its key advantages is that the capacitive sensor electrodes are embedded within the inner layer of the PCB, providing protection. It boasts very low power consumption, a compact design, long-range capabilities in ESP-NOW mode, and configuration changes that can be made without the need for reflashing. Additionally, it supports MQTT Autodiscovery through CapiBridge in ESP-NOW mode or simple Wi-Fi, making it 100% compatible with Home Assistant.
🛒 Where to buy https://www.PricelessToolkit.com
Note
If you're ready to contribute to the project, your support would be greatly appreciated. Due to time constraints, I may not be able to quickly verify new "features" or completely new "code" functionality, so please create a new code/script in the new folder.
- 10.11.2024 - Increased sensor calibration time to 60 seconds.
- 10.11.2024 - Added RSSI and raw moisture ADC values to MQTT payload.
- 24.07.2024 - Work in progress: "Implementing CRC for ESP-NOW."
- 22.07.2024 - Added the ability to configure the sensor through a Wi-Fi hotspot.
- 21.07.2024 - Combined WiFi and ESP-NOW firmware.
- 20.07.2024 - Implemented MQTT Autodiscovery in "WiFi Mode."
- 15.06.2024 - Published battery percentage.
- Microcontroller:
- ESP32-C3
- Sensors:
- Soil Temperature: TMP102
- Air Temperature and Humidity: AHT20
- Light Sensor: ALS-PT19-315C
- Soil Moisture: PCB Trace in the internal layer
- Power:
- Uses 1S LiPo Battery "Connector PH2.0"
- Requires external 1S LiPo charger
- Buttons:
- PRG (Programming)
- RST (Reset)
- CAL (Calibration)
- TRG (Trigger)
- LED Indicators:
- Green LED: Indicates the power-on state
- Blue LED: Indicates calibration/configuration mode
- Sensor Reading Interval:
- Default: 1 hour
- Configurable: 5m, 10m, 30m, 1h, and 2h
- Configuration Method: Adjustable via onboard PCB solder jumpers
- 1S 250mAh or less LiPo Battery (Connector PH2.0) 35x20x4mm MAX.
Warning
Note
Lipo Polarity explanation "Adafruit Video" https://youtu.be/ILArrTIMFyM?si=WlTsnVo7XTozZ2FT
- 1S 4.20V LiPo charger.
Warning
- SOILSENS-V5W supports two modes:
ESP-NOW
andWiFi
for MQTT-based connectivity. - Upon powering on, the SOILSENS-V5W operates in ESP-NOW mode by default. This mode does not require any initial configuration and communicates directly with the Capibridge gateway. The default Gateway Key is "xy"
Feature | ESP-NOW | WiFi |
---|---|---|
Energy Efficiency | Highly energy-efficient | ~3x Higher power consumption |
Range | Long-Range | Short range |
Configuration | Does not require configuration | Requires network and MQTT configuration |
Broadcasting | Sensor data can be read from a third device without connecting to a network | Requires connection to a network |
Gateway Requirement | Requires a gateway Capibridge | Does not require a gateway |
Note
Measured using Power Profiler KIT 2
Battery Capacity 250mAh, Power Cycle 1h
Parameter | WIFI | ESP-NOW |
---|---|---|
Active Duration (seconds) | 1.5 seconds | 0.55 seconds |
Current During Active Phase | 47 mA | 40 mA |
Energy Consumption in Active Phase | 0.02 mAh | 0.006112 mAh |
Inactive Duration | 0.99956 hours | 0.999847 hours |
Energy Consumption in Inactive Phase | 0.00007 mAh | 0.00007 mAh |
Total Energy Consumption | 0.02007 mAh | 0.006182 mAh |
Total Hours of Operation | 12,459 hours | 40,445 hours |
Total Days of Operation | 519 days | 1,685 days |
To access the configuration settings, follow these steps:
-
Initiate Configuration Mode:
- Press and hold the calibration button.
- While holding the calibration button, briefly press the trigger button.
- Continue holding the calibration button for more than 3 seconds and release it.
- The blue LED will blink five times, indicating the device has entered configuration mode.
-
Access Configuration via WiFi:
- After entering configuration mode, the sensor creates a WiFi Access Point (AP) named
SOILSENS-V5W
. - Connect to this AP using the default password:
password
. - Open a web browser and navigate to
http://192.168.4.1
to access the configuration page.
- After entering configuration mode, the sensor creates a WiFi Access Point (AP) named
Mode ESP-NOW | Mode Wi-Fi |
---|---|
Default Node name and key. | Only the key is not required. |
- Web Configuration:
- Node Name: Enter a unique name for your sensor.
- Gateway Key: Enter the key for the Capibridge gateway. for WIFI Mode not required
- Mode: Select the desired mode:
- 1 (ESP-NOW): Selects ESP-NOW Protocol "Long-Range".
- 0 (WiFi): Selects standard WiFi and MQTT setup.
- For WiFi mode:
- WiFi SSID: Enter your WiFi network name.
- Password: Enter the WiFi password.
- MAC Address: Specify the Access point MAC address "9b:84:5a.....".
- Local IP, Gateway, Subnet: Enter IP address
⚠️ "IP Address outside of DHCP Range". - MQTT Server, Port, Username, Password: Provide MQTT broker details.
After entering the necessary information, click Submit to save the configuration. The sensor will restart with the new settings.
Important
ESP-NOW
with Key xy
.
Accurate soil moisture readings require proper calibration. Follow these steps:
- Insert the sensor into the flowerpot, ensuring the soil is as dry as your plant can tolerate.
- Press and hold the calibration button. Avoid moving the sensor to keep it securely embedded in the soil.
- While holding the calibration button, briefly press the trigger button.
- Continue holding the calibration button for less than 2 seconds, then release it.
- The blue LED will blink twice, indicating the start of the "dry soil" calibration.
- The device will complete the minimum moisture level calibration, indicated by three blinks.
- You now have 60 seconds to water your plant to its maximum acceptable moisture level.
- I recommend watering the entire soil surface for no more than 20 seconds, allowing it to soak in for 40 seconds.
- After 60 seconds, the blue LED will blink twice, signaling the start of the "wet soil" (100%) calibration.
- The device will complete the "wet soil" calibration, indicated by three blinks.
Note
To ensure accurate readings, avoid touching or moving the sensor after calibration to prevent loosening in the soil. If, over time, sediment accumulates in the soil, the Moisture MIN and MAX values may change.
Important
Note
Ensure the Wi-Fi signal strength at the installation point is strong and stable.
RSSI (dBm) | Signal Quality | Description |
---|---|---|
-30 to -50 dBm | Excellent | Very strong signal, ideal for stable data transmission |
-51 to -60 dBm | Good | Strong signal, generally reliable for data |
-61 to -70 dBm | Fair | Moderate signal, some minor issues possible, but usable |
-71 to -80 dBm | Poor | Weak signal, may experience some data drop |
-81 to -90 dBm | Very Poor | Very weak signal, frequent data drop likely |
Below -90 dBm | Unusable | No effective connection, likely out of range |
Solder Jumpers | interval selection |
---|---|
You can change it by cutting the middle of the 1H Jumper. Then bridge the other jumper with the solder. Available intervals are 5m, 10m, 30m, 1h, and 2h, plus every combination is possible. Parallel Resistor Calculator |
But if you are bored and want to play with different intervals you can change the resistor value.
Time Interval | Resistor Value (kΩ) | Time Interval | Resistor Value (kΩ) |
---|---|---|---|
1 min | 22.00 | 10 min | 57.6 - soldered |
2 min | 29.349 | 20 min | 77.579 |
3 min | 34.729 | 30 min | 93.1 - soldered |
4 min | 39.097 | 40 min | 104.625 |
5 min | 42.2 - soldered | 50 min | 115.331 |
6 min | 46.301 | 1 h | 124.00 - soldered |
7 min | 49.392 | 1h 30min | 149.398 |
8 min | 52.224 | 2 h | 169.00 - soldered |
9 min | 54.902 |
Note
Default time interval is 1 Hour. Reducing the time interval will result in increased energy consumption.
-
- Open the provided code in the Arduino IDE.
-
- Install all neccecery libraries.
#include <esp_now.h>
#include <WiFi.h>
#include "driver/adc.h"
#include "esp_adc_cal.h"
#include "Wire.h"
#include <SparkFunTMP102.h>
#include <ArduinoJson.h>
#include <AHT20.h>
#include <Preferences.h>
#include <WebServer.h>
#include <PubSubClient.h>
-
- Select the appropriate board and port parameters (refer to the provided screenshot for settings).
-
- Connect 3.3V USBTTL adapter to SOILSENS-V5W
Sensor Pin | Adapter Pin |
---|---|
TX | RX |
RX | TX |
3V3 | 3V3 |
GND | GND |
-
- Press and hold the PRG button on the sensor.
-
- While holding the PRG button, connect the USB to TTL adapter to the USB port of your computer.
-
- Click on the Upload button to upload the code to the sensor.
The ideal material for the case is transparent and UV-resistant. ASA "UV-resistant" or ABS in white is the best choice as it allows light to enter, enabling the luminance sensor to function properly. For indoor use, consider translucent PETG to increase the luminance sensor's range and opt for a 3D-printed case with vent holes to ensure proper function of the air humidity and temperature sensors. For outdoor use, a case without vent holes is recommended to prevent water ingress during heavy! rain. Glue for case https://s.click.aliexpress.com/e/_DcvGBY9
Due to the capacitive sensing principle, readings can vary based on soil moisture, tightness, and insertion depth. Repeated insertions might loosen the soil, affecting subsequent readings.
- Holding the calibration button.
- More than 3 seconds configuration mode.
- Less than 2 seconds Calibration mode.
- When manually pressing the trigger button, the sensor may occasionally stay on and not power off if the button is not released quickly enough. If this happens, simply press the reset button.