Blog post

A Cool Package Monitor

Projects
By Nick Bild
A Cool Package Monitor

When we hand over a package to a courier service, we expect a safe transit of that package to take place, in accordance with some prearranged terms. When that package contains sensitive items, like certain vaccines, biological samples, or perishable foods, it is critical that a particular level of refrigeration be maintained continuously throughout the entire delivery process. Items such as these can be rendered ineffective or spoiled by excessive temperatures, but we have no insight into what actually occurs during shipping, so we do not have a simple way of determining if this has happened. These ruined products can lead to serious consequences, including illness and death, if they are not identified.

Engineer Manivannan S. has developed a simple device that can be shipped along with sensitive items to monitor conditions and provide a warning if the package was not handled as agreed upon. His solution uses a low-power microcontroller and Edge Impulse to determine if a number of common shipping-related problems have occurred — excessive heat exposure, direct sunlight exposure, or sudden shock.

Solution architecture 

The hardware for this build is a ​​Nordic Semiconductor Thingy:91 development board. If you are not familiar with this board, you may be surprised to find that this is the only hardware needed. That is because the Thingy:91 is an all-in-one solution, with a 64 MHz Arm Cortex-M4 CPU, 1 MB of flash memory and 256 KB of RAM, and a slew of sensors, including temperature, humidity, color and light. The board also comes with an accelerometer and a rechargeable Li-Po battery, making it fully self-contained. It is also capable of keeping in contact while on the go with an onboard cellular modem.

To turn the Thingy:91 into a cold chain monitoring device, Manivannan first flashed it with firmware that enabled it to interface directly with Edge Impulse. With that connection in place, he built a vaccine shipping container and installed the development board inside.  While simulating various conditions with ice packs, sun exposure, and drop tests, data from the sensors (accelerometer, humidity, temperature, and infrared) was collected and sent directly to Edge Impulse, where it would serve as training and test data for a machine learning model.

Collecting a training dataset

With several sensors providing the inputs to the model, data preprocessing was more complex than it typically would be. Manivannan was able to cut through this difficulty by selecting three different preprocessing blocks (spectral, flatten, and raw), and assigning each sensor data source to the appropriate block. A neural network classifier was added as the next step in the impulse to determine if any exceptional circumstances were involved during shipment of the package.

The model was trained on the data that Manivannan had previously uploaded. After training had completed, a validation step revealed that classification accuracy had reached a very impressive 94.5%. After deploying this model to the Thingy:91, it will continually monitor for any problems, and should anything occur, an MQTT message will be sent via a cellular network to provide the shipper with real-time alerts.

Validating the ML model in Edge Impulse

Head over to Manivannan’s project write-up for all the information you need to build your own cold chain monitoring device.


Want to see Edge Impulse in action? Schedule a demo today.

Comments

Subscribe

Are you interested in bringing machine learning intelligence to your devices? We're happy to help.

Subscribe to our newsletter