The problem
Fertilizing well requires knowing which nutrients are in the soil, and that changes over time. Today that means sending samples to a lab: about S/ 250–300 (≈ US$ 70–80) per sample and days of waiting. Frequent monitoring becomes unaffordable, especially for small and mid-sized farms.
The proposal
An autonomous ground vehicle that drives across the field, drills the soil, lowers a NIR (near-infrared) probe, captures the spectrum and estimates nutrients on site with a machine learning model. Results are shown on a map from a phone or computer.

The design followed the VDI 2221 methodology and covers every subsystem:
- Mechanical: chassis, tracks, drilling and probe-lowering mechanism, verified with stress simulation (von Mises, displacement, safety factor).
- Electronics: Raspberry Pi 5 as main controller and ESP32 as secondary controller; navigation, environmental, power and proximity sensors; schematics and PCBs.
- Power: 18 V solar panel, DC-DC converter, 4S BMS and consumption monitoring.
- Control: autonomous GPS waypoint navigation with angular-error control, sampling routine and fault handling (overheating, lost link, internal humidity, obstacles).
- Communications: 433 MHz LoRa radio for data and Wi-Fi (ESP32 as access point) for the web UI, with offline mode and later sync.
Machine learning
I trained multi-output regression models on spectra from the Open Soil Spectral Library and LUCAS 2015 (European Union), including parsing the spectrometer’s binary ASD files. I compared an MLP against an SVR tuned with the Dung Beetle Optimizer (DBO-SVR). DBO-SVR won on almost every variable:
| Soil property | R² | RPD |
|---|---|---|
| Nitrogen | 0.956 | 4.75 |
| pH (CaCl₂) | 0.948 | 4.38 |
| Calcium carbonate | 0.946 | 4.30 |
| pH (water) | 0.943 | 4.20 |
| Organic carbon | 0.932 | 3.83 |
An RPD above 3 is considered very high predictive ability in soil spectroscopy. Phosphorus and potassium scored lower, which is expected given their weak NIR response.
Economic feasibility
- Estimated component cost: S/ 5,146 (the spectrophotometer is 54% of it).
- For a 200 ha farm sampling 5 points/ha, cost per sample would drop from S/ 250 to ≈ S/ 8.60 over 3 years.
What I learned
The hardest part was integrating disciplines. Structure, electronics, control, spectroscopy and the prediction models all constrain each other: the spectrophotometer’s weight changes the chassis, the chassis changes power draw, and power draw changes range. I learned to make decisions by looking at the whole system rather than each part on its own.
Next step
The thesis covered design and simulation. I am implementing the system’s web interface as a separate project: Niranden.
