This is a capacitive soil moisture sensor which runs with a standalone ATmega328P and utilizes the MySensors framework. It can however be adapted to any other framework that uses 2.4 GHz radio communication with a NRF24L01 if you upload your own code.
A short summary of the features is:
Note: Take care when inserting the batteries as there is no reverse polarity protection on this board. Also check the pin assignment of the FTDI and AVR ISP headers as these might be non standard to save some space.
If you want to work on the repository you just have to run:
git clone --recurse-submodules https://github.com/RonMcKay/capacitive-soil-moisture-sensor
The PCB design is done in KiCad 5. You are pretty much good to go if you open the project with KiCad.
You can generate production/documentation files and run ERC/DRC tests by running
make in the root directory. All production files are then placed under the hardware directory. The Makefile utilizes docker containers so you should have docker installed. Note that the folders
.cache/kicad should already exist in your home directory.
I am happy to discuss and accept improvements on the project. Please make all your pull-requests on
dev. It is also a good idea to discuss your planned changes in the github discussion section to avoid unnecessary work.
In recent years the DIY PCB industry segment has been growing and thus there are numerous options to quite easily order your boards online for low prices. Just download the Gerber-files from the release page or clone the repository and generate them yourself by running
For the assembly of your boards there are currently no SMT assembly files supplied with the release, although there are pick and place files for JLPCB generated by
make they are not yet optimized or tested, so use them at your own risk. For manual assembly you can find the BOM attached to the release as well as a nice interactive HTML BOM which eases component placement. You only need to take care that the two battery holders which are closest to the radio module do not touch each other as this would cause a short. To be really safe you can bend them away from each other.
There is currently a 3D-printable case for the sensor with a screw on lid. In the future there might be other alternatives which require less printing time. There is also a plan to port the case design to an openSCAD file but that is WIP.
The minimum (air) and maximum (water) sensor values need to be calibrated. For this, get a glass of water and flash the sensor with
#define CALIBRATION_MODE. While reading out the log messages of the sensor, note down the sensor values for air and submerged in water. Change
WATER_SENSOR_VALUE accordingly and reflash the sensor after commenting out
#define CALIBRATION_MODE. Your soil moisture sensor is now ready for operation.
Here is a list of possible future improvements that might be worth looking into:
Any contributions are highly welcome and I am happy to discuss remarks in the github discussion section.
This project is licensed under the CERN-OHL-P v2
P.S.: The sensor on the photos is only a prototype where I accidentally soldered some wrong value capacitor and forgot a capacitor for the FTDI connector. These are however already fixed in the pcb design.
|rev1||1 year ago||2||186 × 23|