CryptoTracker ESP32 is a real-time cryptocurrency price tracker built on an ESP32 microcontroller. It fetches live cryptocurrency prices from the LiveCoinWatch API and displays them on a 16x2 I2C LCD screen.
- Fetches live cryptocurrency prices from LiveCoinWatch API
- Dynamically loads supported coins from a remote JSON configuration file
- Displays coin names and current prices on a 16x2 I2C LCD screen
- Automatically rotates through different cryptocurrencies at configurable intervals
- Uses
secrets.hto securely store API keys and Wi-Fi credentials - Provides error handling for network and API issues
- ESP32 development board
- 16x2 I2C LCD screen (0x27 address)
- Jumper wires for connections
- USB cable for programming and power
Connect the I2C LCD to the ESP32 using the following pins:
- SDA: GPIO 32
- SCL: GPIO 33
- VCC: 5V (VIN)
- GND: GND
LiquidCrystal_I2C: For controlling the LCD displayWire: For I2C communicationWiFi: For connecting to the internetHTTPClient: For making API requestsArduinoJson: For parsing JSON data- Standard C++
mapandvectorfor data management
-
Clone this repository:
git clone https://github.com/eftekin/CryptoTracker-ESP32.git
-
Install the required libraries via Arduino Library Manager.
-
Create a
secrets.hfile in the project directory with the following contents:#define WIFI_SSID "YourWiFiName" #define WIFI_PASSWORD "YourWiFiPassword" #define API_KEY "YourLiveCoinWatchAPIKey"
-
Obtain an API key from LiveCoinWatch.
-
Connect your ESP32 board to your computer and select the appropriate board and port in Arduino IDE.
-
Upload the code to your ESP32.
The device fetches a list of cryptocurrency codes from a remote JSON file. The default location is:
https://raw.githubusercontent.com/eftekin/CryptoTracker-ESP32/refs/heads/main/coins.json
The JSON file should contain an array of cryptocurrency codes:
[
"BTC",
"ETH",
"BNB",
"DOGE",
"SOL"
]FETCH_INTERVAL: Time in milliseconds between API calls (default: 9000ms)SWITCH_INTERVAL: Time in milliseconds between cycling to the next coin (default: 5000ms)SDA_PINandSCL_PIN: GPIO pins for I2C communication (defaults: 32 and 33)
- If the LCD shows "WiFi Error!", check your WiFi credentials and connection.
- If the LCD shows "API Error!", verify your API key and internet connection.
- If the LCD shows "JSON error!" or "Parse Error!", there may be an issue with the JSON data format.
- If the LCD shows "No coins found!", check that your coins.json file is accessible and properly formatted.
This project is licensed under the MIT License.
- LiveCoinWatch API for cryptocurrency price data
- Contributors and maintainers of the libraries used in this project