When I say "anomaly detection" you may imagine an overly complicated process, something exclusive to deep learning algorithms and indecipherable coding. In reality, the concept of uncovering anomalous behavior in a system is really just the act of identifying an unclassified or uncertain state.

In other Machine Learning projects I've worked on, I've created ML models with different data inputs, and asked them to generate inferences based on the known data provided. But what happens when I ask the model to create an inference about something it doesn't know?

This, in essence, is what I tried to accomplish in this project.

I created an anomaly detection ML model with Edge Impulse that processes thermal images to detect unknown states of thermal readings and relays collected data to the cloud with the Blues Wireless Notecard.

While I built this around my home heating system, this type of solution could be used to monitor virtually any type of heat-producing equipment.

By using the "edge ML" capabilities provided by Edge Impulse, the cellular Notecard device-to-cloud data pump from Blues Wireless, a Raspberry Pi Zero 2, and an Ubidots dashboard, I was able to create a simple, low-power, thermal monitoring station with only a small bit of Python coding required 🐍.

The Problem to Be Solved 🤔

Put simply, any machinery that generates a significant amount of heat is at risk of catastrophic failure. Even home heating systems burn more than an insignificant amount of oil or natural gas daily. The risk of failure may be very low, but if you scale up to an industrial setting, a failure can be devastating.

But today we are going keep the scale down to my hot water boiler system, in which I recently replaced the boiler itself with this fancy beast:

My very own hot water boiler!

What could possibly go wrong with a boiler? As the owner of a 100+ year old house, I'll spare you the details, but needless to say there is a lot of complexity and many pipes going into and out of the boiler that could be monitored. One example "problem" is a water pressure release valve that should never really open:

A pressure relief valve that can go "pop" at any time!

If it does, it's a sign of some internal problem only my HVAC company should tackle. So I set out to build a system that could monitor the thermal readings of most of the pipes you see and warn me if any "hot spots" showed up where they shouldn't.

NOTE: Notice all the copper piping? Copper has an extremely low emissivity rating, making it difficult to read on a thermal camera. Luckily there are enough iron components mixed in to make this project work well enough for my proof-of-concept!

The Puzzle Pieces 🧩

With the problem fairly well understood, it was time to put together the hardware puzzle pieces I needed to make this work.

Within the basement of a 100+ year old house, Wi-Fi access is spotty at best and there aren't nearly enough standard outlets to power any devices without running a lengthy extension cord. Therefore, building a low-power solution using LTE-M cellular was at the top of my list.

I started with the Blues Wireless Notecard, which provides prepaid global cellular access including 500MB of data and 10 years of service. The model I chose works with both LTE-M and NB-IoT protocols, so even with just "one bar" of cell service in my basement, there was enough bandwidth to pump the data I needed to the cloud. It's also an extremely low-power device to the tune of ~8uA when idle.

Next up, I needed a thermal imaging camera. I chose the MLX90640 IR Thermal Camera from Adafruit. It generates a 32x24 resolution thermal image that, while not seeming like much, can provide a reasonably accurate thermal image:

MLX90640 Thermal Camera

Picking a host microcontroller or single-board computer became the next hurdle. And I'll confess, it was highly dictated by the Linux-only example provided by Adafruit for the thermal camera!

I went with a ...

Read more »