#JulyOT 12: AI-powered predictive maintenance with Azure Sphere
Tags: julyot, iot, tinyml, embedded
Published: 2022-07-12 01:28:55

---
title: #JulyOT 12: AI-powered predictive maintenance with Azure Sphere
published: true
date: 2022-07-12 00:00:00 UTC
tags: julyot,iot,tinyml,embedded
canonical_url: https://JulyOT.dev/blog/julyot-day12-embedded
series: JulyOT 2022
cover_image: https://JulyOT.dev/assets/images/JulyOT-banner-12-sphere-46fc5508921d10464ad58a548ae816f4.png
---

_HVAC ([Heating, ventilation, and air conditioning](https://en.wikipedia.org/wiki/Heating,_ventilation,_and_air_conditioning)) units regulate our home and workplace environments. HVAC systems are ideal candidates for predictive maintenance, as they require regular costly maintenance._

![HVAC System](https://upload.wikimedia.org/wikipedia/commons/9/90/Rooftop_Packaged_Units.JPG)

## Watch the 10-minute end-to-end demonstration[​](#watch-the-10-minute-end-to-end-demonstration "Direct link to heading")

[![The image is the youtube thumbnail for the intro video](https://JulyOT.dev/assets/images/predictive_maintenace_youtube-c8937fb2e6f510a20c5ce289e9a03534.png)](https://youtu.be/62XKxzRld28)

## Machine Learning on Embedded Hardware[​](#machine-learning-on-embedded-hardware "Direct link to heading")

AI-powered predictive maintenance can help identify a faulty machine before a real problem occurs, reducing maintenance costs, improving availability and customer satisfaction. The advantages of predictive maintenance include:

- Reduced carbon footprint. Keeping equipment running well has straightforward benefits for operating efficiency, but we should also ensure our processes are efficient. Fault monitoring can generate high volumes of low-value data. Sending this data to cloud systems consumes power and network resources. Running an ML model on embedded hardware consumes less electricity and network resources. Only predicted maintenance events get sent to the backend systems. Disabling network interfaces (for example, Wi-Fi) can further reduce power consumption until a high-value predictive maintenance event occurs.
- Access to better data for faster fault resolution.
- Low latency response to system faults. There are fault monitoring use cases that require immediate action to shut down a system. Sending fault monitoring data to cloud systems for processing might be too slow, further damaging the machine.

## Predictive Maintenance on Azure Sphere[​](#predictive-maintenance-on-azure-sphere "Direct link to heading")

![Image shows the Machine Learning Predictive Maintenance rig](https://JulyOT.dev/assets/images/ml_predictive_maintenance_rig-a8b6ce69b9912cabece6c92450edadf7.jpeg)

[Azure Sphere](https://azure.microsoft.com/services/azure-sphere) is a secure embedded platform that is ideal for quickly developing an IoT system. By providing a platform meeting all [7 properties of highly secured devices](https://www.microsoft.com/research/wp-content/uploads/2017/03/SevenPropertiesofHighlySecureDevices.pdf?wt.mc_id=eventspg_16482_webpage_reactor), Azure Sphere eliminates the need to be a hardware, OS, and security expert. These seven properties make Azure Sphere ideal for running and updating ML models. You don’t want to solve one problem (equipment operation) and introduce a larger one (security).

You can deploy up to 3 custom apps on Azure Sphere, including two ML workloads on the low-power real-time cores. The predictive maintenance solution runs a continuous movement classification TinyML model on one of the Azure Sphere real-time cores. When the TinyML model detects movement, for example, a rattle, or a faulty motor bearing, an event is sent to the predictive maintenance app running on the high-level core. The predictive maintenance app then powers up the network connection and sends the event to Azure IoT Central. Azure IoT Central exports the predictive maintenance event to a Logic App, which generates a message destined for Microsoft Teams.

The beauty of this solution is that you are combining building blocks. You don’t need to be a security expert, Azure Sphere has got you covered, Edge Impulse simplifies model development, and IoT Central, Logic Apps, and Microsoft Teams are low code offerings making it easier to pull everything together.

![This image shows the predictive maintenance solution architecture](https://JulyOT.dev/assets/images/predictive_maintenance_solution_architecture-f4269f5f2582ac3edff15439b8ffaa68.png)

## Building the TinyML model[​](#building-the-tinyml-model "Direct link to heading")

The TinyML (TensorFlow Lite) model was built with [Edge Impulse](https://www.edgeimpulse.com/). Edge Impulse simplifies building machine learning models for embedded hardware such as Azure Sphere. The cloud service is designed for developers, so you don’t need to be a data science guru. There are tools for ML training data acquisition, and wizards lead you through the process of training, testing, and exporting models. Learn more about Edge Impulse on their [getting started](https://docs.edgeimpulse.com/docs) page.

## Get Started[​](#get-started "Direct link to heading")

Head to the [AI-powered Predictive Maintenance](https://github.com/gloveboxes/AzureSphereMLPredictiveMaintenanceEW) repo to get started.