Video version of the article:
I'm looking to install some soil moisture sensors in my garden, so I've been looking for an ESPHome-based sensor. I found b-parasite but it was based on E73-2G4M08S1C (nRF52840). I didn't want to buy a separate programmer for it, so I decided to abandon the idea, but by chance I came across w-parasite from the same developer.
w-parasite is based on ESP-WROOM-32D and will perfectly support my needs. This sensor is cheaper than a sensor with a BLE microcontroller. I got about $7 for the sensor, while the b-parasite would cost at least $12 + programmer + WiFi-BLE Gateway.
So I decided that w-parasite would be better for me and ordered boards and components for it.
Next, I need to solder the board and upload the firmware.
There are several points to pay attention to. The author of the original repository advises to disable BROWNOUT detection (when BROWNOUT is turned on, the controller will turn off at too low a voltage, less than 3.3 volts, if BROWNOUT is turned off, the controller will be able to work at a reduced voltage, but an unexpected error may occur). In any case, even with BROWNOUT disabled, the controller could not be flashed via OTA, so I added a 470uF electrolytic capacitor. But if you add a capacitor, turning off BROWNOUT may not be necessary.
Then I decided to take measurements. The device consumes 0.0009Wh per soil moisture measurement when using ESPHome API and 0.0006Wh when using MQTT. That is, in my case, I can measure soil moisture every half hour every day for a year with a 3500 mAh battery. I would like to note that the author of the original firmware writes about measuring every 5 minutes during the year, but I did not manage to achieve such a result because the most energy-consuming process is connecting to WiFi, and for me it takes 4 seconds, while for the rbaron it takes less than a second.
To configure the device, I need to turn it on (reset the battery protection by shorting B- and P- on the protection board, it works specifically for my case, do not short the contacts on the battery protection if you do not know how it works) and enter two fields in the settings. The first is the voltage of the sensor in air, and the second is the voltage of the sensor in water.
The test run also showed that lowering the battery voltage below the stabilization voltage causes a distortion of soil moisture indicators. To fix this I added a battery voltage compensation.
Now I can pack the sensor board into the housing and assemble the test stand.
That's all, thanks rbaron for a great PCB
Comments
Please log in or sign up to comment.