magnifier
Language
  • English
  • German
Currency

News

ESP32 Bitcoin Ticker DIY: Live BTC Price + News on OLED

0 comments /

DIY ESP32 Bitcoin Price Ticker: Real-Time BTC Price, 24h Stats & Live RSS News Scroll on a 0.96" OLED



Want a desk gadget that does for crypto what a flip clock does for time? Our ESP32 Bitcoin Price Ticker 1.0 turns a tiny 0.96" SSD1306 OLED display into a live BTC dashboard: a giant 7-segment price that flips like an odometer when the market moves, a flashing edge-pulse on every fresh data fetch, an up/down arrow showing direction of travel, four scroll-flipping stats panels (market cap & volume, 24h low/high, dollar change, and a halving countdown), a top ticker that periodically slides off-screen to make room for live Bitcoin headlines from NewsBTC, Bitcoin Magazine, and Decrypt — and a clock with full date down at the bottom. All of it driven from CoinGecko's free API, time-synced with NTP, and animated buttery-smooth thanks to a true dual-core FreeRTOS architecture that puts every blocking network call on core 0 so the UI on core 1 never stutters. It's an absolutely satisfying weekend build — and the same hardware can ticker Ethereum, Solana, Dogecoin, or any other CoinGecko-listed coin with a one-line change. Get Parts: ESP32-S3 MINI + 0.96" OLED I2C




Step 1 — Wire the OLED to the ESP32-S3 MINI

Four wires, no soldering required. Power the OLED from the ESP32-S3 MINI's 3.3V rail and run the two I²C lines to GPIO 8 and 9.

OLED Pin ESP32-S3 MINI Pin Purpose
VCC 3.3V Power
GND GND Ground
SDA GPIO 8 I²C data
SCL GPIO 9 I²C clock

Note: if you're using a different ESP32 variant (classic ESP32-WROOM, ESP32-S2, etc.) that doesn't expose GPIO 8 and 9, you can change the pin assignment in the sketch (see Step 4 below).

Step 2 — Install the Arduino IDE and ESP32 Board Support

  1. Download and install the latest Arduino IDE from arduino.cc.
  2. Open File → Preferences and paste this URL into the "Additional Board Manager URLs" field:
    https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
  3. Open Tools → Board → Boards Manager, search for esp32, and install "esp32 by Espressif Systems".
  4. Under Tools → Board, select ESP32S3 Dev Module (or the variant that matches the board in your kit).

Step 3 — Install the Required Libraries

Open Tools → Manage Libraries and install these three (the ESP32 core includes everything else):

  • Adafruit GFX Library — by Adafruit (drawing primitives + fonts)
  • Adafruit SSD1306 — by Adafruit (drives the OLED over I²C)
  • ArduinoJson — by Benoit Blanchon (parses the CoinGecko JSON response — install version 6.x)

Everything else — WiFi, HTTPClient, WiFiClientSecure, Wire, time.h, and the FreeRTOS headers — comes bundled with the ESP32 core. No extra installs needed.

Step 4 — Download the Firmware and Edit Three Lines

Download the sketch file (crypto_oled_esp32_rss_news_flip.ino) and open it in the Arduino IDE.

Near the top of the sketch you'll see a USER SETTINGS block. Change these three lines to match your Wi-Fi network and time zone:

That's it. Three edits and you're ready to flash. If your board uses different I²C pins, you'll find this block a bit further down — change the numbers to whatever your ESP32 variant exposes:

Step 5 — Switch From Bitcoin to Ethereum, Solana, or Any Other Crypto

One of the best parts of this build is that the firmware is coin-agnostic. The price endpoint, the on-screen logo letter, and one Bitcoin-specific stats panel are the only crypto-specific bits in the entire sketch. Here's exactly what to change for the most popular alternatives.

1) Change the API endpoint. Find the API_URL constant near the top of the sketch and replace bitcoin with the CoinGecko coin id you want:

Common CoinGecko coin ids:

Coin CoinGecko id (lowercase) Logo letter
Bitcoin bitcoin B
Ethereum ethereum E
Solana solana S
Dogecoin dogecoin D
Cardano cardano A
XRP / Ripple ripple X
BNB binancecoin B
Litecoin litecoin L
Polygon matic-network P
Avalanche avalanche-2 A

You can find any other coin's id by searching coingecko.com — the id is the slug at the end of the coin's URL (e.g. coingecko.com/en/coins/chainlinkchainlink).

2) Change the logo letter. The big circular ticker badge in the top-left renders a single letter on top of a 9-pixel disc. Find the drawBtcLogo() function and change the character passed to display.write():

3) Disable the halving countdown panel (non-Bitcoin only). The fourth stats panel counts down to the next Bitcoin halving, which obviously doesn't apply to other coins. Two options:

  • Quick: change STATS_PANEL_COUNT from 4 to 3. The halving panel is silently dropped from the rotation; the other three (MCap/Vol, Low/High, 24h dollar change) keep cycling normally.
  • Full swap: repurpose the halving panel by editing the panelStr[3] = ... block in drawPrice() — for Ethereum you might show ETH gas price, for Solana TPS, or for any coin a 7-day percentage change.

4) (Optional) Swap the news feeds. The default RSS feeds are NewsBTC, Bitcoin Magazine, and Decrypt — the latter two cover all crypto, but NewsBTC is BTC-focused. For an ETH or alt-focused ticker, drop NewsBTC and add something like https://cointelegraph.com/rss/tag/ethereum in the feeds[] array.

Variable names like btcPrice, btcChange24h, etc. stay as-is — they're just symbol names and don't affect behavior. If the cosmetic mismatch bothers you, do a global find-and-replace from btc to eth (or whichever) and you'll have a clean ETH ticker codebase.

Step 6 — Flash and Watch It Come to Life Get Parts: ESP32-S3 MINI + 0.96" OLED I2C


Plug the ESP32-S3 MINI into your computer with a USB-C cable, select the correct COM / serial port under Tools → Port, and click the Upload arrow. After a few seconds you'll see the boot sequence — "Connecting WiFi", then "Syncing time...", then "Fetching BTC...", then "Fetching news..." — and finally the dashboard snaps into place: a giant 7-segment dollar price front and center, the Bitcoin badge ticker line up top, the rotating stats panel below the price, and a clock at the bottom.


What You See on the Screen

The 128×64 OLED is laid out as four distinct rows, each with a purpose:

  • Top row (y=0..7): the static "ticker" line — ₿ logo, 24h percent change, and a live WiFi signal-strength icon. Once a minute the row blinks, slides off to the left, and is replaced by a scrolling RSS news feed; when the headlines have all gone past, the ticker drops back down from above.
  • Price strip (y=11..39): the headline price rendered in big, bold 7-segment glyphs — "$" plus integer dollars at $1k+, two decimal places below. Whenever the displayed price changes, the new digits flip in odometer-style from above (price up) or below (price down). An arrow appears to the right showing direction, and a pair of vertical brackets pulses on each side of the block to mark every successful API fetch.
  • Stats row (y=42..49): a rotating panel that flips every 25 seconds between four views — market cap & 24h volume, 24h low & high, 24h dollar change, and a countdown to the next Bitcoin halving. Forward steps scroll DOWN; the wrap from panel 4 back to panel 1 scrolls UP, giving the rewind a distinct visual cue.
  • Bottom row (y=54..63): a compact clock with day-of-week, day-of-month, three-letter month, H:MM:SS, and AM/PM. Synced via NTP and DST-aware via POSIX TZ strings, just like our flip-clock build.

Features at a Glance

  • Live BTC price from CoinGecko's free public API, refreshed every 60 seconds — no API key required
  • Custom 7-segment glyph renderer — sharper and more readable than the default GFX font at the same size, with a hand-tuned "$" silhouette to match
  • Per-digit odometer flip animation — only the digits that actually changed flip; the rest stay rock-solid in place
  • Direction-aware flip — price up, new digits arrive from below; price down, they arrive from above. Reads instantly without needing to look at the arrow.
  • Up/down arrow + pulse heartbeat — tiny vertical brackets flash on each side of the price block on every successful fetch, even when the price didn't change
  • Length-mismatch fallback — on the rare event of crossing a 10x boundary (e.g. $9,999 → $10,000), the whole price block slides as one unit so the layout doesn't tear
  • Scroll-flipping stats panels — four independent panels rotate every 25 s with a smooth eased scroll; forward steps go down, the wrap goes up as a "rewind" cue
  • Multi-feed RSS news — round-robins through NewsBTC, Bitcoin Magazine, and Decrypt; pulls 2 headlines from each; full HTML entity and UTF-8 fold-down to ASCII so accented characters and curly quotes don't render as garbage
  • Dwell-at-start scroll — news pauses at x=0 for 1.5 s the first time it becomes fully visible so you can catch the headline beginning before it scrolls away
  • Reverse-video source labels — "NewsBTC", "BitMag", "Decrypt" prefixes render in inverted video so they're instantly distinguishable from the headline text
  • Animated row transitions — the ticker line blinks 3 times, slides off-screen left, news scrolls in from the right, then the ticker drops back down from above when news clears — no jarring snap cuts
  • Live WiFi signal-strength icon — four stepped bars driven by RSSI, in the top-right of the ticker
  • Halving countdown — days/years remaining to the next Bitcoin halving (block 1,050,000, est. April 2028), shown as the fourth stats panel
  • NTP-synced clock with full date, automatic DST handling via POSIX TZ strings, and four US time zones (Eastern, Central, Mountain, Pacific) supported out of the box
  • Dual-core FreeRTOS architecture — HTTPS price and news fetches run on core 0 while the render loop runs on core 1, so a slow network round-trip cannot stutter the animation
  • Mutex-protected shared state — price/news data is published atomically; the render loop and network task never trip over each other
  • Coin-agnostic firmware — one-line change to ticker any of CoinGecko's 10,000+ supported coins (see Step 5)

A Peek Inside the Code — Why Two Cores Matter

The technical magic of this build is how it stays animated while doing real network work. CoinGecko's TLS handshake and JSON response can take 800–1200 ms over a busy WiFi link — long enough that a single-threaded sketch would visibly freeze every minute when the price refresh hits. The same is true for RSS fetches, which can stall for 2–3 seconds each.

The fix is to put every blocking call on the second core. The ESP32 has two Xtensa cores; the Arduino framework runs setup() and loop() on core 1 by default, leaving core 0 idle most of the time. We spawn a dedicated network task on core 0 that owns all the HTTPS work:

Shared state — the price, the 24h stats, the parsed news string — is published through a single SemaphoreHandle_t mutex. The render loop holds it for microseconds while it samples the latest values; the network task holds it for microseconds while it publishes a new fetch. Neither side ever blocks the other for long enough to drop a frame.

Every digit change in the price triggers a 600 ms eased odometer animation, but only on the digits that actually changed. A move from $67,142 to $67,148 only flips the last two digits; the leading $67,14 stays rock-solid. We do this by walking the old and new price strings glyph-by-glyph and drawing both old (leaving) and new (arriving) digits at the same cell with vertical offsets when they differ — everything else gets drawn once at the resting baseline.

How the Code Works (the Short Version)

The sketch runs three cooperating pieces on the ESP32:

Core 0 — network task. Wakes every 100 ms to check timers; calls fetchPrice() from CoinGecko once per minute and round-robins through three RSS feeds every 15 minutes. Fetched data is parsed into local variables, then published atomically under the mutex.

Core 1 — render loop. Drives the top-row state machine (static ticker → blink → slide-out → news scroll → slide-in), the price-flip animation, the stats panel rotation, the bottom-row clock — and pushes one full frame to the OLED over I²C in a single transaction. Frame interval drops to ~33 FPS during animations and stretches out to 1 FPS when nothing is moving, so we don't waste cycles redrawing identical frames.

Shared state. A single dataMutex protects all reads and writes of btcPrice, btcChange24h, newsText, etc. Both cores hold it for microseconds at a time — never long enough for an animation frame to slip.

Why ESP32-S3 MINI + OLED?

The ESP32-S3 MINI is the perfect microcontroller for this kind of always-on, network-connected display project: tiny, USB-C native, dual-core at 240 MHz, with 8 MB of flash, native WiFi and Bluetooth, hardware TLS acceleration for HTTPS, and excellent FreeRTOS support. Pair it with a crisp 0.96" SSD1306 OLED and you've got a platform that can drive cryptocurrency tickers, stock dashboards, weather stations, smart-home displays — anything you can dream up. This Bitcoin ticker is a great project that teaches you HTTPS API fetching, JSON parsing, RSS parsing with HTML entity decoding, custom font glyph rendering, frame-rate animation timing, dual-core FreeRTOS programming, mutex-protected shared state, and POSIX timezone handling — all in one tidy single-file sketch.

Make It Your Own

Because the firmware is open and heavily commented, you can easily:

  • Swap BTC for any other CoinGecko coin (see Step 5 above) — ETH, SOL, DOGE, anything
  • Add a second coin and round-robin between them on the price strip
  • Tweak REFRESH_MS to fetch faster (be polite to CoinGecko — 60 s is comfortable; faster than 30 s and you'll start hitting the free-tier rate limit)
  • Change STATS_FLIP_SEC to make panels rotate snappier or more deliberately
  • Add a fifth stats panel for ATH ($), all-time-low, market cap rank, or anything else CoinGecko returns in market_data
  • Swap the RSS feeds in feeds[] for any RSS source (CoinTelegraph, The Block, your own filtered feed)
  • Bump HEADLINES_PER_FEED to pull more stories per pass
  • Adjust the RSSI thresholds in drawSignalIcon() if you're far from the router
  • Replace the halving panel with a price-alert panel that flashes when BTC crosses a threshold
  • Add a buzzer for an audible "ding" on every successful price update

The Full Sketch

Below is the complete crypto_oled_esp32_rss_news_flip.ino sketch. Copy it into your Arduino IDE, edit the three Wi-Fi / timezone lines at the top, optionally change the coin id (Step 5), and flash to your ESP32-S3 MINI.

crypto_oled_esp32_rss_news_flip.ino

Wiring is just four pins: VCC, GND, SDA, and SCL. If you can plug in a USB-C cable, you can build this ticker.

Get Yours:

ESP32-S3 MINI + 0.96" OLED I2CESP32-S3 MINI development board with WiFi and Bluetooth - eElectronicParts



Grab the ESP32-S3 MINI + 0.96" OLED Bitcoin Ticker Kit from our store and have a working, beautifully-typeset live crypto dashboard on your desk this weekend. Whether you're a hobbyist, a HODLer who wants a glanceable price display, a STEM teacher, or just someone who appreciates a nicely-built piece of desk hardware, this kit is a fun, educational, and genuinely useful build.


👉 Shop ESP32 DIY Kits at eelectronicparts.com


0 comments

Leave a comment

All blog comments are checked prior to publishing

You have successfully subscribed!