A comprehensive MicroPython application for real-time vehicle monitoring using the M5Stack CoreS3 SE.
- GPS Tracking: Real-time location with satellite count and speed
- Battery Management: Voltage monitoring with percentage calculation
- Engine Detection: USB power detection for engine status
- Home Proximity: Automatic detection when within configurable radius
- Smooth LCD Updates: Flicker-free display with state tracking
- Real-time Data: GPS coordinates, battery status, WiFi connectivity
- Visual Status: Color-coded indicators (green/yellow/red)
- WiFi Auto-Connect: Automatic connection when close to home
- Secure Credentials: Local secrets management (not committed to git)
- M5Stack CoreS3 SE with ESP32-S3
- GPS Module connected to UART1 (TX=17, RX=18)
- AXP2101 battery management unit (I2C pins 11,12)
- ST7789 LCD (via M5 library)
Connect your GPS module to pins 17 (TX) and 18 (RX) at 115200 baud.
Create a local_secrets.py file (this file is gitignored):
# WiFi configuration
WIFI_SSID = "your_wifi_ssid"
WIFI_PASS = "your_wifi_password"
# Home location coordinates
HOME_LAT = 40.7128 # Your home latitude
HOME_LON = -74.0060 # Your home longitude# Copy files to your M5Stack CoreS3
mpremote cp main.py :
mpremote cp local_secrets.py :
# Run the application
mpremote run main.py- Update
HOME_LATandHOME_LONinlocal_secrets.pywith your actual coordinates - Adjust
HOME_RADIUS_FTinmain.pyif needed (default: 2000 feet)
- GPS position and satellite data via NMEA parsing
- Battery voltage and charging status
- USB power detection
- WiFi connectivity management
- Smart rendering that only updates changed values
- Prevents flicker with state tracking
- Smooth, responsive interface
- GPRMC sentences: Position, speed, time data
- GPGGA sentences: Satellite count and altitude
- Haversine formula: Distance calculation for home proximity
- Voltage-based: Battery percentage calculation
VAN MONITOR
βββββββββββββββββββββββββββββββββ
GPS: FIX SAT:8 HOME: YES
LAT: 40.7128
LON: -74.0060
SPEED: 0.0 km/h
BATTERY: 65%
Status: not-charging
USB: CONNECTED
ENGINE: ON
WIFI: CONNECTED
TIME: 14:30:25
- Baudrate: 115200
- Pins: TX=17, RX=18
- Sentences: GPRMC (position), GPGGA (satellites)
- Timeout: 3 seconds per reading
- I2C Address: 0x34 (AXP2101)
- Voltage Range: 3.0V - 4.2V (Li-ion)
- Percentage: Calculated from voltage readings
- Pins: SCL=11, SDA=12
- Auto-retry: Every 30 seconds when close to home
- Connection timeout: 10 seconds
- Power-aware: Manages connection based on location
βββ main.py # Main application
βββ local_secrets.py # Credentials (gitignored)
βββ .gitignore # Git ignore rules
βββ README.md # This file
βββ CLAUDE.md # Development notes
The modular design makes it easy to extend:
- Sensor data is collected in
update_sensors() - Display updates in
draw_status_screen() - Hardware interfaces are clearly separated
Enable debug output by monitoring the serial console:
mpremote run main.pyIndividual hardware components can be tested separately by importing specific functions.
- No credentials in git: All sensitive data in
local_secrets.py - Gitignored secrets: Prevents accidental commits
- Clean history: Repository contains no sensitive information
- Verify wiring: TX=17, RX=18
- Check baudrate: 115200
- Ensure antenna has clear sky view
- Monitor NMEA sentences in debug output
- Verify I2C connection: SCL=11, SDA=12
- Check AXP2101 address: 0x34
- Ensure battery is connected
- Verify M5 library import:
from M5 import * - Check display initialization
- Monitor for error messages
- Verify credentials in
local_secrets.py - Check signal strength
- Ensure proximity to home location
This project was developed with assistance from Claude Code.
- Fork the repository
- Create your feature branch
- Make changes (ensure
local_secrets.pyis not committed) - Test thoroughly
- Submit a pull request
π€ Generated with Claude Code