Welcome to the North American Subaru Impreza Owners Club Monday August 19, 2019
Home Forums WikiNASIOC Products Store Modifications Upgrade Garage
NASIOC
Go Back   NASIOC > NASIOC Technical > Electrical & Lighting

Welcome to NASIOC - The world's largest online community for Subaru enthusiasts!
Welcome to the NASIOC.com Subaru forum.

You are currently viewing our forum as a guest, which gives you limited access to view most discussions and access our other features. By joining our community, free of charge, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is free, fast and simple, so please join our community today!

If you have any problems with the registration process or your account login, please contact us.
* Registered users of the site do not see these ads. 
Reply
 
Thread Tools Display Modes
Old 02-25-2019, 03:54 PM   #1
gfxguy
Scooby Newbie
 
Member#: 316583
Join Date: Apr 2012
Chapter/Region: NWIC
Location: Seattle area
Vehicle:
2014 STI Hatch
ISM

Default DIY 2015+ Style Boost Gauge

I have a 2014 STI (stock), and was looking to add a boost gauge as well as a way to monitor engine health (display and log knock events, IAM, etc.). I realize I could just get an AP but I already had a Tactrix OP2.0 adapter and was looking for a new electronics project to tackle, so I decided to see what I could come up with. (I had also tried BtSsm with a donated Android phone, but couldn't get logging to work, and then the phone died.)

My first version used a tiny 128x32 OLED display, running on a Teensy 3.6 microcontroller connected to the Tactrix via USB. It displayed boost, IAT & ECT, as well as FBKC and FLKC events when they happened (and IAM if it ever dipped below 1). Those events triggered SD card logging of the previous ~1.5 seconds and the next 5 seconds of ECU readings.


The next version, which I'm working on now, uses a larger 2.8" 320x240 color touchscreen, and I decided to copy the style of the OEM boost gauges in the newer turbo models. I just finished the display code (not trivial to get it refreshing smoothly on this limited hardware, but I managed to hit 60 FPS), and should get it displaying real data in the next few days as free time allows.


I still need to create an enclosure for it and figure out where I'm going to mount it. I also plan on connecting directly to the OBD2 port (removing the need for the Tactrix).
* Registered users of the site do not see these ads.

Last edited by gfxguy; 02-25-2019 at 04:21 PM.
gfxguy is online now   Reply With Quote
Sponsored Links
* Registered users of the site do not see these ads.
Old 02-26-2019, 12:49 PM   #2
gfxguy
Scooby Newbie
 
Member#: 316583
Join Date: Apr 2012
Chapter/Region: NWIC
Location: Seattle area
Vehicle:
2014 STI Hatch
ISM

Default

Hooked up the display code to actual data last night & tested it during this morning's commute, working great.

gfxguy is online now   Reply With Quote
Old 03-04-2019, 12:19 AM   #3
gfxguy
Scooby Newbie
 
Member#: 316583
Join Date: Apr 2012
Chapter/Region: NWIC
Location: Seattle area
Vehicle:
2014 STI Hatch
ISM

Default

Made some good progress since the last post. Decide to use this as an enclosure:

https://www.amazon.com/gp/product/B07G8S6XLV

and wired everything up on one of the boards from this set:

https://www.amazon.com/gp/product/B074X2GDH2

(the largest size, trimmed to fit). With a few washers as spacers, I was able to make the header on the display mate with the header socket soldered onto the protoboard when the enclosure is closed.



Soldered everything up:






and mounted it in a phone holder:



Also made some improvements to the code: rigged up the touchscreen so that tapping on the max boost or FBKC readouts resets them, and added a big red idiot light if the IAM drops below 1. Also added antialiased line drawing for the gauge needles.


Still want to get a faceplate laser-cut to replace my electrical tape one, lol. Also thinking of trying to emulate my car's gauge style to better blend in. Longer term I might try to design a custom 3D-printed enclosure that I can mount directly on the dash. But, for now, I'm pretty happy with how this turned out!
gfxguy is online now   Reply With Quote
Old 03-04-2019, 11:02 PM   #4
n7slc
Scooby Newbie
 
Member#: 443545
Join Date: Mar 2016
Chapter/Region: RMIC
Location: SLC, Utah
Vehicle:
2015 WRX Limited CVT
Lightning Red

Default

That is awesome.
n7slc is offline   Reply With Quote
Old 03-05-2019, 04:54 AM   #5
scubaboo
Scooby Newbie
 
Member#: 464859
Join Date: Mar 2017
Default

That is nice work right there!
scubaboo is offline   Reply With Quote
Old 03-05-2019, 12:58 PM   #6
gfxguy
Scooby Newbie
 
Member#: 316583
Join Date: Apr 2012
Chapter/Region: NWIC
Location: Seattle area
Vehicle:
2014 STI Hatch
ISM

Default

Quote:
Originally Posted by n7slc View Post
That is awesome.
Quote:
Originally Posted by scubaboo View Post
That is nice work right there!
Thanks! It's been a super fun project.
gfxguy is online now   Reply With Quote
Old 03-17-2019, 01:25 AM   #7
gfxguy
Scooby Newbie
 
Member#: 316583
Join Date: Apr 2012
Chapter/Region: NWIC
Location: Seattle area
Vehicle:
2014 STI Hatch
ISM

Default

Got a faceplate installed:




Had it laser cut using ponoko.com and I'm pretty pleased with how it turned out. The brushed silver is a bit shinier than I was hoping but it still looks pretty great and cleans up the gauge nicely.
gfxguy is online now   Reply With Quote
Old 03-18-2019, 12:00 PM   #8
WoodyBrain
Scooby Newbie
 
Member#: 499171
Join Date: Mar 2019
Location: Northern Delaware
Vehicle:
2005 STi
silver

Default

Very nice finish on the enclosure!

Are you still running through the Tactrix for the OBD data, or running the CAN lines straight to the Teensy?
WoodyBrain is offline   Reply With Quote
Old 03-18-2019, 12:24 PM   #9
gfxguy
Scooby Newbie
 
Member#: 316583
Join Date: Apr 2012
Chapter/Region: NWIC
Location: Seattle area
Vehicle:
2014 STI Hatch
ISM

Default

Quote:
Originally Posted by WoodyBrain View Post
Very nice finish on the enclosure!

Are you still running through the Tactrix for the OBD data, or running the CAN lines straight to the Teensy?
Thanks! I'm still using the Tactrix for now. I ordered and received both K-line and CAN transceiver chips so I'll give those a shot eventually, although it's not currently my top priority. Right now I'm using K-line through the Tactrix so that it works on an unpatched ECU; I like having that option, so as long as I can get enough bandwidth out of K-line, I think I'll stick with that.
gfxguy is online now   Reply With Quote
Old 03-18-2019, 05:16 PM   #10
Haive_Music
Scooby Newbie
 
Member#: 493578
Join Date: Nov 2018
Location: TN
Vehicle:
2017 STI
White

Default

Wow, this is really, really cool! Fantastic work!

I'm really interested in learning how to make one of these myself, but I actually would like to make one that's kind of the opposite - similar to your original idea. Something very, very small and kind of hidden/inconspicuous that could display just the FBKC, FLKC, and the DAM. The additional logging if a knock event was discovered would be fantastic too.

I already have an Access Port, but the thing is so damn big. I don't want something like that hanging off my dash all the time, or wires running all over.


How much did this project run you? Do you have any sort of technical data/writeup you could do on how someone can do this themselves? I'm not sure if this is even compatible with a 17 model?
Haive_Music is offline   Reply With Quote
Old 03-18-2019, 06:25 PM   #11
gfxguy
Scooby Newbie
 
Member#: 316583
Join Date: Apr 2012
Chapter/Region: NWIC
Location: Seattle area
Vehicle:
2014 STI Hatch
ISM

Default

Quote:
Originally Posted by Haive_Music View Post
Wow, this is really, really cool! Fantastic work!
Thanks!

Quote:
I'm really interested in learning how to make one of these myself, but I actually would like to make one that's kind of the opposite - similar to your original idea. Something very, very small and kind of hidden/inconspicuous that could display just the FBKC, FLKC, and the DAM. The additional logging if a knock event was discovered would be fantastic too.

I already have an Access Port, but the thing is so damn big. I don't want something like that hanging off my dash all the time, or wires running all over.

How much did this project run you? Do you have any sort of technical data/writeup you could do on how someone can do this themselves? I'm not sure if this is even compatible with a 17 model?
Just counting the parts that are in the actual gauge (not counting the Tactrix), it's around $70-80+tax in parts:
$35 Teensy 3.6
$13 LCD
$10 Faceplate (more if you don't use Ponoko's free trial)
$1 USB cable ($13 for a pack of 12)
$4 Enclosure ($13 for a pack of 10, and I went through a couple)
$2 USB plug ($3.50 for pack of 2)
$5 Misc hardware, headers, wire, protoboard, etc.
$? SD card I had lying around

I haven't written anything up yet, but I'll do my best to answer any questions. For starters you could look at this thread, which does go into more detail, and describes a way of doing this using K-line without a Tactrix:

https://www.clubwrx.net/forums/tutor...g-arduino.html

One thing to note is that K-line isn't supported on 2015+ models, so you have to use CAN bus. That's pretty easy through the Tactrix, but if you don't have one (and don't want to buy one) then Teensy 3.6 has CAN bus support built in, along with libraries to use it. You do still need to use a CAN transceiver chip like the SN65HVD230 though. (I do have this chip but haven't tried using it yet.)

HTH!
gfxguy is online now   Reply With Quote
Old 03-18-2019, 09:48 PM   #12
Haive_Music
Scooby Newbie
 
Member#: 493578
Join Date: Nov 2018
Location: TN
Vehicle:
2017 STI
White

Default

Quote:
Originally Posted by gfxguy View Post
Thanks!



Just counting the parts that are in the actual gauge (not counting the Tactrix), it's around $70-80+tax in parts:
$35 Teensy 3.6
$13 LCD
$10 Faceplate (more if you don't use Ponoko's free trial)
$1 USB cable ($13 for a pack of 12)
$4 Enclosure ($13 for a pack of 10, and I went through a couple)
$2 USB plug ($3.50 for pack of 2)
$5 Misc hardware, headers, wire, protoboard, etc.
$? SD card I had lying around

I haven't written anything up yet, but I'll do my best to answer any questions. For starters you could look at this thread, which does go into more detail, and describes a way of doing this using K-line without a Tactrix:

https://www.clubwrx.net/forums/tutor...g-arduino.html

One thing to note is that K-line isn't supported on 2015+ models, so you have to use CAN bus. That's pretty easy through the Tactrix, but if you don't have one (and don't want to buy one) then Teensy 3.6 has CAN bus support built in, along with libraries to use it. You do still need to use a CAN transceiver chip like the SN65HVD230 though. (I do have this chip but haven't tried using it yet.)

HTH!
Awesome info! I've sent you a PM! Really interested in making a canbus version of this, and trying to find somewhere to flush-mount the screen in the vehicle.
Haive_Music is offline   Reply With Quote
Old 03-19-2019, 12:32 AM   #13
gfxguy
Scooby Newbie
 
Member#: 316583
Join Date: Apr 2012
Chapter/Region: NWIC
Location: Seattle area
Vehicle:
2014 STI Hatch
ISM

Default

BTW, if you have an Android phone that you already mount in your car you should check out BtSsm; it might be an easier way to do what you want. https://www.btssm.com/
gfxguy is online now   Reply With Quote
Old 03-19-2019, 11:34 AM   #14
Haive_Music
Scooby Newbie
 
Member#: 493578
Join Date: Nov 2018
Location: TN
Vehicle:
2017 STI
White

Default

Unfortunately, I don't have access to an android phone.

I'm still blown away by how responsive this is. The factory boost gauge in the car is quite laggy. It's too bad the factory display does so much more on the 15+ models, as this would be an awesome replacement for it.


I take note that you mention the k-line works on an unpatched ECU. Is this something that doesn't need to be done if the ECU is already outputting CAN data?
I'm left wondering what is going to have to be changed from say how you utilized the data stream from the K-line vs Canbus? And also, where is the Teensy getting it's data in put from - is it coming from a USB connection from the Tactrix - or is it coming off the 2.5mm stereo MTS data bus output? Is this output method the same for both K-Line and Canbus?

Last edited by Haive_Music; 03-19-2019 at 03:13 PM.
Haive_Music is offline   Reply With Quote
Old 03-19-2019, 03:47 PM   #15
gfxguy
Scooby Newbie
 
Member#: 316583
Join Date: Apr 2012
Chapter/Region: NWIC
Location: Seattle area
Vehicle:
2014 STI Hatch
ISM

Default

Quote:
Originally Posted by Haive_Music View Post
Unfortunately, I don't have access to an android phone.

I'm still blown away by how responsive this is. The factory boost gauge in the car is quite laggy. It's too bad the factory display does so much more on the 15+ models, as this would be an awesome replacement for it.
It took some work to make the display update code fast enough (I'm limited by K-line bandwidth at about 30 FPS currently; I could get closer to 60 if I switched to CAN). The framerate of the OEM gauge seems fairly high, judging by the smoothness of the needle movements, so I'm guessing that it's filtering the data to make it less jumpy, which decreases responsiveness.

Quote:
I take note that you mention the k-line works on an unpatched ECU. Is this something that doesn't need to be done if the ECU is already outputting CAN data? I'm left wondering what is going to have to be changed from say how you utilized the data stream from the K-line vs Canbus?
The protocol that I'm using is SSM (Subaru Select Monitor) which is documented here:

http://www.romraider.com/index.php/R...er/SsmProtocol

It's a little different over CAN bus; that's described here:

https://subdiesel.wordpress.com/gene.../ssm2-via-can/

There are two types of addresses that you can read with SSM; standard parameters and extended parameters. Standard parameters work with any ECU (patched or unpatched) but are limited to the set in the <parameters> block in the RomRaider logger defs file:

https://raw.githubusercontent.com/Ro...ard/logger.xml

Extended parameters are basically raw memory addresses in the ECU's RAM, so you're peeking at what the ECU is doing in real-time (at least, that's my understanding). You can read these on any ECU using K-line (as long as the ECU supports K-line), but when using CAN, you need to apply a patch to the ECU ROM using EcuFlash. Extended param addresses vary from ECU to ECU, so your ECU needs to have been defined by somebody. Extended params are defined in the <ecuparams> in the logger defs file.

One big caveat is that the above applies only to stock ROMs. I know that the AP modifies the ROM code to support live tuning changes, and I have no idea what other changes they make that could impact the above. The RomRaider FAQ says:

Quote:
Sometime in 2008, COBB also began locking out the ECU after a firmware update to their AccessPORT version 2. This prevents you from reading/flashing the ROM with EcuFlash and possibly even logging with RomRaider. In order to use EcuFlash, you must unmarry the AccessPORT from the ECU. Even if you own an AccessPORT version 1, it is not recommended that you use EcuFlash/RomRaider to tune a COBB ROM due to the way COBB has setup up their real-time tuning.
(From http://romraider.com/index.php/Docum...aiderFAQ#toc35)

So first I would see if you can get RomRaider logging to work, for the parameters you're interested in.

Assuming it does, you can look at what RomRaider is sending over the USB port using WireShark, which is what I did to help me reverse-engineer the protocol that's implemented by the Tactrix J2534 DLL on Windows. It's also implemented by this open-source J2534 driver for linux: https://github.com/NikolaKozina/j2534 -- that was helpful for figuring out what the various messages meant.
gfxguy is online now   Reply With Quote
Old 03-19-2019, 11:51 PM   #16
Haive_Music
Scooby Newbie
 
Member#: 493578
Join Date: Nov 2018
Location: TN
Vehicle:
2017 STI
White

Default

Ahh that may throw a wrench in the entire thing right there since I'm on an AP3.

Well, you've definitely given some helpful info, I think before I go any further or ask any more questions, I'll have to see if anything can be pulled out with RR like you said.

Thanks for all your help, none the less! Truly appreciate it. Your knowledge on all of this is incredible.
Haive_Music is offline   Reply With Quote
Old 07-08-2019, 01:36 AM   #17
gfxguy
Scooby Newbie
 
Member#: 316583
Join Date: Apr 2012
Chapter/Region: NWIC
Location: Seattle area
Vehicle:
2014 STI Hatch
ISM

Default

It's been a while since I updated this thread, but I've been continuing to use this gauge every day, and other than a flaky solder connection that was a bit of a pain to track down, it's been working great. I've been using it to log and adjust my tune (I've added an AEM intake, Grimmspeed EBCS, and did the fuel line stumble fix, all of which required tune adjustments). One downside of the knock display is that I spent way too much time trying to get rid of low load/small correction knock, until I finally said screw it and adjusted the gauge code to only display knock events above 1.25 g/s (unless the corrections are < -3 degrees). Much happier now.

I'm planning to install a downpipe and wideband soon, and I wanted to be able to display and log AFR, so I made a new wiring harness which lets me feed the 0-5V analog signal from the wideband controller to the Teensy. Previously I was using two USB cables, which was already too much, so this reduces it down to a single SATA cable which has a not-too-huge connector and just enough conductors (5) for my needs: GND, +5V, USB D+/D- for the Tactrix, and AFR analog. I'm using a simple voltage divider to step the wideband voltage down since Teensy 3.6 is a 3.3V-only board.



gfxguy is online now   Reply With Quote
Old 07-25-2019, 06:07 PM   #18
gfxguy
Scooby Newbie
 
Member#: 316583
Join Date: Apr 2012
Chapter/Region: NWIC
Location: Seattle area
Vehicle:
2014 STI Hatch
ISM

Default

Downpipe and wideband are in, and gauge now logs and displays AFR.

gfxguy is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

All times are GMT -4. The time now is 09:17 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Powered by Searchlight © 2019 Axivo Inc.
Copyright ©1999 - 2017, North American Subaru Impreza Owners Club, Inc.