• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Microcontroller Tips

Microcontroller engineering resources, new microcontroller products and electronics engineering news

  • Products
    • 8-bit
    • 16-bit
    • 32-bit
    • 64-bit
  • Applications
    • 5G
    • Automotive
    • Connectivity
    • Consumer Electronics
    • EV Engineering
    • Industrial
    • IoT
    • Medical
    • Security
    • Telecommunications
    • Wearables
    • Wireless
  • Learn
    • eBooks / Tech Tips
    • EE Training Days
    • FAQs
    • Learning Center
    • Tech Toolboxes
    • Webinars/Digital Events
  • Resources
    • Design Guide Library
    • DesignFast
    • LEAP Awards
    • Podcasts
    • White Papers
  • Videos
    • EE Videos & Interviews
    • Teardown Videos
  • EE Forums
    • EDABoard.com
    • Electro-Tech-Online.com
  • Engineering Training Days
  • Advertise
  • Subscribe

How is Zephyr used for edge AI and sensors?

May 29, 2024 By Jeff Shepard Leave a Comment

Zephyr is a scalable open-source real-time operating system (RTOS) hosted by the Internet of Things (IoT) and embedded technology section of the Linux Foundation. Its modular architecture makes it highly flexible and suitable for resource-constrained edge devices and sensors.

This article reviews Zephyr’s structure and features, examines how Zephyr supports neural networks, and discusses how Tiny Machine Learning (TinyML) and TensorFlow Lite Micro (TFLite Micro) combine to support ML on Zephyr. It concludes with an example of how Zephyr supports flexible edge connectivity.

Zephyr’s modularity enables scalability and performance optimization. Some key features include the following as shown in Figure 1:

  • Comprehensive, lightweight kernel
  • Integrated device drivers
  • Supports preemptive and cooperative threading
  • Memory protection includes stack overflow protection, kernel object and device driver permission tracking, and thread isolation.
  • Numerous connectivity options, including:
    • Bluetooth 5.0 and Bluetooth Low Energy (with both controller and host, BLE Mesh
    • Constrained application protocol (CoAP), light weight machine-to-machine (LwM2M), and message queuing telemetry transport (MQTT) IoT protocols
    • USB & USB-C
    • Wi-Fi, Ethernet, and CAN bus
Zephyr
Figure 1. Block diagram of the Zephyr full-featured RTOS. (Image: NXP)

Zephyr and neural nets

Neural networks can be highly useful in edge sensor applications, especially when handling noisy and unstructured data from accelerometers, biometric sensors, and cameras. Open-source frameworks specifically for supporting this class of applications have been developed to run Zephyr on computationally limited devices with minimal available memory. These frameworks can support optimization algorithms and neural compilers.

A unified application programming interface (API) has been developed for neural network inference frameworks on Zephyr. It includes methods for loading the models, entering inputs, running the inference engine, and capturing the results. It enables designers to select the inference engine that best matches the application requirements without significant changes to the application code.

For example, a hearing aid including an integrated deep neural network (DNN) has been implemented using Zephyr. The DNN was trained using 12 million sounds to enable the hearing aid to process audio inputs and provide an output optimized to support how the brain processes sound.

Hearing aids are highly resource-constrained devices that demand minimal power consumption, small code size, and, in this case, provide a significant amount of processing power. A custom chipset based on Zephyr was developed that can run always-on digital signal processing (DSP) algorithms. Several high-efficiency processing cores are included in the system. In addition to audio processing, they manage real-time and continuous wireless connectivity between the left and right hearing aids. The devices can run on a single button cell battery for an entire day.

TinyML and Zephyr

TinyML and TFLite Micro are powerful tools that enable ML algorithms to be run on resource-constrained devices like IoT sensor nodes. This can be especially important for real-time control applications that demand rapid processing and quick decision-making, where latencies associated with cloud connectivity cannot be tolerated.

TFLite Micro is an interpreter specifically designed to run algorithms like TinyML on resource-constrained platforms. A TFLite Micro module has been developed on the Zephyr RTOS, enabling designers to incorporate ML into low-power edge sensors and other embedded applications.

Zephyr and edge connectivity

Connectivity is an important consideration for many edge AI devices like IoT sensors. The Zephyr open-source BLE stack can support a variety of RF architectures. The controller link layer has been split into a common Upper Link generic for all implementations and a Lower Link Layer enabling developers to customize drivers for proprietary RF baseband devices, as outlined below in Figure 2.

Zephyr
Figure 2. Structure of the Zephyr BLE stack. (Image: Zephyr Project)

In addition, the Zephyr BLE stack can support complex use cases like stereo hearing aids or wireless headsets connected to mobile phones, televisions, and other devices. Continuous audio streaming has strict timing requirements and needs to support relatively high data rates for long periods while maintaining synchronization between wirelessly connected stereo speakers.

Summary

Zephyr is a highly capable, modular, and scalable open-source RTOS. As shown, it can support DNNs for handling noisy and unstructured data on IoT nodes and sensors, run TinyML on those same devices and embedded systems, and provide customized BLE edge connectivity.

References

Scalable edge AI benchmarking and optimization with Zephyr runtime for Kenning, Antmicro
Supercharge your Edge AI with Zephyr and TFLite Micro, Toolify.ai
What Is Zephyr?, Wind River
Zephyr on a Hearing Aid: Oticon More, Zephyr Project
Zephyr OS for Edge Connected Devices, NXP

You may also like:


  • How do AI and ML enhance SASE security?

  • How is HIL testing used for onboard EV chargers?

  • How does a recurrent neural network (RNN) remember?

  • EE Training Day: ADAS domain controllers and transition to central…

  • What’s the difference between GPUs and TPUs for AI processing?

Filed Under: Artificial intelligence, FAQ, Featured, Sensor modules Tagged With: FAQ

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Featured Contributions

Five challenges for developing next-generation ADAS and autonomous vehicles

Securing IoT devices against quantum computing risks

RISC-V implementation strategies for certification of safety-critical systems

What’s new with Matter: how Matter 1.4 is reshaping interoperability and energy management

Edge AI: Revolutionizing real-time data processing and automation

More Featured Contributions

EE TECH TOOLBOX

“ee
Tech Toolbox: 5G Technology
This Tech Toolbox covers the basics of 5G technology plus a story about how engineers designed and built a prototype DSL router mostly from old cellphone parts. Download this first 5G/wired/wireless communications Tech Toolbox to learn more!

EE Learning Center

EE Learning Center

EE ENGINEERING TRAINING DAYS

engineering
“bills
“microcontroller
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

DesignFast

Design Fast Logo
Component Selection Made Simple.

Try it Today
design fast globle

Footer

Microcontroller Tips

EE World Online Network

  • 5G Technology World
  • EE World Online
  • Engineers Garage
  • Analog IC Tips
  • Battery Power Tips
  • Connector Tips
  • DesignFast
  • EDA Board Forums
  • Electro Tech Online Forums
  • EV Engineering
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips

Microcontroller Tips

  • Subscribe to our newsletter
  • Advertise with us
  • Contact us
  • About us

Copyright © 2025 · WTWH Media LLC and its licensors. All rights reserved.
The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media.

Privacy Policy