We first start by making the Cad design of the whole model in Fusion360.
We modeled the Soil Moisture Sensor after modeling the XIAO Expansion board first. Modeling every component before creating the design is a smart idea because it makes the process more accurate and efficient.
We created a holder that will incorporate the soil sensor and XIAO expansion board. Four M2 screws are used to secure the XIAO expansion board in its holder. Since the soil sensor did not have the mounting holes, we made three holes close to the module's edge instead. We will insert M2 screws into these holes to secure the sensor in its initial position.
After finalizing the model, we exported the holder and 3D printed it on my Ender 3 printer with white PLA using a 0.6mm nozzle.
2
HARDWARE
We're using the XIAO SAMD21 M0 Development Board, which, paired with the XIAO extension board manufactured by Seeed Studio, is the heart of this project.
It comes with rich peripherals that include an OLED, RTC, SD Card Sot, passive buzzer, reset/user button, 5V servo connector, and Grove connector for pairing multiple Grove devices with XIAO.
We can power the entire setup using any Li-ion or LiPo cell thanks to its integrated Li-ion charging circuit; later in the project, we will be using a small Li-Po cell to power the whole setup.
If you would like to get one for yourself, here is the link to its page.
This project is sponsored by Seeed Fusion. Seeed Fusion offers one-stop services catering to your needs, from design & customization to production and promotion. Focus on your strengths, co-create and co-grow with Seeed Fusion! Explore more here: https://www.seeedstudio.com/fusion.html
One of the reasons for using the expansion board was its intergraded OLED display, which we will be using for displaying sensor values.
As for measuring the soil humidity and moisture, we're using a gravity moisture sensor that uses the two probes to pass current through the soil, and then it reads that resistance to get the relative moisture level. More water makes the soil conduct electricity more easily (less resistance), while dry soil conducts electricity poorly (more resistance).
Here are a few of its specs.
Power supply: 3.3v or 5v
Output voltage signal: 0~4.2v
Current: 35mA
Pin definition:
Analog output (blue wire)
GND(Black wire)
Power(Red wire)
Value range:
0 ~300 : dry soil
300~700 : humid soil
700~950 : in water
3
CONSTRUCTION
Using a soldering iron and jumper wires, we first connect the XIAO Expansion board to the soil sensor's VCC GND and sensor pin by following the wiring diagram that is included.
The JST connector from the Li-Po cell is then plugged into the battery JST connector present on the XIAO Expansion board.
We're using a 3.7V, 100mAh Li-Po Cell here.
Subsequently, the LiPo is inserted into the 3D Printed Holder, and the expansion board and soil sensor are mounted.
Next, we install the expansion board using four M2 screws and the soil sensor in its proper position using three M2 screws.
Assembly is complete.
4
TEST SKETCH FOR SOIL SENSOR
Here's the test sketch which we first uploaded to the XIAO for basic testing of the soil sensor.
The XIAO DEV Board reads the value from the Soil Sensor analog pin, which is connected to the A0 pin of the XIAO. The value is then shown on the Serial Monitor at a rate of 57600 Baud.
The soil is deemed dry if the value falls between 0 and 300.
A value between 300 and 700 indicates that the soil is humid, while a value between 700 and 950 indicates that there is an abundance of water in the soil.
5
MAIN CODE
We uploaded the main code to the XIAO, and we got a reading of 1–9 without adding the sensor to the soil.
We gather some dirt into a small container and place the soil meter inside for the initial readings.
The measurements range from 450 to 455, indicating that the soil is wet.
Following an inside sensor test, we moved the instrument outside and placed the sensor probes on DRY soil, where we obtained readings between 13 and 15.
When we added water to the dry soil, the GROW Meter detected it and gave us a reading higher than 700.
When the water is absorbed by the soil, the value drops to 450–500 after a few minutes, indicating that the soil is now moist.
The most appealing aspect about this setup is that it is small, lightweight, and portable, making it ideal for measuring soil moisture levels in various locations.
The XIAO Expansion board, powered by a Li-Po cell, allows the entire setup to be truly portable.
This is it for today, folks. Special thanks to Seeed Studio for supporting this project.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.