Introduction
Imagine having a customizable dashboard display in your car that shows real-time performance data, fuel efficiency, and diagnostic information. Inspired by modern car features like the Subaru WRX’s multi-function screen and aftermarket devices like the COBB AccessPort, this project demonstrates how to build your own Raspberry Pi Obd2 Display. Using a Raspberry Pi, an OLED screen, and some basic electronics, you can create a powerful and informative display to monitor your vehicle’s vitals. This guide will walk you through the journey of building this DIY car computer, offering insights and solutions learned along the way.
Inspiration and Project Goals
The idea sparked while researching boost gauges and encountering reviews of the 2016 Subaru WRX, which featured a central screen displaying various vehicle parameters. This, coupled with the functionality of devices like the COBB AccessPort, led to the concept of a DIY boost gauge and more, utilizing a Raspberry Pi. The initial goals were ambitious but focused:
- Learn Python programming.
- Master wiring a 16×2 OLED display.
- Retrieve OBD-II data via Bluetooth.
- Implement ignition-based power control.
- Configure a lightweight Raspbian OS.
Sharing this project idea online brought up some valid points. Suggestions to use apps like Torque Pro were common. While Torque Pro is feature-rich, it can be visually cluttered, and using a phone as a display while driving isn’t ideal for everyone. Another suggestion involved using a pressure transducer for boost readings. While feasible, the OBD-II interface offers a standardized and readily accessible wealth of data beyond just boost pressure, making it a more versatile option for a comprehensive vehicle display project.
Researching Existing Solutions
Exploring similar projects online revealed several attempts at in-car diagnostic displays using Raspberry Pi. CowFish Studios’ project was a notable example, but it used a multi-color LCD and an older Python OBD-II library. CarBerry offered a polished system, but it was designed for LCD head units and was relatively expensive. Other projects were either outdated or poorly documented. Instead of directly replicating these, the decision was made to draw inspiration and create a unique solution, leveraging the best aspects of each while addressing their limitations.
Parts and Supplies for Your Raspberry Pi OBD2 Display
To embark on this project, gathering the right components is crucial. Around the project’s inception, the Raspberry Pi 2 was newly released, making it a suitable choice. A starter kit is highly recommended, especially for beginners in electronics. The Vilros Raspberry Pi 2 Ultimate Starter Kit (link is to a newer Pi 3 kit) provides a good foundation with essential wiring components.
In addition to the starter kit, the following components are necessary:
- OBD-II Bluetooth Adapter: Crucial for retrieving vehicle data. Invest in a quality adapter to avoid connection issues.
- Adafruit 16×2 Character OLED Display: Chosen for its sunlight readability, minimal wiring (no backlight needed), and display color that closely matches OEM gauges.
- Bluetooth USB Adapter: To enable Bluetooth communication on the Raspberry Pi.
- Mausberry Car Power Supply (Initially): Designed for car-based Raspberry Pi projects for ignition-controlled power (later replaced).
- UPS PIco (Alternative Power Supply): A more reliable car power solution with battery backup and safe shutdown features.
- Voltage Regulator: To step down the car’s 12V power to 5V for the Raspberry Pi and UPS PIco.
- Wiring and Connectors: Jumper wires, breadboard (often included in starter kits), fuse taps for car wiring.
Note: Choosing a reliable OBD-II Bluetooth adapter is paramount. Low-quality adapters can lead to frustration and connectivity problems.
Wiring the OLED Display to the Raspberry Pi
With the supplies ready, the next step is connecting the OLED display to the Raspberry Pi. Leveraging tutorials from the starter kit to grasp basic GPIO wiring, the Adafruit 16×2 OLED display was chosen. Its benefits include no need for a backlight and excellent sunlight visibility, crucial for in-car use. The display’s color also offered a near-perfect match to the vehicle’s existing gauges for a seamless look.
However, finding specific wiring documentation for this OLED model proved challenging. While Adafruit provides extensive guides for other LCDs, OLED support seemed limited. Using the available LCD documentation as a starting point, the initial wiring attempt unfortunately resulted in a fried display. After obtaining a replacement, a Raspberry Pi forum post offered crucial insights into wiring the OLED display correctly. Following these suggestions led to success on the second attempt.
For detailed wiring diagrams and a step-by-step guide for connecting your OLED display, refer to the obdPi documentation.
Establishing Bluetooth and Serial Connections for OBD2 Data
With the OLED display working, the next hurdle was enabling communication between the Raspberry Pi and the Bluetooth OBD-II adapter. This involved configuring Raspbian to handle Bluetooth connections and serial data transfer, which presented its own set of challenges due to limited specific documentation for this setup. The goal was to connect a Bluetooth OBD-II adapter to the Raspberry Pi via a Bluetooth USB adapter in a headless Raspbian environment.
Through trial and error, a functional configuration was achieved. The Bluetooth OBD-II adapter is paired with the Bluetooth USB adapter using the Raspberry Pi’s Bluetooth utility. This Bluetooth connection is then mapped to a virtual serial port, accessible within Python using the pyserial
library. To ensure automatic connection upon startup, entries were added to the /etc/rc.local
startup file.
For detailed instructions on setting up Bluetooth and serial communication, consult the “Bluetooth Setup” and “Serial Connection” sections of the obdPi documentation.
Python Scripts for OBD2 Data Retrieval and Display
With the display and connections established, Python scripts were needed to extract OBD-II data and display it on the OLED screen. Initially, basic scripts were developed to understand the OBD-II interface. However, these were quickly deemed too rudimentary for a robust solution. The discovery of the python-OBD
library proved to be a game-changer.
python-OBD is a well-structured and actively maintained library that simplifies OBD-II data access in Python. Its ongoing updates and responsive author community make it an excellent resource. Leveraging python-OBD
, a functional script was quickly created to output OBD-II data to the OLED display.
While the initial script was functional, as seen by the flashing display in the image, it was still in early stages. The next significant challenge was addressing the power supply for in-car operation.
Powering the Raspberry Pi Reliably in a Car Environment
Powering a Raspberry Pi in a car requires a stable and ignition-controlled power source. Mausberry car power supplies were initially considered based on recommendations in Raspberry Pi tutorials. A 2A Mausberry car switch was ordered, designed to power the Pi when the car is on and initiate a safe shutdown when the ignition is turned off.
The Mausberry switch was wired into the car’s fuse box using fuse taps. Initial tests seemed promising, but the switch consistently cut power to the Pi after about 30 seconds, causing abrupt shutdowns. Extensive troubleshooting, including different fuse combinations, wires, and even direct battery connection, yielded no solution. Suspecting a faulty unit, a multimeter test confirmed that the Mausberry switch itself was the problem.
Despite reaching out to Mausberry, no response was received after weeks. Giving them a second chance, a 3A Mausberry switch was ordered. However, this unit exhibited the same power cut-off issue. Frustration grew with the lack of support and product reliability.
Fortunately, an alternative solution emerged: the UPS PIco from Pimodules. Pimodules promptly confirmed its suitability for car applications. The UPS PIco was ordered and, upon arrival, impressed with its build quality and features.
The UPS PIco setup guide was clear and easy to follow. The UPS PIco uses a small LiPo battery to provide backup power during ignition off, enabling a safe shutdown. It also offers options for a cooling fan and monitoring voltage and battery levels. Status LEDs provide visual feedback on power source. Configuration was straightforward, and within an hour, the UPS PIco was functioning perfectly, providing a reliable power solution for the Raspberry Pi OBD2 display.
In-Car Installation and Initial Testing
With a reliable power solution secured, the project moved to in-car installation. Since the UPS PIco replaced the Mausberry voltage converter, a separate voltage regulator was needed to step down the car’s 12V to 5V. A regulator was sourced from Amazon and wired into the system.
The OLED display cable was carefully routed through the dashboard from the glovebox to the gauge cluster area.
The OLED display was positioned below the instrument gauges for easy viewing and straightforward cable routing.
Finally, a test drive confirmed the system’s functionality. The Raspberry Pi OBD2 display worked as expected, providing real-time data. After several weeks of testing, minor bugs were noted, but no major issues arose, validating the project’s success.
Creating a Housing for the OLED Display
To improve the aesthetics of the installation, a housing for the exposed green OLED PCB was created. Perspex plastic was chosen for its ease of use, and a Dremel tool was acquired for cutting and shaping.
The perspex housing was cut, test-fitted, and then painted black to blend seamlessly with the car’s interior.
The completed housing was installed in the car, providing a much cleaner and more professional appearance.
Conclusion and Future Enhancements
This Raspberry Pi OBD2 display project, born from a simple idea, evolved into a challenging and rewarding endeavor. It involved overcoming numerous hurdles, from wiring complexities to power supply issues. The project underscores the importance of perseverance and problem-solving in DIY electronics. Despite the late nights, frustrations with Python, and component failures, the final result is a testament to the value of sticking with a project through to completion.
The journey was not just about building a functional device; it was a learning experience in electronics, programming, and car modification. The project’s success is a springboard for future improvements and expansions. Potential next steps include refining the Python scripts, adding more data parameters, designing a more sophisticated housing, and exploring integration with other car systems.
Thank you for following along this DIY Raspberry Pi OBD2 display build. We hope this inspires you to embark on your own carputer projects!