Ford Fiesta ST Forum banner
1 - 14 of 14 Posts

·
Registered
Joined
·
253 Posts
Discussion Starter · #1 ·
So I've been contemplating installing a boost gauge, but have been turned off by the cost/quality of the offerings. Then I remembered seeing a custom OBD-II/Raspberry Pi project on a blog (check it out here) and thought it would make a great end-of-summer project, and let me output whatever data I want. I'd also like to output the data into a simpler 2x16 lcd screen (see example here) instead of a full-size color display.

My main goals are:

  • Learn how to code in Python
  • Learn to output data to LCD from Raspberry Pi
  • Display boost readout (at least)
  • Don't fry my FiST's electronics
  • Don't start anything on fire

Plan of attack:

  • OBD-II Bluetooth transmitter > Raspberry Pi/Arduino (Python scripting) > OLED display (report boost, engine temp, throttle position, etc.)

Helpful links:

I've been doing a bunch of research on other, similar projects, and will update this thread with anything helpful I find. I've got a ELM327 transmitter coming tomorrow, and some test code written up on my laptop to try out!

Feel free to share your input if you've got any experience with this type of thing. I'm struggling with a few aspects of the project, but want to see how far I can get knowing what I do.
 

·
Registered
Joined
·
374 Posts
I'm curious why you'd go this way as opposed to using an inexpensive android device and the torque app. There's already been lots of development on that.

It would be cool if you could interface a pressure transducer like the one you find with boost gauge kits to the Rpi and then design a digital display without the need to occupy the obd2 port.

I'm keen to see with what you come up with and how far you get.

Sent from my A0001 using Tapatalk
 

·
Registered
Joined
·
526 Posts
The good thing with obd2 is that there is no need to wire most plug ins. I like your ideas. Plx electronics make some interesting obd multi gauges. Why wire in more sensors when they are already there
 

·
Registered
Joined
·
253 Posts
Discussion Starter · #4 · (Edited)
I'm curious why you'd go this way as opposed to using an inexpensive android device and the torque app. There's already been lots of development on that.
Great question. I actually considered Torque a couple of months ago (think I started a thread on here discussing it), but never followed through. I use my smartphone for music/calls when driving, plus the idea of mounting a ~5" phone up on the windshield doesn't really appeal to me. I am also a software engineer by day, so the opportunity to learn a new language (Python) is a resume-booster too. I currently do mostly web development right now, but I'm very interested in learning more about this type of hardware-based development. Seems like there's a lot of opportunities out there that utilize Python. Not to mention, if this project crashes and burns, I can always just load up Torque and call it a day. :)

It would be cool if you could interface a pressure transducer like the one you find with boost gauge kits to the Rpi and then design a digital display without the need to occupy the obd2 port.
There are actually quite a few projects I've found where this has been done (like this one). I'm interested to see if there's any latency issues with utilizing the OBD-II interface, as this type of pressure-based solution would be the most "accurate", I would think. I think I'll try the OBD-II route first.

The good thing with obd2 is that there is no need to wire most plug ins. I like your ideas. Plx electronics make some interesting obd multi gauges. Why wire in more sensors when they are already there
Exactly. If I run a vacuum line for a boost gauge, I'm restricted to only boost data. OBD provides pretty much all the data I could want, and allows me to output everything to a single screen. (At least that's the plan...) Cool factor +1.

EDIT: Before anyone says "COBB AP" - I'm not looking to spend $400+. Lol.
 

·
Registered
Joined
·
361 Posts
I just find it interesting you're trying to accomplish the gauge pod versatility of the Cobb AP without the tuning functionality. Well above my skill level, but intrigued to see what you do.
 
  • Like
Reactions: da51d

·
Registered
Joined
·
253 Posts
Discussion Starter · #6 ·
Quick update:

Haven't had a ton of time to spend on this project so far, but in the few hours I've been tinkering, I've run into some issues communicating with the OBD-II transmitter in Windows 10. I installed Ubuntu on the other half of my laptop last night and ran some quick tests (different version of Python as well), and things are looking more promising! Also, I picked up Torque Pro to ensure my transmitter is working, and it works great! Although the app seems a bit...busy. Don't think I could see myself using it on a daily basis.

Does anybody here have any experience with Python/the pyserial package?
 

·
Registered
Joined
·
253 Posts
Discussion Starter · #7 ·
(small) Success! I've gotten everything configured in Linux, and a working Python script to grab the engine RPM:

 
  • Like
Reactions: da51d

·
Registered
Joined
·
253 Posts
Discussion Starter · #8 ·
Quick update:

Picked up some supplies from Amazon!



And wired it up...



Annnnnnnd almost short circuited the whole thing. Lol. Still learning basic circuitry, and realized I need a bigger breadboard. Hallelujah two day shipping!
 
  • Like
Reactions: adrianST and MOFiST

·
Registered
Joined
·
253 Posts
Discussion Starter · #9 ·
09/21/15 Update:

Turns out I did short out the original OLED display, but ended up getting a replacement from Amazon (love love love their return system!). Testing the new display...



Finally, I ended up almost completely re-writing my original Python code, but the result was definitely worth it:


Next goal is to address the refresh rate/flickering you see in the video (should be an easy adjustment to the hard-coded delays I implemented).
 

·
Registered
Joined
·
253 Posts
Discussion Starter · #11 · (Edited)
Wow it's been a while since I worked on this! I finally got the courage to brave the cold in the garage and take another whack at this project.

I managed to locate an awesome Python OBD-II library, python-OBD. It's very well documented, and features all of the commands I'm looking for (i.e. RPM's, throttle position, boost pressure, etc.) Having implemented some tests with this library, I've really optimized my scripts and am way more confident in the reliability of this project.

At this point, I've got test scripts running on my Raspberry Pi, outputting data to the OLED display. Now I'm looking to connect the Pi up to run off the ST's electrical system, but also shut down when the car is turned off. Thankfully, there seems to be plenty of people interested in the same topic, and there are a number of third-party accessories to help me accomplish this.

Some of the tutorials I've referenced on the subject are:


Based on these tutorials, I'm planning to pick up a Masberry Circuits 2A Car Supply/Switch and wire the Pi in through it. Unfortunately, due to my "electrical ignorance", I have some lingering questions I'm hoping you can all help with:
  • Which fuses provide a constant 12V (even when the car is off?)
  • Which fuses are tied to a 12V that is powered on/off based on the ignition/accessory?
    • I've been referring to the owners manual for this one (available online here)
    • Note: I've already tapped into the rear wiper fuse for my dash cam
  • Where else in the glovebox can I tap a ground? I'm already using the ground point as seen in this dashcam tutorial photo
 
  • Like
Reactions: Boomba Racing

·
Registered
Joined
·
253 Posts
Discussion Starter · #12 ·
(x-post from fiestastforum.com)

Well, almost a year later and I've got something to share!




I've been running a working version of the code in my car for a few weeks now with no major issues. There is still plenty of room for improvement (I've already started a list...), but I'm happy with how it's come together so far.


A publicly available copy of the code is available on my Github (here) along with some documentation to support the setup/usage of the project files.


I'll be working on a full blog/forum post to highlight the project start to finish, but for now feel free to share your comments/criticisms/suggestions!
 
  • Like
Reactions: Boomba Racing

·
Registered
Joined
·
44 Posts
This is too cool. I have a couple pi's sitting around as well as an LED screen. Might be time to start really learning this stuff...

One question that has bothered me for some time: does it affect the pi at all to just shut off the power with the car, or do you go thru a shutdown process?
 

·
Registered
Joined
·
253 Posts
Discussion Starter · #14 ·
This is too cool. I have a couple pi's sitting around as well as an LED screen. Might be time to start really learning this stuff...

One question that has bothered me for some time: does it affect the pi at all to just shut off the power with the car, or do you go thru a shutdown process?
Sorry for the delayed response! I guess my email notifications for this forum aren't working...

The Raspbian OS is not designed for sudden shutdowns, so yes - you can corrupt your OS if you don't go through the proper shutdown process before pulling the power. This is an issue I solved using an UPS HAT for the Pi. Once the power from the car is turned off, the UPS waits 30 seconds and executes a safe shutdown script. The LIPO on the UPS is then recharged the next time the car is powered on.

For reference, here's the completed blog post I wrote up on the project: Ben Walters - Blog

Raspberry Pi's are awesome little machines! Be sure to post up if you decide to build one of your own!
 
1 - 14 of 14 Posts
Top