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.

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 (OTA, RPCs, 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 [email protected] or post on our forum.

 

 

Power monitoring is a common Internet of Things (IoT) application. Whether it’s to track the health of manufacturing tools (“Do I have a motor bearing about to give out?”) or to provide consumer insight (“Can I save money by running the clothes dryer during off-peak hours?”), gaining granular feedback on your electricity usage is a valuable tool. This concept inspired Golioth’s latest reference design: an AC power monitor that records reading to the Internet.

The AC Power Monitor

With Golioth, it’s quite easy to add IoT power monitoring to any electrical device. We utilize non-contact current clamps that can be added to a machine tool’s power supply, or at the breaker in an electrical box. The current sensor clamps around a wire, detecting the magnetic field generated when current is flowing to the device being monitored. The readings are uploaded to Golioth where they can be visualized and acted upon.

In this application, two channels stream readings back to Golioth where they are stored along with their timestamp. The power monitor tracks “run” time—how long the device being monitored has been running without a break. The system also records the cumulative “run” time so that you can track the service life of your equipment. This data is invaluable in planning maintenance and identifying the most used equipment to inform future investment in your production abilities.

Hardware

Starting from a reference design helps get your proof-of-concept up and running. With that in mind, we like to use off-the-shelf hardware as much as possible.

Power Monitor with two ADCs and an AC current sensor ("current clamp")

Power Monitor with two ADCs and an AC current sensor (“current clamp”)

The full parts list is on our Golioth Projects page, but the key components involved are the Nordic Semiconductor nRF9160 cellular system-in-package (SIP) and a pair of MCP3201 analog-to-digital converters (ADCs) which read signals from the 30A-to-1v AC current sensors.

The cellular modem (nRF9160) is one of our best supported parts on Golioth and is powered from both a local power supply and a lithium battery so that power outages can be remotely detected.

Power Monitor reference design block diagram

Power Monitor reference design block diagram

Firmware

The firmware for the Power Monitor reference design uses the Golioth Settings Service. This service can update a single device’s settings, and also provides fleet-wide control via our web console (and our REST API if you need it).

Golioth Settings Service for the Power Monitor reference design

Golioth Settings Service for the Power Monitor reference design

Here you can see the loop delay which indicates how long the device should sleep between sensor readings (in seconds). There is also an ADC “floor” setting available for each channel. This accommodates equipment that has some current draw when in standby mode, allowing you to configure the threshold at which the machine is consider to be running.

Golioth’s LightDB state system is used to report the live “run” time. It’s one way to monitor if a machine has been left on, or is simply in constant use and may represent a bottleneck in your shop’s workflow. The cumulative “run” time is also reported here, serving as an odometer for the operating life of the equipment.

All of the Golioth reference designs include Over-the-Air (OTA) firmware updates so changes to how the firmware works don’t require an on-site visit.

Cloud Software / Dashboard

The Golioth Zephyr SDK takes care of the cloud connection for all of your devices. When writing firmware, just use the API to set/get/observe your data and Golioth handles the rest:

  • Sensor readings are stored as time-series data on LightDB Stream
  • Device settings are monitored in real-time, with the device reacting to your changes as soon as you make them.
  • The Golioth Console tracks the latest device state, including device health
  • Current firmware version is monitored, with the ability to rollout new OTA updates, and one-click rollback if you need it
  • Golioth’s convenient REST API delivers easy access to the data for visualization or export to any of your favorite cloud server platforms.

We’ve set up a dashboard on Grafana, one of our favorite visualization tools. It queries the Golioth REST API for device data and presents it as a handsome web interface.

Grafana dashboard to visualize data from the Power Monitor reference design

Grafana dashboard to visualize data from the Power Monitor reference design

The dashboard collects both the persistent data stored in LightDB State (live runtime as well as cumulative) and the time-series data stored in LightDB Stream (the periodic sensor readings). We push the ADC readings as raw values and they are converted to Amps for display on the dashboard. You could just as easily display current power consumption which would be about 600 Watts for the toaster oven readings being shown above on Channel 0.

More Golioth Reference Designs

Our reference designs are like a business in a box. Using Golioth as your device management cloud, your first prototype will be running within hours, not weeks. These designs are built to scale, with the same infrastructure in place on day one that you need on the day you deploy your 1000th device.

We’re always working on more reference material for you to take and customize for your business needs. Check out the Industries section of the Golioth website, which discusses areas we are targeting and Reference Designs we are building. If any of them interest you, click the “Schedule Demo” button for the one that best matches your needs. You can also drop a note on our Forum or on our Discord if you have ideas of other IoT prototypes you need help with or would like to see us build.

The Internet of Things (IoT) can make existing infrastructure more useful and easier to operate, with the added benefit that you don’t need to be on-site to make changes. This is the case with Golioth’s latest reference design: a greenhouse controller that adjusts ventilation and grow lighting based on sensor readings. It also provides manual control from the cloud.

Whether it’s too hot or too cold, tightly monitoring and regulating greenhouse temperature has a huge effect on crop yield and growing time. The same can be said for lighting conditions. At this time of year (winter), consider the poinsettia: it requires intense light during the day, and at least 12 hours of total darkness over night in order to turn a vibrant shade of red. Sounds like a great job for an automated controller.

But think beyond one type of plant and one time of year. The agriculture industry uses automated control to implement different growing conditions based on the cultivar. A cloud-connected controller makes it much easier to update (and keep track of) the growth profiles.

The IoT Greenhouse Controller

An IoT Greenhouse Controller continues to show that simply connecting sensors to the internet is impactful. From one online dashboard you can see how the light, temperature, pressure, and humidity is trending across all of your planthouses. For this reference design we added two mains-rated relays to add control to the equation.

The cellular modem sends sensor data back to Golioth, and monitors the cloud for updates in target temperature and light intensity. A threshold setting for light level automatically controls when the grow lights are turned on or off. The same is true for a temperature threshold that is monitored for control of the ventilation system. Of course both of these relays can be controlled manually.

Let’s take a look at the hardware involved in this Reference Design

Hardware

We’re favoring off-the-shelf hardware for ease of implementation. Most of the modules that we use are simple breakout boards that aren’t much more than a sensor or two, some power handling, and interconnects like cabling. The idea is that someone could take this setup and choose which sensors they want to put onto their custom hardware design that will go out in the field.

IoT Greenhouse controller internals

Golioth Greenhouse Controller reference design internals.
Left to right: light sensor, weather sensor, relays

The full parts list is on our Golioth Projects page, but the key components involved are the Nordic Semiconductor nRF9160 cellular system-in-package (SIP), a BME280 weather sensor, an APDS9960 light intensity sensor, and a set of relays.

The nRF9160 was chosen because it is one of our best supported parts on Golioth. A cellular modem may seem like an odd choice for infrastructure-based controllers, but in combination with the lithium battery you will still be able to monitor greenhouse conditions during a power outage. There is no better peace of mind than being able to answer the question: when the power was out, how cold did my plants get and for how long?

As with many Golioth designs, our wide ranging SDK support means you can retarget the same control code to different hardware in the future. If you want to take the reference design and target a Wi-Fi, Ethernet, or Thread solution, it’s a couple of files configured differently and you have similar functionality with a whole new connectivity medium.

Greenhouse Controller block diagram

Firmware

The firmware for the Greenhouse Controller reference design uses the Golioth Settings Service. This is ideal as it facilitates control of a large fleet of these devices, allowing settings to be adjust for all at once, in groups, and of course down to individual units.

Golioth Settings Service for the Greenhouse Controller reference design

Golioth Settings Service for the Greenhouse Controller reference design

Here you can see the loop delay which indicates how long the device should sleep between sensor readings (in seconds). The light and temperature thresholds control the on/off point of the relays, and finally the auto settings indicate if the relays should be switched automatically based on those thresholds. The controller monitors Golioth’s LightDB state system for manual control commands, which do not interfere when the automated option is enabled.

All of the Golioth reference designs include Over-the-Air (OTA) firmware updates so changes to how the firmware works don’t require an on-site visit. While the current firmware doesn’t implement a schedule-based system, the concept is easy to add and install on the device using OTA.

Cloud Software / Dashboard

The Golioth Zephyr SDK takes care of the cloud connection for all of your devices. When writing firmware, just use the API to set/get/observe your data and Golioth handles the rest:

  • Sensor readings are stored as time-series data on LightDB Stream
  • Device settings are monitored in real-time, with the device reacting to your changes as soon as you make them.
  • The Golioth Console tracks the latest device state, including device health
  • Current firmware version is monitored, with the ability to rollout new OTA updates, and one-click roll-back if you need it
  • Golioth’s convenient REST API delivers easy access to the data for visualization or export to any of your favorite cloud server platforms.

We love using Grafana dashboards to visualize IoT data. The dashboard talks to the Golioth REST API to monitor the IoT sensors and the state of the lighting/ventilation. Of course you could use WebSockets to get live updates as the data arrives at the Golioth servers. For this application, it’s likely that sensor readings are being recorded every few minutes so a dashboard that reloads on its own works well.

Golioth Greenhouse Controller Grafana dashboard

More Golioth Reference Designs

Our reference designs are meant to get you through the initial steps of proving out your IoT-based business. You can buy the readily-available parts used for this Greenhouse controller and with our reference design resources you’ll be on your way to a proof of concept in days instead of weeks. This means you’re fleshing out features and heading toward a hardware prototype with actual performance data. Golioth is designed to scale, so the same connections and features that you use for your first prototype remain in place, with a platform that can handle a number of devices beyond your wildest imagination.

We are busy building out more reference material for you to take and customize for your business needs. We recently launched an Industries section of the Golioth website, which lays out some of the other areas we are targeting and Reference Designs we are building. If any of them interest you, click the “Schedule Demo” button for the one that best matches your needs. You can also drop a note on our Forum or on our Discord if you have ideas of other IoT prototypes you need help with or would like to see us build.

 

Internet of Things (IoT) devices are successful when they cut down on work. This almost always results in monetary savings for the companies or groups deploying the IoT solution. Since I am a fan of industrial uses of IoT over other (consumer) use cases, I often say that the value of IoT devices is not in making money, but in saving money. It’s easy to draw a straight line from the struggles of putting devices into the world, to saving money on things like maintenance, downtime, loss of property, fuel costs, and more.

Our first Reference Design (more on what those are later) is an internet connected trash can. This allows a municipality or organization like the US National Parks to save money on sending around trash trucks to empty bins. Given the additional features of this Reference Design, they could also set alerts when there is a situation that needs more immediate attention.

The IoT Trashcan Monitor

First off, why an IoT Trashcan Monitor? That question is easy: we had multiple people asking us about this type of solution, so we decided to build it! Aside from that, I think this solution is representative of a wider class of IoT device designs: simple sensors connected back to the network, sending data once or twice a day. The fact that we used cellular connectivity also untethers it from local networks like Wi-Fi requires. This is an entire category of IoT, needing to do occasional readings from far afield. I could easily take the design you’ll see here and either:

  • Reuse the sensor for a different distance measuring purpose or
  • Swap out the sensor

In both cases, I would be taking the scaffolding of this Reference Design, but then turning it into an entirely different product. We include a range-finder sensor used to detect the height of trash in a bin. That can be reused for things like liquid level sensing, human detection, proximity alarms, and more. Switching out the main range-finder sensor for something like a PIR sensor allows very similar firmware and cloud software to be deployed as an entirely new application.

Let’s take a look at what’s involved in this Reference Design

Hardware

For most Reference Designs we do, we’re favoring off-the-shelf hardware for ease of implementation. However, most of the modules that we use are simple breakout boards that aren’t much more than a sensor or two, some power handling, and interconnects like cabling. The idea is that someone could take this setup and choose which sensors they want to put onto their custom hardware design that will go out in the field.

The full parts list is on our Golioth Projects page, but the key components involved are the Nordic Semiconductor nRF9160 and the ST VL53L0X. The former was chosen because it is one of our best supported parts on Golioth, in addition to being a Cellular + GPS solution (required if we’re in the middle of a national park). The latter was chosen to target a range application, but also because the driver for this particular sensor was already in Zephyr. This sped up the development time considerably.

Trashcan Block Diagram

Firmware

Because the design is using off-the-shelf hardware, the majority of effort on this project went into the firmware. Built on top of the Golioth Zephyr SDK, most of the work involved setting up timers and work queues to kick off work on different triggers; once triggered, all of the sensors were read, processed, and then finally sent back to the Golioth cloud. Like all Golioth Reference Designs, this includes Over-The-Air firmware updates from Day 1. Most IoT designs think of this as an afterthought, but we want people using these designs to be certain they can update devices as soon as they are deployed.

This design also takes advantage of the new Golioth Settings Service. In this Reference Design, we’re using it to calibrate trashcan levels based on the detected height of garbage. Like all fleets using the settings service, these settings can be applied at the project level (all devices), at the Blueprint level (usually separated out by hardware revisions or similar), or on an individual level. In the screenshot below, you can see that I’m using the “SENSOR_READING_LOOP_S” to change the reporting frequency for only the shown device, because I wanted it to report every 10 seconds. I have the default set to 600 seconds (10 minute interval, also still pretty low!), because this information isn’t super time sensitive.

Cloud Software / Dashboard

Finally on the Cloud side of things, there is the Golioth aspect. Since the Reference Design is using the Golioth SDK in Zephyr, everything is taken care of by default Golioth features on the Cloud:

  • Capturing the time-series based data on LightDB Stream
  • Handling the Settings service described above
  • Tracking latest device state, including device health
  • Managing OTA rollout, when a new image is available
  • Giving a convenient REST API to access all of the device data from other Cloud applications

For visualizing this data, we created a Grafana dashboard that talks to the Golioth REST API on a regular interval. While we could have also used WebSockets to get live updates, we don’t expect a trashcan to need to update more than a couple of times per day.

Let’s take a step back and talk a bit more about Reference Designs in a broader sense.

What is a Reference Design?

Our first concept for a Reference Design was called a “Business In a Box”. Someone utilizing a Golioth Reference Design would be well on their way towards a fully formed IoT-based business. This benefits two parties:

  • People who have a business problem similar to what we’re showcasing
  • Engineers who want to see an example of an end-to-end IoT solution

Reference Designs are still relatively early in the Product Lifecycle. They are the equivalent of having an in-house design team build out a v1 prototype to validate an idea and see data streaming back from the field. Someone utilizing a Reference Design likely would want to take the data package to a Development Shop and have them harden the design for the constraints of the real-world application. In the case of the IoT trashcan monitor, they would want to:

  • Customize the hardware for manufacturing and form factor
  • Make sure the hardware could stand up to the elements (waterproof)
  • Get the necessary certifications (PTCRB, FCC part 15B, etc)
  • Work with a manufacturing partner to start building to scale
  • Review the firmware solution for long term maintenance
  • Create a custom app or web portal to view data (or develop one using low code visualization tools)
  • Add any other required features on the hardware, firmware, and cloud side

Golioth helps along the way and has design and manufacturing partners we are happy to help introduce you to.

More Reference Designs

We are busy building out more reference material for you to take and customize for your business needs. We recently launched an Industries section of the Golioth website, which lays out some of the other areas we are targeting and Reference Designs we are building. If any of them interest you, click the “Schedule Demo” button for the one that best matches your needs. You can also drop a note on our Forum or on our Discord if you have ideas of other IoT prototypes you need help with or would like to see us build.