Develop an IoT asset tracking app using Blockchain  

Use an IoT asset tracking device to improve a supply chain by using Blockchain, IoT devices, and Node-RED

Last updated | By John Walicki


This pattern addresses the very real problem of the safe delivery of perishable goods (food, medicine, livestock, etc.) that are sensitive to environmental conditions during shipment. Every shipment of perishable goods has thresholds (refrigeration requirements, avoidance of shocks or vibration, etc. ) to protect the goods from contamination or damage. If the shipment exceeds these thresholds, the goods are damaged and might become a health hazard. By recording the details (Where, What, and When) of a shipment that experienced extreme conditions (thresholds specified in the smart contract) developers can verify that the goods were delivered successfully (or not). Then, payment is predicated on successful delivery. Tracking the conditions of the shipment across multiple participants using a blockchain provides verification and trust in these processes. This IBM Code pattern provides an exemplar solution of IoT Asset Tracking via a Blockchain.


You can use this code pattern to track environmental conditions for a food safety supply chain, refrigerated medical supplies, garden plant shipments, or any perishable shipment that are sensitive to the temperature, humidity, vibration, or time. If a cargo needs to be delivered within safe environmental parameters and a safe amount of time, it is extremely valuable to use an IoT Asset Tracking device that combines environmental sensors, calculates its location via GPS, triangulation, or beacons, and then reports its location via Cellular, 5G, Sub1GHz, SigFox, or WiFi networks. When multiple participants, such as farms, manufacturers, processing plants, trucks, ports, ships, distribution centers, consumer retail outlets, are involved in the safe shipment and payment of the cargo, a Hyperledger blockchain can be used to record immutable transactions as the shipment progresses through its delivery journey.


  1. In the Node-RED Control Panel Dashboard, select the Asset Tracker device, and turn on geolocation reporting and make a call to
  2. calls the Asset Tracker device over the cellular network to activate it.
  3. Geolocation data is transmitted periodically (interval is set in the Node-RED Control Panel dashboard) to
  4. calls the Google Geolocation Triangulation service and turns cell tower identifier & signal strengths into geolocation latitude/longitude info.
  5. transmits the latitude/longitude coordinates back down to the Asset Tracker device.
  6. The Asset Tracker device queries the temperature data and then queries the vibration data.
  7. The Asset Tracker device sends all of the collected sensor data to
  8. Node-RED listens for the temperature and vibration data that is arriving at
  9. Node-RED writes the temperature and vibration data to the Hyperledger Fabric Transaction History.
  10. The Node-RED Dashboard queries the Blockchain Hyperledger Fabric for transaction histories and plots the latitude/longitude, time, and sensor data on a map.


Find the detailed steps for this pattern in the README. The steps will show you how to:
  1. Configure the hardware:
    1. Configure the Particle Electron Asset Tracker board
    2. Set up the Particle Electron toolchain
    3. Set up the Watson IoT Asset Tracker program
  2. Implement IBM Blockchain technologies:
    1. Build a basic IBM Blockchain Hyperledger network
    2. Implement a perishable business network
  3. Create an IoT app to visualize and analyze the IoT data
    1. Create an IoT starter app in IBM Cloud
    2. Open Node-RED and install additional nodes
    3. Import a pre-build flow
    4. Initialize the flow
    5. Control and receive events from
    6. Write events to the perishable business network blockchain
    7. Load blockchain transaction history
    8. Build the asset tracking dashboard

Related Blogs

Two “edgy” AI TensorFlow models for you!

The global Call for Code is well underway, we want to share some visual recognition models which could help you. These AI models can operate on the edge, which could be particularly useful for this years’ theme: disaster preparedness. How could visual recognition help in relief work? From satellite and drone imagery analysis, to classifying...

Continue reading Two “edgy” AI TensorFlow models for you!

Leveraging the power of AI at Unite Berlin

Last week, from June 19 – 21, we were at Unity’s premiere in Berlin: Unite 2018. This conference brought together Unity’s video game and development community. Unity touches 770 million gamers all over the world and is the market leader for consumer AR and VR use cases and is also rapidly emerging as the market...

Continue reading Leveraging the power of AI at Unite Berlin

Related Links

Hyperledger Composer Basics

Hyperledger Composer is a tool for quickly building blockchain business networks and prototyping blockchain applications. This tutorial series gets you started using it.

Implementing Blockchain for cognitive IoT applications

Start implementing blockchain for cognitive IoT applications. Part 1 of this two-part series discussed the use of blockchain in IoT solutions and explored how different industries are leveraging these two technologies to build end-to-end automated and secured solutions. Part 2 shows you how to use the IBM Watson IoT platform and IBM Blockchain service to build a sample use case.