Soil Analyzer

Device

The Soil Analyzer is a small handheld probe device that detects the Nitrogen, Phosphorus, and Potassium content in the soil within +-2% accuracy in mg/kg. It also detects the surrounding environment's temperature and humidity, and finally the soil moisture. It then connects to a laptop via bluetooth and displays all of this data to the user via a Unity program I wrote.

The final probe encased in a 3D printed shell I modeled to conceal the electronics.

Skills Used

Advanced Circuitry

Unity Engine

C#

Fusion 360

Corel Draw

Laser Cutting

Demonstration Video

The video below demonstrates the probe connected to my laptop via Bluetooth periodically sending sensor data to the Unity program which is displayed in the Unity console.

Final Layout

Below are photos showcasing the final design and electronics. Due to this being an older project, there is no officially schematic or PCB.

Inner Electronics - Front - Shows the Arduino Nano microcontroller controlling the device (center), soil moisture sensor (bottom right), and HC-06 Bluetooth module (top left).

Inner Electronics - Back - Shows the 9V compartment (top left), DHT-11 temperature humidity sensor (middle, blue), and the NPK sensor (coming out of the bottom right side).

Bill of Materials (BOM)

Due to this project being developed a long time ago, there is no formal Bill of Materials.

Using the Device

Using the Device such as Pinouts or Setup is detailed below.

Setting Up & Using the Device

The device simply needs a 9V battery, and then can be found using normal Bluetooth setup on a Bluetooth-capable laptop or PC. From there, run the Unity program once paired, and the sensor data is output from the device.

Development Documentation

Challenges, What I Learned, and More.

Challenges

The biggest challenge by far was the Bluetooth. I originally tried BLE (Bluetooth Low Energy), but later discovered (I believe) that BLE wasn't compatible with Windows devices. Once I realized that, I then switched to an HC-06 module. While that was easy to setup, writing the code on the Unity C# side to interface with that through Window's virtual serial port (for Bluetooth devices) and then properly pairing was difficult, but I pulled it off. Additionally, using and interfacing with the NPK probe sensor was incredibly difficult. Not only was the sensor incredibly expensive ($50 to $75, I believe), it also utilized a different data communication protocol (Not I2C, UART, or any standard method), requiring me to get a converter board in addition to everything else. Regardless, I eventually got it working properly, and the device in the end fully worked.

What I Learned

Ultimately, I learned to interface with an Arduino Nano (and therefor could apply this knowledge to other microcontrollers) via Bluetooth to a Unity program. This is INCREDIBLY powerful, and I could use this skill to create a whole world of IoT devices in the future if I wanted to. The ability to use the Unity Engine and have that interface with a microcontroller at all, let alone wirelessly so seamlessly via Bluetooth, opens a world of possibilities.

Inspiration

Ultimately this device was inspired from an earlier gardening-based project, albeit much different to this one, my Module Garden System. Using technology in nature, in order to assist it or better understand it via research, has always fascinated me, and this project for sure falls under that umbrella.

    Socials