Desky 2025
Building a Bitcoin Price Tracker with ESP32-S3 and AMOLED Display
Introduction
In this project, we’ve created a Bitcoin price tracker that displays real-time price data on a beautiful AMOLED screen. The device fetches Bitcoin price information from the CoinDesk API and presents it in an easy-to-read graph format, with additional information like high/low prices and percentage changes.
Hardware
The heart of this project is the LILYGO T-Display-S3 AMOLED development board, which features:
- ESP32-S3 microcontroller with WiFi and Bluetooth 5.0
- 1.9-inch AMOLED display with RM67162 controller
- Two programmable buttons
- Compact form factor perfect for desktop displays
Features
Our Bitcoin price tracker includes several impressive features:
- Real-time Price Updates: Fetches the latest Bitcoin price data every 5 minutes
- Interactive Time Intervals: Switch between 30-minute, 30-hour, and 30-day views using the buttons
- Visual Price Graph: Displays price trends with auto-scaling for optimal visualization
- Key Price Information: Shows high, low, and current prices
- Percentage Change: Displays price movement with color coding (green for positive, red for negative)
- Clean User Interface: Well-organized layout with clear labeling
How It Works
The project consists of several key components:
1. Hardware Setup
The LILYGO T-Display-S3 AMOLED board provides everything we need in a single package. The ESP32-S3 microcontroller handles the WiFi connectivity and data processing, while the AMOLED display delivers crisp, vibrant visuals.
2. Software Architecture
The code is structured to:
- Initialize the display and WiFi connection
- Fetch Bitcoin price data from the CoinDesk API
- Process and store the historical price data
- Draw the graph and price information on the display
- Handle button inputs for switching between time intervals
3. Data Visualization
The graph is drawn using the TFT_eSPI library, which provides efficient drawing functions for the AMOLED display. The price data is plotted with auto-scaling to ensure the graph is always visible and informative, regardless of price volatility.
4. User Interaction
Two buttons on the board allow for easy interaction:
- Button 1: Cycles through different time intervals (30m → 30h → 30d)
- Button 2: Manually refreshes the data
Technical Challenges and Solutions
During development, we encountered and solved several challenges:
- Display Initialization: The AMOLED display required specific initialization parameters to work correctly
- Memory Management: ESP32 has limited RAM, so we optimized data structures and drawing routines
- Screen Refresh: We implemented proper sprite clearing to prevent artifacts and ensure smooth updates
- API Rate Limiting: Added error handling for API requests to manage potential rate limits
- Button Debouncing: Implemented proper debounce logic to ensure reliable button inputs
Code Structure
The project uses a modular approach with separate functions for:
- Display initialization and management
- Data fetching and parsing
- Graph drawing and visualization
- Button handling and user interaction
We also implemented a template-based approach for environment variables, keeping sensitive information like API keys secure.
Future Enhancements
There are several ways this project could be expanded:
- Additional Cryptocurrencies: Add support for tracking multiple cryptocurrencies
- Custom Alerts: Implement price alerts for significant movements
- More Time Intervals: Add additional time ranges like 7-day or 1-month views
- Weather Integration: Combine with weather data for a multi-purpose display
- Cloud Integration: Store historical data in the cloud for longer-term analysis
Conclusion
This Bitcoin price tracker demonstrates the capabilities of the ESP32-S3 microcontroller and AMOLED display technology. By combining hardware and software effectively, we’ve created a useful tool for cryptocurrency enthusiasts that provides real-time market information in a compact, visually appealing format.
The project showcases how modern microcontrollers can be used to create practical, internet-connected devices that provide valuable information at a glance.
Resources
- GitHub Repository
- LILYGO T-Display-S3 AMOLED
- LILYGO T-Display-S3 AMOLED Documentation
- TFT_eSPI Library