Transform your car's RPM data into a stunning visual experience! ๐
๐ Features โข ๐ง Installation โข ๐น Demo โข โ๏ธ Configuration โข ๐ค Contributing
Ever wanted to see your engine's RPM in real-time with a cool LED strip? This project reads OBD2 data directly from your BMW or Mazda and creates a dynamic RPM tachometer using WS2813 addressable LEDs!
- Real-time RPM visualization ๐
- Color-coded performance zones ๐
- Warning blinks at redline
โ ๏ธ - Plug-and-play OBD2 connection ๐
- Gradient LED Display: Smooth yellow-to-red gradient showing RPM progression
- Dynamic Scaling: Automatically maps RPM range to LED strip length
- Redline Warning: Blinks when approaching engine limits
- Engine Off Detection: Smart power management when engine stops
- OBD2 Protocol Support: Standard 11-bit and extended 29-bit addressing
- CAN Bus Communication: Direct vehicle network integration
- Configurable Environments: Test and production modes
- FastLED Integration: Optimized for WS2813 LED strips
- โ BMW: All models with OBD2 (1996+)
- โ Mazda: All models with OBD2 (1996+)
- โ Other Brands: Most vehicles with standard OBD2 support
https://github.com/Arsalan134/Mazda-OBD2/blob/main/๐%EF%B8%8F%20rpm%20demo.mp4
Watch your engine come to life with real-time RPM visualization!
๐น Arduino Uno/Nano
๐น MCP2515 CAN Bus Module
๐น WS2813 LED Strip (9+ LEDs)
๐น OBD2 to DB9 Cable
๐น 12V Power Supply
๐น Jumper Wires
Arduino Uno โ MCP2515 CAN Module
--------- ------------------
VCC (5V) โ VCC
GND โ GND
Pin 10 โ CS
Pin 11 โ SI
Pin 12 โ SO
Pin 13 โ SCK
Pin 2 โ INT
Arduino Pin 3 โ LED Strip Data Pin
12V Supply โ LED Strip Power (V+/GND)
-
Clone the repository
git clone https://github.com/Arsalan134/OBD2-RPM-Visualizer.git cd OBD2-RPM-Visualizer
-
Install PlatformIO (if not already installed)
pip install platformio
-
Build and Upload
pio run --target upload
-
Monitor Serial Output
pio device monitor --baud 9600
Test Mode (Default - Perfect for bench testing)
#define isTesting // Comment out for production
// Test Environment Settings:
RPM_MIN: 500 // Start visualization at 500 RPM
RPM_MAX: 2000 // Full scale at 2000 RPM
BLINK_THRESHOLD: 1500 // Warning blinks at 1500 RPM
Production Mode (Real driving conditions)
// #define isTesting // Commented out for production
// Production Environment Settings:
RPM_MIN: 3000 // Start visualization at 3000 RPM
RPM_MAX: 5000 // Full scale at 5000 RPM
BLINK_THRESHOLD: 5200 // Warning blinks at 5200 RPM
Parameter | Description | Range |
---|---|---|
NUM_LEDS |
Number of LEDs in strip | 1-255 |
LED_MAX_BRIGHTNESS |
Maximum LED brightness | 0-255 |
BLINK_DURATION |
Warning blink speed (ms) | 25-500 |
RPM_MIN/MAX |
RPM visualization range | 0-8000 |
Problem: "Starting CAN failed!"
โ
Solution: Check MCP2515 wiring and SPI connections
โ
Verify 5V power supply to CAN module
โ
Ensure OBD2 cable is properly connected
Problem: No LED response
โ
Check LED strip power (needs 12V for WS2813)
โ
Verify data pin connection (Pin 3)
โ
Test with lower LED count first
Problem: Wrong RPM values
โ
Switch between standard/extended addressing mode
โ
Check vehicle OBD2 compatibility
โ
Verify CAN bus speed (usually 500kbps)
graph LR
A[Arduino] -->|CAN Request| B[Vehicle ECU]
B -->|RPM Data| A
A -->|Process Data| C[LED Controller]
C -->|Visual Output| D[LED Strip]
- Query Engine: Send OBD2 PID 0x0C request
- Receive Data: Parse CAN bus response
- Calculate RPM:
((byte1 * 256) + byte2) / 4
- Map to LEDs: Scale RPM to LED position
- Apply Colors: Gradient from yellow to red
- Update Display: Real-time visual feedback
We love contributions! Here's how you can help:
- ๐ Add support for more vehicle brands
- ๐จ Create new LED animation patterns
- ๐ Implement additional OBD2 PIDs
- ๐ง Optimize CAN bus performance
- ๐ฑ Build companion mobile app
- Fork the repository
- Create feature branch (
git checkout -b feature/awesome-feature
) - Commit changes (
git commit -m 'Add awesome feature'
) - Push to branch (
git push origin feature/awesome-feature
) - Open Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Arsalan Iravani
- ๐ LinkedIn: @airavani
- ๐ง Email: [airavani2018@gmail.com]
I'm an iOS Developer and Electronics Enthusiast passionate about bridging the gap between software and hardware. This project combines my love for automotive technology with embedded systems programming.
Other Interests: ๐ฑ Mobile Development โข ๐ฉ๏ธ Drone Technology โข ๐๏ธ Automotive Electronics โข ๐ค IoT Solutions