Win $20,000. Help build the future of education. Answer the call. Learn more

Develop an IoT asset tracking app using Blockchain

Note: This code pattern is currently being updated to focus on IBM Blockchain Platform V2.0.


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:

    • Configure the Particle Electron Asset Tracker board.
    • Set up the Particle Electron toolchain.
    • Set up the Watson IoT Asset Tracker program.
  2. Implement IBM Blockchain technologies:

    • Build a basic IBM Blockchain Hyperledger network.
  3. Create an IoT app to visualize and analyze the IoT data

    • Create an IoT starter app in IBM Cloud.
    • Open Node-RED and install additional nodes.
    • Import a pre-build flow.
    • Initialize the flow.
    • Control and receive events from
    • Write events to the perishable business network blockchain.
    • Load blockchain transaction history.
    • Build the asset tracking dashboard.