Here's the complete markdown formatted specifically for GitHub:
A high-precision digital speedometer built with ESP32, featuring a color OLED display and GPS functionality. This project provides accurate speed readings, trip tracking, and a demo mode for testing along with a custom boot screen. My 1971 BMW 2002 has a mechanically driven speedometer and it's not always accurate. I needed something I can use on a per-need basis. I also wanted to try out working with a NEO-6M module which is just a few bucks online.
- Customizable boot screen
- Real-time GPS speed tracking
- Configurable "High Speed" warning to alert driver when exceeding specified speed
- Bright OLED color display (96x64 pixels)
- Trip meter with reset functionality
- Satellite acquisition indicator
- Demo mode for testing
- Average speed calculation
- Total distance tracking
- Battery powered operation (~3-4 hours on 450mAh LiPo)
- LILYGO T2 V1.6 ESP32 Development Board with OLED Display (SSD1331)
- NEO-6M GPS Module
- 3-Position SPDT Slide Switch (for trip/odometer toggle)
- 3-Position SPDT Slide Switch (for battery power)
- 10kΩ Resistors
- 3.7V LiPo battery (450mAh tested)
- Jumper wires
- USB-C cable for programming
- ESP32 board support TTGO T2
- Adafruit_GFX library
- Adafruit_SSD1331 library
- TinyGPS++ library
- Python 3.x
- PIL (Python Imaging Library)
- NumPy
ESP32 Pin | Display Pin
----------|------------
GPIO14 | SCLK
GPIO13 | MOSI
GPIO15 | CS
GPIO16 | DC
GPIO4 | RST
ESP32 Pin | GPS Module
----------|------------
GPIO12 | TX
GPIO2 | RX
3.3V | VCC
GND | GND
ESP32 Pin | Switch
--------------|------------
GPIO34 | Outside Pin
GND | Middle Pin
3.3V --- 10kΩ | Outside Pin (GPIO34)
- Install the necessary ESP32 board support into your Arduino IDE
- Install required libraries through Arduino Library Manager:
- Adafruit_GFX
- Adafruit_SSD1331
- TinyGPS++
- Clone this repository
- Open
esp32-gps-speedometer.inoin Arduino IDE - [Optional] Use
image_to_bitmap.pyto convert an image to bitmap - See Custom Boot Screen - Select "ESP32 Dev Module" as your board
- Upload the code to your ESP32
To create your own boot screen:
- Install Python dependencies:
pip install pillow numpy-
Prepare your image:
- Size: Will be resized to 96x64 pixels
- Format: Any format supported by PIL (PNG, JPG, etc.)
-
Convert the image:
python image_to_bitmap.py input_image.png output.h- Replace the contents of
image_data[]array in the main code with the generated bitmap data
- Power up the device via USB or battery power
- Battery operation: Use the power rocker switch to turn on/off
- USB operation: Device powers on automatically
- Wait for the custom logo splash screen
- Device will show satellite acquisition screen
- Once satellites are acquired (usually 4+ satellites), speed will display
- Use the slide switch to toggle between total and trip distance
- Press the IO36 button on TTGO to enter/exit demo mode
- Normal Mode: Displays actual GPS speed and distance
- Trip Mode: Shows resettable trip distance
- Demo Mode: Simulates speed for testing (useful for development)
The device supports two power modes:
- USB-C powered: Automatic power-on when connected
- Battery powered: 3.7V LiPo with ~3-4 hours runtime on 450mAh battery
- Built-in charging when USB is connected
- Power rocker switch for battery operation
- Speed Range: 0-120 MPH (configurable in code)
- GPS Update Rate: 1Hz
- Display Resolution: 96x64 pixels
- Power Supply: 5V USB or 3.7V Li-Po battery
- Current Consumption: ~100mA typical
- Battery Life: ~3-4 hours on 450mAh LiPo
- Design 52mm gauge pod enclosure
- Improve power efficiency
- Add configuration options for display preferences
- Create simple webapp for managing system settings
- Implement speed logging capability
- TTGO for the T2 ESP32 board design
- Adafruit for the display libraries
- Mikal Hart for TinyGPS++

