Project Demo
Intro
Thousands of people die each year in fires in both residential and commercial settings. Offices, warehouses, industrial, and manufacturing plants account for well over 1,000 fire-related injuries in the US annually. First responders work hard to rescue individuals that are either trapped in or incapacitated by a building fire, but without knowing where to look, they may not find them in time. Smart Smoke Alarm attempts to solve this problem by providing firefighters with precise information about the locations of persons trapped inside a burning building. This device uses a thermal camera and a machine learning classifier to identify people in the event that the smoke detector is tripped. By using thermal imaging, it is possible to recognize people in the dark and through smoke. Location information is wirelessly transmitted to a remote server where it could be viewed by first responders on the scene to help them focus their efforts.
Hardware Requirements
- 1 x Adafruit MLX90640 24x32 IR Thermal Camera (110 Degree FoV)
- 1 x Adafruit Feather M4 Express
- 1 x Arduino Nano 33 IoT
- 1 x 350 mAh or greater LiPo battery
- 1 x Piezo buzzer
- 1 x Push button
- 1 x 10K ohm resistor
- 1 x 3D printed case (optional)
Software Requirements
- Edge Impulse Studio
- Arduino IDE
How It Works
There are two development boards — an Arduino Nano 33 IoT and an Adafruit Feather M4 Express. The Feather M4 Express handles capturing measurements from the thermal camera and provides the processing power to run the machine learning algorithm that was developed with Edge Impulse. The Nano 33 IoT provides WiFi for wireless communications, and also serves as a simulated smoke detector.

Data Preparation
An Arduino sketch was created to capture thermal images to train the neural network. I captured measurements for two classes — person and empty room. For the person class, I took many images of myself standing, sitting, walking, and otherwise moving about the room. The empty room class is self-explanatory. In total, I collected 189 ‘person’ images, and 130 ‘empty’ images. These measurements were processed with a simple Python script that formatted the data as CSV files, then they were uploaded to my Edge Impulse project using the data acquisition tool.





Building the ML Model
Building the model turned out to be the simplest part of the entire project. I created a new impulse that forwards the raw thermal image data into a neural network classification block. I kept the default model design and hyperparameters and clicked the “Start training” button. Surprisingly, the classification accuracy was reported as being at 100% right off the bat.

Deploying the Model
Edge Impulse offers many options for deployment, but in my case the best option was the “Arduino library” download. This packaged up the entire classification pipeline as a compressed archive that I could import into Arduino IDE, then modify as needed to add my own logic (like to communicate with the Nano 33 IoT to send messages over WiFi, for example). That sketch can be found here. And the sketch that runs the simulated smoke detector on the Nano 33 IoT can be found here.
