gabvmon.com
← All projectsCompleted

Autonomous vehicle for soil analysis with NIR spectroscopy

Engineering thesis. Full design of a robot that estimates soil nutrients in the field by combining NIR spectroscopy and machine learning. Approved unanimously.

Role
Author (mechanical, electronic and control design, ML and UI)
Context
Mechatronics Engineering thesis, PUCP
Period
2024 – 2026
Stack
PythonScikit-learnPandasJupyterAutodesk InventorRaspberry Pi 5ESP32LoRa 433 MHzFigma
Thesis vehicle in halftone over the nutrient map

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.

Vehicle render with its main components

The design followed the VDI 2221 methodology and covers every subsystem:

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

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.