Skip to content

๐Ÿš—โšก Real-time OBD2 RPM visualizer for Mazda vehicles using Arduino and WS2813 LED strips. Transform your engine's heartbeat into stunning color-coded visual feedback with warning blinks at redline!

License

Notifications You must be signed in to change notification settings

Arsalan134/Mazda-OBD2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

34 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš—โšก OBD2 RPM LED Visualizer

Arduino C++ Mazda License

Transform your car's RPM data into a stunning visual experience! ๐ŸŒˆ

๐Ÿš€ Features โ€ข ๐Ÿ”ง Installation โ€ข ๐Ÿ“น Demo โ€ข โš™๏ธ Configuration โ€ข ๐Ÿค Contributing


๐ŸŒŸ What is This?

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!

๐ŸŽฏ The Magic

  • Real-time RPM visualization ๐Ÿ“Š
  • Color-coded performance zones ๐ŸŒˆ
  • Warning blinks at redline โš ๏ธ
  • Plug-and-play OBD2 connection ๐Ÿ”Œ

๐Ÿš€ Features

๐ŸŽจ Visual Excellence

  • 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

๐Ÿ”ง Technical Prowess

  • 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

๐Ÿš™ Vehicle Compatibility

  • โœ… BMW: All models with OBD2 (1996+)
  • โœ… Mazda: All models with OBD2 (1996+)
  • โœ… Other Brands: Most vehicles with standard OBD2 support

๐Ÿ“น Demo

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!


๐Ÿ”ง Installation

๐Ÿ“ฆ Hardware Requirements

๐Ÿ”น Arduino Uno/Nano
๐Ÿ”น MCP2515 CAN Bus Module  
๐Ÿ”น WS2813 LED Strip (9+ LEDs)
๐Ÿ”น OBD2 to DB9 Cable
๐Ÿ”น 12V Power Supply
๐Ÿ”น Jumper Wires

๐Ÿ”Œ Wiring Diagram

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)

๐Ÿ’พ Software Setup

  1. Clone the repository

    git clone https://github.com/Arsalan134/OBD2-RPM-Visualizer.git
    cd OBD2-RPM-Visualizer
  2. Install PlatformIO (if not already installed)

    pip install platformio
  3. Build and Upload

    pio run --target upload
  4. Monitor Serial Output

    pio device monitor --baud 9600

โš™๏ธ Configuration

๐Ÿงช Environment Modes

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

๐ŸŽ›๏ธ Customization Options

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

๐Ÿ› ๏ธ Troubleshooting

๐Ÿšจ Common Issues

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)

๐ŸŽฏ How It Works

๐Ÿ“ก OBD2 Communication Flow

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]
Loading

๐Ÿงฎ RPM Processing

  1. Query Engine: Send OBD2 PID 0x0C request
  2. Receive Data: Parse CAN bus response
  3. Calculate RPM: ((byte1 * 256) + byte2) / 4
  4. Map to LEDs: Scale RPM to LED position
  5. Apply Colors: Gradient from yellow to red
  6. Update Display: Real-time visual feedback

๐Ÿค Contributing

We love contributions! Here's how you can help:

๐Ÿ› ๏ธ Development Areas

  • ๐Ÿš— Add support for more vehicle brands
  • ๐ŸŽจ Create new LED animation patterns
  • ๐Ÿ“Š Implement additional OBD2 PIDs
  • ๐Ÿ”ง Optimize CAN bus performance
  • ๐Ÿ“ฑ Build companion mobile app

๐Ÿ“ How to Contribute

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/awesome-feature)
  3. Commit changes (git commit -m 'Add awesome feature')
  4. Push to branch (git push origin feature/awesome-feature)
  5. Open Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ™‹โ€โ™‚๏ธ Author

Arsalan Iravani


๐Ÿš€ About Me

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


๐ŸŒŸ Star this repo if you found it helpful! ๐ŸŒŸ

Made with โค๏ธ and lots of โ˜•

About

๐Ÿš—โšก Real-time OBD2 RPM visualizer for Mazda vehicles using Arduino and WS2813 LED strips. Transform your engine's heartbeat into stunning color-coded visual feedback with warning blinks at redline!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published