A PlatformIO project that displays Bitcoin price updates on a 32x16 LED matrix using FastLED, NeoMatrix, and more.
- ESP32 Development Board
- 32x16 WS2812B LED Matrix (512 LEDs total)
- Power supply (5V, adequate for your LED count)
- Jumper wires
- LED Matrix Data Pin → ESP32 GPIO 5
- LED Matrix 5V → External 5V Power Supply (optional, but recommended)
- LED Matrix GND → ESP32 GND + Power Supply GND
- Install PlatformIO
- Install VS Code with PlatformIO extension (recommended)
- Cursor currently is not licensed by Microsoft to use their cpptools extension. Workaround is to install an older version: https://github.com/microsoft/vscode-cpptools/releases/download/v1.24.4/cpptools-macOS-arm64.vsix
- PlatformIO is also not listed in the Open VSX Registry (non-Microsoft Extensions Marketplace). Manually download the PlatformIO vsix extension file: https://marketplace.visualstudio.com/_apis/public/gallery/publishers/platformio/vsextensions/platformio-ide/3.3.4/vspackage?targetPlatform=darwin-arm64
- Manually install these
.vsixextensions (cpptools first) with Command Palette:Extensions: Install from VSIX
-
Copy the configuration template:
cp include/config.h.template include/config.h
-
Edit
include/config.hand update with your actual credentials:#define WIFI_SSID "YOUR_WIFI_SSID" #define WIFI_PASSWORD "YOUR_WIFI_PASSWORD" #define COINGECKO_API_KEY "YOUR_COINGECKO_API_KEY"
-
[Optional] Customize hostname by editing
platformio.ini:[platformio] hostname = my-custom-name
This automatically configures both the device hostname and OTA upload target.
Note:
config.his in.gitignoreto keep your credentials private.
- Clone/navigate to this repository
- PlatformIO should automatically detect and initialize the project. If not, PIO Home->Open the directory.
- Open the project folder in VS Code
- Click the PlatformIO icon in the sidebar
- Click "Build" to compile
- Connect your ESP32 via USB
- Click "Upload" to flash the firmware
- Click "Monitor" to view serial output
# Navigate to project directory
cd esp-led-btc
# Install dependencies and build
pio run
# Upload to ESP32 (make sure it's connected via USB)
pio run --target upload
# Monitor serial output
pio device monitor --baud 115200- Startup: ESP32 connects to WiFi and initializes the LED matrix
- Price Updates: Asyncronously fetches BTC price from CoinDesk API (using timer interrupts), calculates deltas from OHLC
- Drawing: Main loop, using a variety of LED libs
Update firmware wirelessly without USB connection using PlatformIO environments.
- First upload: Select
esp32devenvironment → Click "Upload" - Wireless updates: Select
esp32dev_otaenvironment → Click "Upload"
# First upload via USB
pio run --environment esp32dev --target upload
# Wireless updates via OTA (uses hostname from platformio.ini)
pio run --environment esp32dev_ota --target upload
# Monitor serial output (works with both environments)
pio device monitor --baud 115200The LED matrix shows OTA progress:
- 🔵 Blue: Update starting
- 🟣 Purple: Progress bar
- 🟢 Green: Success
- 🔴 Red: Failed
- Device not found: Ensure device is on same network and
<hostname>.localis reachable (checkplatformio.inifor configured hostname) - Custom hostname not working: Verify hostname is correctly set in
platformio.iniunder[platformio]section - mDNS issues: Use IP directly:
pio run --environment esp32dev_ota --target upload --upload-port 192.168.1.100 - Wrong environment: Use
esp32dev_otafor wireless updates - Stuck in OTA: Power cycle the device
You should see output along the lines of:
ESP32 LED Matrix BTC Ticker Starting...
Connecting to WiFi........
WiFi connected! IP address: 192.168.1.100
mDNS responder started
OTA Ready
IP address: 192.168.1.100
Setup complete!
Fetching BTC price...
BTC Price: $XXXXX USD
Last Updated: Dec 8, 2023 19:30:00 UTC
Serial monitor for a remotely deployed device can be accessed at: http://<hostname>.local (hostname configured in platformio.ini, default: http://btc-ticker.local)
- Size: 32x16 pixels
- Origin: Bottom-right
- Layout: Column-major with zigzag wiring
- No WiFi connection: Check SSID/password in
config.h - No LED response: Verify wiring and power supply
- Compilation errors: Ensure PlatformIO dependencies are installed
- Upload fails: Check ESP32 is in bootloader mode and correct port is selected
- Non-blocking async HTTP fetch ✅
- OTA (Over the Air) update support ✅
- Text: Restyle, add more animations + fonts
- Animated background effects
- Chart (line or bar)
