Skip to main content

Workshop 02: Read and Output

This workshop covers reading data from the blockchain in intervals and using that data to trigger actions on your microcontroller. You will work with two more Cardano APIs (Koios and Blockfrost) and learn how to wire external hardware - a TFT display, a relay, and a WS2812 LED ring - to the ESP32.

Source code: github.com/CardanoThings/Workshops/tree/main/Workshop-02

Steps

  1. Fetch your Wallet Balance - Poll your stake address balance via Koios (and Blockfrost as an alternative), parse the JSON, and detect changes.
  2. Display Data on your Microcontroller - Configure the TFT_eSPI library for the Cheap Yellow Display and render the wallet balance on a 320×240 TFT.
  3. Light up the Tree - Drive a 110V/220V relay from on-chain events. Includes safety guidance.
  4. Epoch Clock - Build a physical Epoch Clock on a 12-LED WS2812 ring that lights up progressively as the epoch advances.

What you'll need

  • Everything from Workshop 01.
  • A TFT display (the workshop uses the Cheap Yellow Display).
  • A relay module (with status LED).
  • A 12-LED WS2812 ring (NeoPixel) and an external 5V supply if you want to run it brighter than ~2%.
  • Breadboard, jumper wires.

Adapted from the CardanoThings workshop series, originally produced under Project Catalyst Fund 11. Source code: github.com/CardanoThings/Workshops/Workshop-02.