Introduction
In the summer of 2015, my quest for a boost gauge for my Fiesta ST led me down an unexpected path. While researching aftermarket options, I stumbled upon a review of the 2016 Subaru WRX. The reviewer highlighted the WRX’s impressive multi-function display, showcasing real-time vehicle data like boost pressure and fuel economy. This feature, combined with my familiarity with the data-rich COBB AccessPort, sparked an idea: why not create my own custom car display using a Raspberry Pi? I had a spare Raspberry Pi lying around, and the challenge of building a DIY boost gauge, or even better, a comprehensive Raspberry Pi Car Obd2 display, seemed like an incredibly rewarding learning experience.
The initial plan was ambitious yet exciting. To bring this Raspberry Pi car OBD2 project to life, I knew I needed to dive into several new areas:
- Mastering Python programming to handle data processing and display.
- Learning the intricacies of wiring a 16×2 OLED display to visually present the car’s information.
- Figuring out how to reliably retrieve OBD-II diagnostic data wirelessly from my car using Bluetooth.
- Designing a power supply system that would intelligently manage power based on the car’s ignition status.
- Configuring a lean and efficient headless Raspbian operating system to minimize resource usage.
Enthusiastic about this endeavor, I shared my concept on online forums and communities, eager for feedback and insights. While the responses were largely positive, some practical suggestions emerged:
“Why reinvent the wheel? Just use Torque Pro. It’s already a mature OBD2 app.”
I had experimented with Torque Pro on my smartphone, and while powerful, its interface felt somewhat cluttered for my taste. Moreover, using my phone as a dedicated display in the car seemed impractical. My 5-inch Nexus, when mounted, would obstruct a significant portion of my windshield, and I preferred to keep my phone free for calls and music while driving.
“Consider interfacing a pressure transducer directly and creating a digital boost display.”
This was an interesting idea, and I found similar projects online. However, my vision was broader than just boost pressure. The OBD-II interface offered a standardized and readily accessible gateway to a wealth of vehicle parameters, far beyond just manifold pressure. The potential of a Raspberry Pi car OBD2 system to display this wider range of data was far more appealing.
Researching Existing Raspberry Pi Car OBD2 Projects
To ensure I wasn’t starting completely from scratch, I delved into researching existing projects that aimed to create in-car computer displays for vehicle diagnostics. The most comprehensive and well-documented project I found was from CowFish Studios. Their “obdPi” project utilized a Raspberry Pi to output OBD-II data to a multi-color LCD screen. However, their approach employed an older Python OBD-II library, which I noted for potential updates.
Another promising project was CarBerry. CarBerry offered a polished-looking system designed to output to an LCD head unit. Unfortunately, the cost, including international shipping and necessary accessories, was beyond my budget for this experimental DIY project.
I encountered other projects, but many appeared to be either outdated, incomplete, or lacking in sufficient documentation. Ultimately, I decided to synthesize the best ideas and approaches from these projects, using them as inspiration and guidance rather than direct templates for my Raspberry Pi car OBD2 build.
Gathering the Necessary Supplies for Your Raspberry Pi Carputer
Around the time I committed to this project, the Raspberry Pi 2 had just been released. I opted for a Vilros Raspberry Pi 2 Ultimate Starter Kit (the link now directs to a newer Pi 3 kit). As someone completely new to electronics wiring, I figured a starter kit would provide almost everything needed to begin experimenting with the Raspberry Pi’s GPIO pins and basic circuitry.
In addition to the starter kit, I acquired the following components specifically for the Raspberry Pi car OBD2 project:
- Adafruit 16×2 Character OLED Display: For crisp and clear data output in various lighting conditions.
- Bluetooth OBD-II Adapter: To wirelessly interface with the car’s OBD-II port (ensure it’s a quality adapter to avoid connectivity issues).
- Bluetooth USB Adapter: To enable Bluetooth communication on the Raspberry Pi.
- Mausberry Car Power Supply Switch (Initially): To manage power to the Raspberry Pi based on ignition status (later replaced).
- UPS PIco (Later Addition): An uninterruptible power supply for safe shutdown of the Raspberry Pi in a car environment.
- 12V to 5V Voltage Regulator: To step down the car’s 12V power to the 5V required by the Raspberry Pi.
- Various Wires, Breadboard, and Connectors: For prototyping and connecting the electronic components.
- Perspex Plastic Sheet: For crafting a custom housing for the OLED display.
NOTE: When sourcing parts for your own Raspberry Pi car OBD2 project, invest in a reliable OBD-II Bluetooth adapter. My first attempt used a cheap knock-off which proved to be problematic.
Wiring the OLED Display to the Raspberry Pi
After familiarizing myself with basic Raspberry Pi wiring concepts using tutorials included in the starter kit, I decided to tackle the OLED display integration.
While numerous LCD options are available for the Raspberry Pi, I chose the Adafruit 16×2 character OLED display for several key reasons. Firstly, being an OLED, it eliminated the need for a separate backlight, simplifying the wiring. Secondly, OLEDs offer superior readability, particularly in direct sunlight – crucial for an in-car display. Finally, the display’s color was a near-perfect match to the gauge screen in my Fiesta ST, contributing to a more integrated, OEM-like aesthetic.
The primary challenge with this specific OLED display was the limited availability of detailed wiring documentation online. While Adafruit provides excellent guides for their other LCDs, support for this OLED model seemed less prevalent. Undeterred, I proceeded with wiring, using the LCD documentation as a general reference.
Unfortunately, my initial wiring attempt resulted in a fried display. A quick exchange with Amazon later, and a replacement display was on its way for a second try. While awaiting the new display, I discovered a helpful forum post on raspberrypi.org specifically addressing wiring this OLED display. Following the suggestions in the forum, my second wiring attempt proved much more successful.
For a comprehensive step-by-step guide and wiring diagrams for connecting an OLED display to your Raspberry Pi for your car project, please refer to the obdPi documentation.
Establishing Bluetooth and Serial Connections for OBD2 Data
With a functional display wired to the Raspberry Pi, the next hurdle was configuring Raspbian to communicate with the Bluetooth OBD-II adapter and retrieve live car data.
This phase involved significant trial and error, primarily due to the scarcity of detailed documentation for this specific configuration: a Bluetooth OBD-II adapter connecting to a Bluetooth USB adapter on a headless Raspbian system, controlled via a Python script. However, after persistent effort, I achieved a stable working configuration. (Detailed instructions for Bluetooth setup and serial connection can be found in the “Bluetooth Setup” and “Serial Connection” sections of the obdPi documentation).
In essence, the Bluetooth OBD-II adapter is paired with the Bluetooth USB adapter connected to the Raspberry Pi, utilizing the Pi’s built-in Bluetooth utilities. This Bluetooth link is then mapped to a virtual serial port, which becomes accessible within Python using the pyserial library.
To ensure automatic connection upon system startup, I configured the Bluetooth pairing and serial port mapping to execute automatically using entries in the /etc/rc.local
startup file.
Python Scripts for OBD-II Data Acquisition and Display
Having established both the display and the data connections, the final software component was developing Python scripts to fetch OBD-II data from the car and present it on the OLED screen.
I initially began by attempting to write scripts from the ground up, aiming to understand the fundamental workings of the OBD-II interface. While I made some progress, it quickly became apparent that a more efficient and robust solution was needed. Fortunately, I discovered the excellent python-OBD library!
python-OBD is not only exceptionally well-structured and documented but also actively maintained with regular updates and responsive author support.
Leveraging the power of python-OBD, I rapidly developed a working Python script that successfully retrieved OBD-II data and displayed it on the OLED screen.
While the display flickered in the initial iteration, indicating areas for code optimization, I had achieved a significant milestone: real-time car data displayed on my custom Raspberry Pi car OBD2 system. The next challenge was to address the crucial aspect of powering the Raspberry Pi reliably within the car environment.
Powering the Raspberry Pi Carputer Reliably
During my research, the name Mausberry Circuits frequently surfaced in Raspberry Pi automotive project tutorials. I ordered one of their 2A car-based power supplies, hoping for a seamless power management solution.
Mausberry car switches are designed to draw power from two 12V sources in the car – one ignition-dependent and one constant. They are intended to power the Raspberry Pi when the car is on and initiate a safe shutdown sequence when the ignition is turned off. In theory, these switches seemed ideal for my Raspberry Pi car OBD2 project.
After receiving and installing a Mausberry car switch, I encountered immediate issues. I wired the switch into my car’s fuse box using fuse taps:
Initial tests appeared promising. However, after approximately 30 seconds of operation, the switch would abruptly cut power to the Raspberry Pi, forcing a hard shutdown. I systematically tested various fuse combinations, wiring configurations, USB cables, and even direct battery connections, all to no avail. Suspecting a fault with the switch itself, I sacrificed a USB cable to connect a multimeter in-line and test the output voltage. The multimeter readings confirmed my suspicion – the Mausberry switch appeared to be the source of the problem.
I attempted to contact Mausberry support but received no response after several weeks. Giving them the benefit of the doubt, I ordered a second switch. After a period of silence regarding my order, a new switch (this time, the 3A version) arrived in the mail weeks later.
Unfortunately, testing the new switch revealed the same power cut-off issue. Again, I repeated tests with different cables, power sources, and fuses, but the problem persisted.
At this point, frustration mounted, exacerbated by the lack of communication from Mausberry. Fortunately, I discovered an alternative solution: the UPS PIco from Pimodules. I contacted Pimodules directly to inquire about the UPS PIco’s suitability for automotive applications. They responded promptly, expressing confidence in its capability. I placed an order immediately.
Despite the delay due to customs and international shipping, the UPS PIco arrived and immediately impressed me upon unboxing.
The setup guide provided by Pimodules was exceptionally clear and easy to follow.
The UPS PIco utilizes a small 450mAh LiPo battery to provide backup power to the Raspberry Pi in case of power loss (i.e., when the car is turned off). It incorporates scripts to trigger a safe shutdown sequence after a brief period of battery operation. The UPS PIco also offers optional cooling fan integration and convenient access to voltage, battery level, and other status information via LEDs.
Thanks to the excellent documentation and well-designed hardware, I had the UPS PIco configured and functioning flawlessly within an hour. After months of power-related frustrations, I finally had a reliable power solution and a fully operational Raspberry Pi car OBD2 system ready for in-car installation!
Installation and Testing in the Car
With the Mausberry circuit replaced by the UPS PIco, I needed an alternative method to regulate the car’s 12V power down to the 5V required by the Raspberry Pi. I sourced this voltage regulator from Amazon and wired it into the system.
With everything prepared, I began the in-car installation by carefully threading the OLED display cable through the dashboard from the glove compartment area.
I decided to position the OLED display discreetly just below the instrument cluster gauges. This location seemed most practical for routing the cable through the dashboard.
Finally, the moment of truth arrived: the test drive!
Success! The entire Raspberry Pi car OBD2 system functioned as intended. I left it installed for several weeks of real-world testing and, while minor software refinements were needed, encountered no major issues.
Crafting a Custom OLED Display Housing
With the core functionality complete, I turned my attention to the final aesthetic touch: creating a housing for the exposed OLED display PCB.
The bare green PCB of the OLED contrasted starkly against the black dashboard, detracting from the desired integrated look. I decided to fabricate a simple housing from a sheet of perspex plastic purchased from Home Depot. This also presented a perfect opportunity to finally justify buying a Dremel rotary tool.
Future Enhancements and Project Reflections
This entire Raspberry Pi car OBD2 journey has been an invaluable learning experience. What began as a simple afternoon thought experiment evolved into one of the most demanding and time-consuming projects I’ve undertaken. It involved countless late nights in the garage, enduring both freezing and sweltering temperatures, hours spent wrestling with Python code, and moments of questioning my sanity.
A heartfelt thank you to my girlfriend, whose unwavering patience and support were instrumental in completing this project. She never questioned the growing piles of electronics and wires accumulating around the house (though she did jokingly inquire about “bomb-making” once), and consistently provided encouragement and motivation.
To some, this project might seem straightforward or even trivial. However, for me, it became a profound lesson in perseverance and the immense satisfaction derived from sticking with a project through numerous setbacks. The final result is always worth the effort.
I am genuinely excited about the future possibilities of this Raspberry Pi car OBD2 project and have already compiled an extensive list of potential improvements and features to explore.
Thank you for following along!
[