Make Any Sensor a Smart Sensor with PICMG IoT.1, Part 3: How Do I Create Smart Sensor Firmware?

By Brandon Lewis

Editor-in-Chief

Embedded Computing Design

By David Sandy

Technical Writing Consultant

PICMG

February 02, 2022

Story

Make Any Sensor a Smart Sensor with PICMG IoT.1, Part 3: How Do I Create Smart Sensor Firmware?

PICMG IoT.1-compliant smart sensors run on a configured data model. In Part 3, we take a look at the process of configuring the smart sensor firmware using a sample configuration tool provided by PICMG.

(Editor's Note: For a specific part of the series, click below:

Part 1: What Makes a Sensor Smart?

Part 2: What is a Data Model and How Does it Apply to PICMG IoT.1?

Part 4: VIDEO DEMO: What is A Builder, and How Do I Get Started?)

Now that we have a more complete understanding of the PICMG IoT.1 data model and why it’s important, it’s time to start configuring the firmware. Usually this would require some amount of programming in languages like C, but PICMG has developed an open-source reference tool for users of the IoT.1 specification that abstracts this complexity and makes the process of developing compliant firmware as simple as filling out a few text boxes.

But first, why is configuring the firmware so important if we’re running it through a data model?

Whereas the data model is a template of what data is needed and how it is represented, the firmware is the implementation of the device that is represented by the data model. In other words, the firmware implements the behaviors of the sensor and contains all of the information about the sensor that the system needs to recognize it as a smart sensor. 

Without properly configured firmware, the system has no way of telling that a sensor even connected in the first place and the sensor has no way of interacting properly with the system.

Automating Firmware Build & Configuration in PICMG IoT.1

While a developer could write IoT.1-compliant firmware in C that defines all the specific behaviors required by the data model, writing firmware for multiple sensors can be tedious for engineers and impossible for non-programmers to do at all.

To make this process simpler, PICMG developed a sample tool called “The Builder” that generates C-based firmware from user-provided JSON files and installs it onto the target logic device. 

[Editor’s Note: The Builder is addressed in more detail in Part 4. It is not part of the PICMG IoT.1 specification. More information is available on Github, where the Builder can also be downloaded for free: https://github.com/PICMG/iot_builder.]

The Builder makes the task of writing firmware easier, as there is no longer a need to create C code. However, the user still has to provide a JSON file, which is much more straightforward than writing C code but can still be confusing and tedious. Enter the final piece of sample software provided by PICMG: “The Configurator”. 

The Configurator tool enables simple firmware configuration within a graphical user interface, which makes it easy to manipulate data even for those without any programming experience. After the necessary data is input, the Configurator exports a JSON file the Builder can use to generate firmware.

[Editor’s Note: More information is available on Github, where the Configurator can also be downloaded for free: https://github.com/PICMG/iot_configurator.]

Configuration at Scale

Besides abstracting away the more tedious technical aspects of developing smart sensor firmware, the Configurator allows professional technologists to compile large libraries of configured sensors for mass deployment. This means that a factory that manufactures or uses sensors can easily transform large numbers of them into smart sensors automatically. 

The Configurator makes this level of automation possible, for example, by recognizing and presenting the user with the different sensors that support a specific channel in a given sensor library. All the user has to do is choose a logical control system (such as PID or PIV) and select one of the supported sensors.

This process is all that’s needed to create a JSON file that defines our smart sensor. From here, a closer look at the Builder that will convert that JSON into system-readable C firmware is warranted.

Click here for Part 4: What is A Builder, and How Do I Get Started?

Brandon is responsible for guiding content strategy, editorial direction, and community engagement across the Embedded Computing Design ecosystem. A 10-year veteran of the electronics media industry, he enjoys covering topics ranging from development kits to cybersecurity and tech business models. Brandon received a BA in English Literature from Arizona State University, where he graduated cum laude. He can be reached at [email protected]

More from Brandon

David has been instrumental in developing the open source Configurator as part of the PICMG IoT effort. He has been involved with PICMG since 2020 as both an intern and a technical writer. David is currently pursuing his Bachelor’s of Science in Software Engineering at Arizona State University.

More from David

Categories
Open Source
Tech News Roundup
MORE