Skip to main content
BlogNewsTop News

Cellular IoT Soil Moisture Monitor: A Golioth Reference Design

By May 18, 2023No Comments

Written by Chris Gammel, Developer Relations Lead at Golioth

This blog originally ran on the Golioth website. For more content like this, click here.

Farms and growing operations are no strangers to measurement and feedback. Farmers often chart things like rainfall and days of sunshine, as well as taking soil measurements at regular intervals. As operations grow, so too do the cost of operations: you need more people to take readings, the area of coverage grows, you need a more complex logistical operation when trying to do automated readings.

YouTube player

At Golioth, we make it easier to prove the value of creating an IoT device by sharing “reference designs”. These function as your first proof-of-concept that you could take and deploy in a pilot to see whether your farm will benefit from more data about your crops. The Cellular IoT Soil Moisture Monitor reference design aims to be a proof-of-concept for operations that need far-flung sensors throughout an operation that can report back to the cloud on regular intervals. This is a companion to the Greenhouse Controller reference design, which is another in our series of agricultural use cases.

Hardware

This reference design has some familiar sensors. The APDS-9960 is a light quality sensor (reporting intensity, red, green, and blue levels), and the BME280 is a weather sensor (temperature, humidity, pressure). These were in the Green Demo we showcased at Embedded World in 2022, as well as part of the Greenhouse Reference Design. They continue to be our go-to environmental sensors for a simple reason: their sensors are in-tree. And much like we chose hardware with existing firmware support, we also focus on choosing breakout boards that are in the Mikroelectronica MicroBUS form factor. In this case, that was the Hydro Probe Click, built around the MCP3221 ADC. Because this device uses more than 3 Click sensors, we also utilized the MikroBUS Click Shuttle to extend the available ports. This also moves the Hydro Probe sensor outside the envelope of our normal case design.

Hardware going out into a field in a farm needs to survive harsh operating conditions. So why not use more field-ready hardware? In short, because that isn’t the point of reference designs. We are showcasing starting points for designs, often proofs-of-concept. Once the idea is proven and you see data flowing back to your IT or OT system, your next hardware revision can immediately focus on Design-For-Manufacturing (DFM), cost optimization, and hardening for harsh conditions.

Firmware

As in other reference designs, we wrote the firmware for this design in Zephyr, targeting the nRF9160 SIP from Nordic Semiconductor. With Zephyr projects, it is possible to retarget other microcontrollers, including microcontrollers with different communication mechanisms (Wi-Fi, Thread, Ethernet). Depending on your needs for your deployment, this switchover might make more sense.

In addition to the normal features that Golioth offers out of the box (OTARPCs, data streaming), this demonstration takes full advantage of the Settings Service from Golioth. The reference design captures only raw data reading from the sensor, doing minimal processing on board. This data is sent to the cloud and the operator can push threshold values back down to each device. This helps to customize for different operating conditions and to send back bucketed data that can be used for visualization platforms like Grafana.

Software

Golioth is ultimately the majority of your software stack: we take care of everything once your device communicates over CoAP to our backend servers. From the perspective of the data moving around the Golioth system, we collect the data on LightDB Stream and make it available via the REST API. It can also be exported to third party platforms using Golioth Output Streams.

For this demonstration, we set up a Grafana dashboard that can query the REST API and show recent readings while also charting all of the sensor data over time:

Monitor things that matter to your business

Like our other reference designs, we aim to show the flexibility of the Golioth Platform and how we think it is useful for common real-world applications. Any of the sensors and actions you see in our growing range of reference designs can be applied to your project. The key thing is understanding what you want to measure and react to in the real world. Golioth can help to make the cloud portion of your IoT project a reality. If you have questions about how to get started or want to talk through your next design, reach out to us at DevRel@golioth.io or post on our forum.

Zephyr Project