A cold chain is a temperature-controlled supply chain. It is used to preserve and to extend and ensure the shelf life of products, such as fresh agricultural produce, frozen food, chemicals, and pharmaceutical products.
In the case of pharmaceutical products, it is the role of the cold chain to maintain the potency of vaccines. Thus real-time monitoring of the goods is essential for the quality assurance of goods.
SolutionI have built a system using the Helium developer kit which connects to the Helium Network with the following features:
- Temperature, Humidity, and Pressure monitoring.
- Vehicle tracking. (Location, Speed and Course)
- Sends alerts when the temperature is not in the desired window.
- Door access control.
- Calculates the total idle time of the vehicle and sends an alert if it crosses a threshold.
The security of the logged data is of utmost importance to prove the validity of the chain. Thus I have built my solution upon the Helium devices which are hardware secured to protect the traffic from the 900 MHz spectrum. This means the security is built-in since devices using the network have AES private key encryption at the chip level.
Since this solution is based on LoRaWAN it also provides longer battery life and higher penetrability which could be of use when placing nodes inside the refrigerator trucks which are common in cold chain transport.
The HardwareThe prototype was built using the Helium Developer kit which contains:
- LoRaWAN Development Board - B-L072Z-LRWAN1
- Sensor Expansion Board - X-NUCLEO-IKS01A3
- GNSS Expansion Board - X-NUCLEO-GNSS1A1
Since I am from India and there is no Helium Network coverage here yet, I decided to build my own Helium Hotspot using:
My Github repository has all the instructions to set up your own DIY Helium Hotspot using BalenaOS.
Setting up Alerts from myDevices CayenneGetting started with Cayenne is super easy and it helps us to quickly prototype our project. You can find how to connect your device to myDevices from this Helium documentation page.
I have set up an alert system using myDevices Cayenne to deliver an email if the temperature of the goods is no longer maintained inside a particular temperature window. When the temperature alert flag in my system is set to 1, I will receive an email from the Cayenne system.
Since the asset tracking options in myDevices Cayenne were very limited and lacked customizability, I decided to build my solution using the MAPBOX which is an open-source mapping platform for custom designed maps.
For any Asset tracking application we need four main components:
- Location Updates - Provided by end node via Helium Network.
- Stream Processor - Pipedream
- Database - Google sheets ( Even though google sheets is not truly a database, it has been used here just for the prototype )
- Map - designed using Mapbox
- First, get your device data into your google sheets by following these simple instructions from this project by Evan Diewald.
- Now change the sharing settings of the google sheet to ''Anyone with the link can view''.
- We are going to need the google sheet URL in the following format:
https://docs.google.com/spreadsheets/d/{sheet_ID}/gviz/tq?tqx=out:csv&sheet={sheet_name}
- Replace the {sheet_ID} field with the highlighted part of your google sheet URL as shown in the below example:
- Replace the {sheet_name} field with the name of your sheet which can be found at the bottom of your sheet as shown below:
- Replace the URL with the modified one to connect your sheet to your map.
$(document).ready(function () {
$.ajax({
type: "GET",
//YOUR TURN: Replace with csv export link
url: '<replace with modified google sheet URL>',
dataType: "text",
success: function (csvData) { makeGeoJSON(csvData); }
});
- Create a Mapbox account and copy the account token from the accounts page and insert it into the code as shown below:
mapboxgl.accessToken = '<Replace with the mapbox account token>';
- Finally, add your desired Mapbox style URL which can be found here.
style: "<Replace with a Mapbox style url>",
- Github is an easy way to host a webpage containing our map.
- Create a new Github repository, with a new file named index.html, and insert the map HTML code into it.
- Enable GitHub pages in your repository settings and you can find your webpage URL from the repository.
- It may take some time for your page to be hosted.
That's it! You have a prototype for Cold chain monitoring system. With this as a base project you can modify it to work with various applications such as your own bike tracking device, the possibilities are endless!
- You can view my Map here. Since there is no coverage I could not move around with my device, so I manually added random GPS locations in my google sheets to test my asset tracking feature.
Initially, I started working with SparkFun LoRa Gateway 1-Channel to set up a single channel gateway as they are low-cost devices that can be used to start exploring the LoRa world.
With a miner running on the Raspberry Pi 4 when I try to route the packets to it, the miner shows the following error:
I think this might be due to the format mismatch of the UDP datagrams.
Any help from the community to solve this issue will be appreciated.
I faced many issues as there was no proper documentation for working with Single channel gateways because it is not recommended to work with them as they are not LoRaWAN compliant. So finally I moved to set up my gateway+miner using the RAK2245 and RaspberryPi 4.
NoteUnfortunately, my DIY Hotspot stopped working (which has happened with other community members as well who set up their hotspot on Raspberrypi 4) and I am currently unable to test my door control feature using the downlink messages. I will surely be updating my project logs here, once my hotspot is up and running again.
Comments