Skip to content

About

ESP32-based e-ink stock ticker with dual-page display. Shows real-time stock prices and crypto on a 4.2" Waveshare e-Paper display. Features smooth partial refresh page transitions, alternating views, and market status indicators. Built as a cost-effective alternative to commercial solutions like Tickr.

Resources

Stars

19 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

ESP32 Stock Ticker - Two Page E-Ink Display

A real-time stock and cryptocurrency price tracker using ESP32 and a 4.2" Waveshare e-Paper display. Built as an affordable alternative to commercial solutions like Tickr which cost $69 per stock.

Stock Ticker Demo Crypto Watch

Features

  • Dual-page alternating display - Smoothly cycles between two pages every 60 seconds
  • Stock tracking - Monitor up to 9 stocks with real-time prices and daily changes
  • Cryptocurrency support - Track Bitcoin and Ethereum prices
  • Smooth transitions - Uses partial refresh for seamless page swaps (no flashing)
  • Market status indicator - Shows when US markets are open/closed
  • Dual time zones - Displays both Pacific and Eastern time
  • Low power - E-ink display only refreshes when updating
  • No subscription fees - Uses free Alpha Vantage API

Hardware Requirements

  • ESP32 Development Board - HiLetgo ESP-WROOM-32 or similar (~$12)
  • Waveshare 4.2" e-Paper Module (B) Rev 2.2 (~$37)
    • ⚠️ Important: Must be Rev 2.2 (uses GxEPD2_420_GDEY042T81 driver)
    • Rev 2.1 uses a different driver and won't work with this code
  • 3D Printed Case (optional) - Nightscout case from Printables
  • USB-C cable for power

Total cost: ~$70 (vs $759+ for 11 Tickr devices)

Wiring Diagram

Connect the 8-pin ribbon cable as follows:

Display Pin ESP32 Pin Purpose
BUSY GPIO 4 Status
RST GPIO 16 Reset
DC GPIO 17 Data/Command
CS GPIO 5 Chip Select
CLK GPIO 18 SPI Clock
DIN GPIO 23 SPI Data
GND GND Ground
VCC 5V Power (NOT 3.3V!)

⚠️ Power from 5V, not 3.3V - The e-ink display draws 15-40mA which exceeds the ESP32's 3.3V regulator capacity.

Software Setup

Arduino IDE Configuration

  1. Install ESP32 Board Support

    • File → Preferences → Additional Board Manager URLs
    • Add: https://dl.espressif.com/dl/package_esp32_index.json
    • Tools → Board → Boards Manager → Search "ESP32" → Install
  2. Install Required Libraries

    • Sketch → Include Library → Manage Libraries
    • Install:
      • GxEPD2 by Jean-Marc Zingg
      • ArduinoJson by Benoit Blanchon
      • WiFi (included with ESP32 core)
      • HTTPClient (included with ESP32 core)
  3. Board Settings

    • Board: "ESP32 Dev Module"
    • Upload Speed: 57600 (for stability)
    • Flash Frequency: 80MHz
    • Partition Scheme: Default

API Key Setup

  1. Get a free Alpha Vantage API key: https://www.alphavantage.co/support/#api-key
  2. Open stock_ticker.ino and update the configuration section:
// WiFi credentials
const char* ssid = "YOUR_WIFI_NAME";
const char* password = "YOUR_WIFI_PASSWORD";

// Alpha Vantage API key
const char* apiKey = "YOUR_API_KEY";

// Customize your stock symbols
String page1Stocks[] = {"VRT", "NVDA", "SPOT", "SOUN", "APP"};
String page2Stocks[] = {"AAPL", "GEV", "GEHC", "GE"};
String page2Crypto[] = {"BTC", "ETH"};

Upload and Run

  1. Connect ESP32 via USB
  2. Select correct COM port in Tools → Port
  3. Click Upload
  4. Open Serial Monitor (115200 baud) to see connection status

How It Works

Display Pages

Page 1 - Shows 5 stocks of your choice with:

  • Stock symbol
  • Current price
  • Dollar change (+$2.50 or -$0.41)
  • Percentage change (+1.69% or -0.15%)
  • Up/down arrow indicators

Page 2 - Shows 4 more stocks plus a "Crypto Watch" section with:

  • Same stock information as Page 1
  • Bitcoin and Ethereum current prices
  • Separate crypto section with divider line

Refresh Behavior

  • Partial refresh (every 60 seconds) - Smooth page swap with no flashing
  • Full refresh (every 15 minutes) - Black flash to clear ghosting and fetch fresh data

This pattern prevents permanent ghosting while keeping transitions smooth between page swaps.

Market Hours Detection

The ticker automatically detects US market hours (9:30 AM - 4:00 PM Eastern, Monday-Friday) and displays "Market: OPEN" or "Market: CLOSED" status.

Known Limitations

Alpha Vantage Free Tier

The free API tier allows 25 requests per day, which limits update frequency:

  • Current code makes 11 API calls every 15 minutes (9 stocks + 2 crypto)
  • This exceeds the free tier after ~2 hours of operation
  • Workaround: Reduce update frequency to once every 2-3 hours, or upgrade to paid tier

For unlimited updates, see the Advanced Setup Guide which uses Twelve Data + Binance APIs via a Cloudflare Worker proxy (still $0/month but requires more setup).

Troubleshooting

Display shows nothing / stuck on "Connecting"

  • Check wiring - Verify all 8 connections are secure
  • Check power - VCC must be connected to 5V, not 3.3V
  • Check display revision - This code requires Rev 2.2 (check sticker on back)
    • Rev 2.1 uses different driver and won't work
  • Check BUSY pin - Code uses -1 (disabled) for stability with some displays

"Busy Timeout" errors in Serial Monitor

  • This is normal with BUSY pin disabled
  • Display still functions correctly
  • If timeouts are excessive, try connecting BUSY pin to GPIO 4 and change -1 to 4 in the display constructor

WiFi won't connect

  • Verify SSID and password are correct
  • ESP32 only supports 2.4GHz WiFi (not 5GHz)
  • Try moving closer to router during testing

Prices are $1-2 off

  • Alpha Vantage free tier has 15-minute delayed data
  • Slight discrepancies are normal
  • For real-time data, upgrade to paid API tier

Display is upside down

  • Change display.setRotation(3) to display.setRotation(1) in setup()
  • Rotation 3 = cables face down, Rotation 1 = cables face up

Cost Comparison

Solution Cost Stocks Tracked Subscription
Tickr $69 each 1 per device Optional
11x Tickr $759 11 stocks Optional
This Project ~$40 Unlimited* None

*Limited only by API rate limits and display space

Future Enhancements

  • Add historical price charts
  • Support for additional crypto currencies
  • Battery power with deep sleep
  • Touch button controls for manual refresh
  • Custom alert thresholds
  • Support for international markets

Contributing

Pull requests welcome! Please open an issue first to discuss major changes.

License

MIT License - feel free to modify and share

Acknowledgments

  • Built with GxEPD2 library by Jean-Marc Zingg
  • 3D case design from Printables
  • Inspired by the need for an affordable stock ticker alternative

Support

If you found this helpful, please ⭐ star the repo!

For questions or issues, open a GitHub issue or check existing discussions.


Disclaimer: This project is for personal use only. Stock prices are delayed and should not be used for trading decisions. Always verify information with official sources.

About

ESP32-based e-ink stock ticker with dual-page display. Shows real-time stock prices and crypto on a 4.2" Waveshare e-Paper display. Features smooth partial refresh page transitions, alternating views, and market status indicators. Built as a cost-effective alternative to commercial solutions like Tickr.

Resources

Stars

19 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages