Building a soil moisture sensor with Arduino
From a bare sensor board to a calibrated device with a companion mobile app.
Knowing how much water is in the soil is the difference between watering too much, too little, or just right. For my BSc research in Soil Science, I wanted to build a low-cost soil moisture sensor that could be calibrated for local soil types — and give farmers and researchers a simple way to read it.
The hardware
The heart of the project was an Arduino with a capacitive soil moisture sensor. Capacitive sensors are a good choice here because they measure the dielectric constant of the soil (which changes with water content) without corroding the way cheap resistive probes do.
The sensor reads a raw value, but raw values alone aren't enough. Different soils — sandy, clay, loamy — hold water very differently, so the same raw reading can mean "bone dry" in one soil and "waterlogged" in another. That's where calibration comes in.
Calibrating for local soils
I calibrated the sensor against known moisture levels for several local soil types, collecting paired measurements and fitting a relationship between the raw reading and actual water content. That step turned a generic sensor into something that gives meaningful numbers in the field.
The companion app
Data is only useful if people can get to it. I built a React Native mobile app (using Expo) that connects to the sensor and displays moisture readings, so a user doesn't need a laptop to check the soil. The app was built to be simple and fast to use outdoors.
What I took away
- Calibration is everything — a sensor without context is just a number.
- Pairing hardware with a friendly app turns a research gadget into a practical tool.
- Cheap components can do serious work if you put the effort into validating them.
This project was my first real end-to-end build that crossed hardware, data and software — and it shaped a lot of what I work on today.