Cold Chain Monitoring Using Nordic Thingy : 91

About the project

A TinyML model using Edge Impulse will predict the status of cold chain like Over heat, Sun Light exposure etc. throughout the transport.

Project info

Difficulty: Moderate

Platforms: Edge ImpulseNordic Semiconductor

Estimated time: 4 weeks

License: MIT license (MIT)

Items used in this project

Hardware components

Nordic Semiconductor Thingy:91 Multi-sensor cellular IoT Prototyping Platform Nordic Semiconductor Thingy:91 Multi-sensor cellular IoT Prototyping Platform x 1

Software apps and online services

Vaccine box Vaccine box
Nordic Semiconductor nRF Connect SDK Nordic Semiconductor nRF Connect SDK
Edge Impulse Studio Edge Impulse Studio

Story

Before the detailed documentation, I have attached my project: Cold Chain Monitoringdemo and its feature in below YouTube link, Kindly watch it.


Challenges in Cold Chain Monitoring:

  • Heat Exposure
  • Direct Sun Light Exposure
  • Damage to the shipment due to Sudden shock / fallen down

Technology contribution to solve these challenges using Edge Impulse and Nordic Thingy : 91
  • The TinyML model using Nordic Thingy : 91 will predict the status of Cold Storages and classifies into Normal, Over heated, Sudden Shock and Direct Sun Light exposure.

Architecture:

The complete architecture is mentioned below :

Architecture

Architecture

Architecture

Nordic Thingy : 91:

  • Battery-operated prototyping platform for the nRF9160 SiP
  • Certifications: FCC (USA), CE (EUR)
  • nRF52840 board controller
  • LTE-M/NB-IoT/GNSS, Bluetooth LE and NFC antennas
  • User-programmable button and RGB LEDs
  • Environmental sensor for temperature, humidity, air quality and air pressure, plus a color and light sensor
  • Low-power accelerometer and high-g accelerometer
  • 4 x N-MOS transistors for external DC motors or LEDs
  • Rechargeable Li-Po battery with 1350 mAh capacity

Nordic Thingy : 91 Product Info

The Prototype development involves following steps:

  • Firmware update (Connect to Edge Impulse)
  • Data Acquisition
  • Model Training in Edge Impulse
  • Result

Let's build the Cold chain Prototype:

1. Firmware Update in Nordic Thingy : 91

Initially the Nordic Thingy :91 will not come up with the firmware supported by Edge Impulse. we need to update the firmware from Edge Impulse.

Step 1.1 ) Download the firmware.hex file from below link.

Firmware

Install nRF Connect and then follow below steps:

  • Open nRF Connect for Desktop and launch the Programmer application.
  • Then Switch off the Nordic Thingy:91.
  • Press the multi-function button (SW3) while switching SW1 to the ON position.

  • Select the option" Select Device" and choose Nordic
  • Add the hex file ( firmware.hex)
  • And then initiate the write option. ( Make sure EnableMCUboot is Enabled)

Once it is flashed, switch off and ON the device.

Connect to Edge Impulse:

If you're a new user, create an edge Impulse account. And create new project.

Open the command prompt and run the below command:

edge-impulse-daemon

And then it asks to choose the terminal, in my device I have connected Serial Port 8. It may varies.

Refer this link for detailed steps:

Detailed Steps

Data Acquisition:

Once the device is connected to Edge Impulse. Next step is data acquisition. Before proceeding with data acquisition, I have developed a Mini Vaccine Box where I have attached the Nordic Thingy : 91.

Normal:

For normal condition, I have kept ICE packs and data captured under low temperature.

Direct Sun Light :

For a Direct sun light condition, I have kept the prototype under direct sunlight exposure.

Sudden Shock :

In some cases, The items in cold chain may be sensitive to more vibrations and sudden fall. So I have trained a model by manually applying sudden fall and vibrations.

Over Heated Condition:

In most cases, The cold chain needs to be maintained in certain temperatures, I have kept the prototype in hot conditions without ice pack to simulate the over heat conditions.

The Data acquisition under different scenarios is explained in the demo video. Kindly refer for more details.

Model Training

Here comes the tricky part, In this project, The nature of data is totally contrast to each other. We have captured Accelerometer, Humidity, Temperature and Infrared as an Input for the model. But Preprocessing will varies for Accelerometer data and Temp, Humidity and Infrared data.

I have selected three processing blocks ( Spectral, Flatten, Raw).

For a Preprocessing, The inputs will be :

1 / 3Pre Processing

Pre Processing

Pre Processing

For a Spectral features, The inputs will be only accelerometer data and

For Raw, the Input will be only temperature.

In create Impulse Section, the configurations shall look like this.

Neural Network Settings:

To train a model, Configure the neural network as below:

Result:

The outcome will be 94.5%.

For MQTT Demo:

For MQTT demo, follow the steps mentioned in the GitHub link.

MQTT Demo

Unfortunately, The iBasis Sim doesn't support network coverage in India, I couldn't able to show the demo.

Credits

Photo of Mani_maker93

Mani_maker93

Engineer by profession , solving real world problems by passion

   

Leave your feedback...