ESP32 CYD Stock and Crypto Price Ticker
by Zaitronics in Circuits > Arduino
216 Views, 4 Favorites, 0 Comments
ESP32 CYD Stock and Crypto Price Ticker
A live stock and cryptocurrency price tracker built on the ESP32 Cheap Yellow Display. The CYD is a 2.8 inch colour touchscreen development board with WiFi built in. This project requires no wiring, no soldering and no breadboard required. Everything is configured from a browser on your local network after flashing.
Prices update automatically. Tap any ticker to see a full screen detail view. Portfolio mode tracks your holdings value and day profit and loss. Price alerts flash the onboard LED when a threshold is breached.
The full build guide is at zaitronics.com.au/blogs/projects/esp32-cyd-stock-ticker and the source code is on GitHub.
Supplies
- ESP32 CYD (ESP32-2432S028) — display, touch, and WiFi all built in
- USB-C cable
- USB power supply (any phone charger works)
- A free Finnhub API key from finnhub.io (for stocks)
- CoinGecko requires no key at all for crypto prices
Set Up Arduino IDE
Download and install Arduino IDE from arduino.cc if you do not have it already. Then install the ESP32 board package by Espressif through the Boards Manager.
Open Arduino IDE, go to Tools > Board > Boards Manager, search for ESP32, and install the package by Espressif Systems. Once installed, go to Tools > Board and select ESP32 Dev Module.
A detailed walkthrough is available here if you get stuck: Installing and Configuring Arduino IDE for ESP32
Install the Required Libraries
Four libraries are needed. Install each through Sketch > Include Library > Manage Libraries:
- TFT_eSPI by Bodmer
- XPT2046_Touchscreen by Paul Stoffregen
- ArduinoJson by Benoit Blanchon
- WiFiManager by tzapu
Download and Open the Code
Download the repository from GitHub as a ZIP file using the green Code button:
github.com/Zaitronics/esp32-cyd-stock-ticker
Extract the ZIP and open the .ino file in Arduino IDE. If Arduino IDE asks you to create a folder, click OK.
Flash the Firmware
Connect the CYD to your computer with a USB-C cable. In Arduino IDE go to Tools > Port and select the port that appeared when you plugged in the board.
Click the Upload button (the right-facing arrow). Flashing takes around 30 to 60 seconds. The screen will show a WiFi setup prompt when it is done.
Connect to WiFi
On first boot the CYD creates a WiFi access point called StockTicker-Setup. Connect to it from your phone or computer. A captive portal opens automatically — if it does not, navigate to 192.168.4.1 in a browser.
Enter your WiFi credentials and your Finnhub API key. After saving, the device connects to your network and shows its IP address on screen. From that point on it connects automatically on every boot.
Additional Features
Portfolio mode — enter the number of shares or units you hold for each ticker and the device shows your total holdings value and day profit and loss. Enable it in the configuration panel.
Price alerts — set a high or low threshold for any ticker. The onboard RGB LED flashes yellow when the price crosses it. A dot indicator on the grid also highlights the breach.
Light mode — toggle between dark and light mode from the configuration panel.
Home Assistant / Node-RED — a JSON API at http://[device-ip]/api/quotes returns current price data for all tickers and can be polled by any home automation platform.
Conclusion
The ESP32 CYD is a great platform for projects like this — a complete display and microcontroller in one board for a few dollars. The full build guide with more detail on each step is at zaitronics.com.au/blogs/guides/esp32-cyd-stock-ticker and the source code is MIT licensed on GitHub at github.com/Zaitronics/esp32-cyd-stock-ticker.
The pre-flashed version with firmware already loaded is available if you want to skip the flashing steps entirely.