Homebrew OBDII Gauge Set
After messing with writing OBDII reader code for Bluetooth (thanks to
@hear for helping to get me started), I got tired of Bluetooth's flakiness. I was writing more code to keep it running than to display OBDII info. I kept having to add error-checking and recovery code for the initial connection, and dropouts, and timeouts, and partial responses. And using a cheapo Bluetooth reader wasn't helping. In the interest of having a permanent in-vehicle OBDII display, which works reliably every day, I switched back to a wired (serial) OBDII reader.
It's a
5G Hub serial OBD board (similar to the SparkFun board, but smaller and includes the 16-pin connector, which costs extra for the SparkFun board).
Note: the 5G Hub website is flaky and often fails to respond. I bought it from
DigiKey for about $70. Then I had to contact 5G Hub for the custom case, which I think was supposed to come with it.
I have it permanently connected in the Jeep, feeding a RasPi Pico microcontroller and a touch LCD. It works nicely, currently just displaying 6 lines of OBD info. I connected it to a
second DLC (Data Link Connector) under the dash via a
SPDT switch. That allows it to be completely switched out of the circuit to prevent interference (like when the emissions test guy plugs his reader in). And the second DLC is fed from key-switched power, so the reader completely shuts down when the key is off. Can't kill the battery.
The
RasPi Pico is not a typical "real" Raspberry Pi, it's just a microcontroller on a board, similar to an Arduino, about $4. No OS. Not the WiFi version, not v2 or v2-WiFi. I use the Arduino IDE to code and burn it. For a display, I initially I used a Wondiwe 3.5" 480x320 SPI
TFT LCD. It worked fine, but was a little hard to read, and the off-axis color shifts were bad. I switched to a much better
Hosyond 3.5" 480x320 SPI IPS LCD for about $20 (only slightly more than the TFT version). The IPS LCD is easy to read from any angle, with no color shifts, far better than the more common TFT LCD. It has a capacitive touch panel, which I'm not using in the current firmware.
I built this prototype version with point-to-point wiring on a sea-of-holes PCB. There's not much to it, and it should be straightforward to lay out a real PCB. American PCB fab is pricy. Chinese PCB fab can be quite high quality and dirt cheap, but shipping and tariffs tend to kill the cost savings.
The firmware is just Arduino C code, using the ELMduino library to talk to the OBDII reader, and Bodmer's TFT_eSPI library to drive the LCD. It also uses Bodmer's Adafruit GFX fonts. I modified one of the fonts to replace the fairly useless backtick with a needed degree symbol. The touch panel will use the RAK14014-FT6336U driver when I get around to it.
The
LCD console hangs from an overhead rack in the LJ, above the rearview mirror, alongside a
backup camera.
Photos, schematics, and source code are included in the attached zip file.
I'm working on a round-gauge library to pretty it up. But I sure don't work as fast as I used to. It will take a while.
The RPi Pico has some free I/O pins. They could be used to read other inputs directly from sensors like oil pressure, and an accelerometer. I've been messing with some graphical inclinometer code, but that's taking even longer than the round-gauge stuff.