Miata Turbo Forum - Boost cars, acquire cats.

Miata Turbo Forum - Boost cars, acquire cats. (https://www.miataturbo.net/)
-   MEGAsquirt (https://www.miataturbo.net/megasquirt-18/)
-   -   made my own canbus gauge (https://www.miataturbo.net/megasquirt-18/made-my-own-canbus-gauge-76481/)

gooflophaze 12-10-2013 10:57 AM

made my own canbus gauge
 

If I had to do it over again, I probably would have done it differently.

But here's the (close to) end result of my gauge build- it uses an arduino mega, mcp2515 spi -> canbus transceiver, adafruit oled screen and neopixel ring. I've got a few more touches to put on it - like creating a 3rd and 4th menu (in the video you can see I scroll through my placeholders). I originally wanted an "at a glance" gauge to see if my oil was up to temp before I started flogging it, or something more visually distracting if I was beginning to overheat. I added the scrolling histogram for shits and giggles (I have this feature in my PLX Gauge - but I don't use it much).

I've still got a list of todo's - some easy, some difficult
-- vital warnings - if, say, oil pressure is < 20psi at > 2000rpm, or coolant temp is ever > 230 degrees, automatically change gauge to display that value.
-- outer ring shift light - if TPS > 90% and RPM > 7000, turn the entire ring into a shift light
-- wire PLX sensors to megasquirt (they have a 0-5v reference that I can datalog), assign LED's to EGT, Oil pressure, Oil Temp
-- have a go at reading the LC-1 serial stream and writing that to megasquirt; no more ground offset worries (basically doing what JB has done with his canbus IO extender). If this goes together reasonably smooth, I might have a go with trying to capture the PLX gauges stream as well. I'm waiting on some parts right now, will probably try and get this working around christmas.

I'm also (attempting) to document this, afaik I'm the first to get a non-native canbus speaking microcontroller (I looked at https://code.google.com/p/ms-can-dis...AN128.pde?r=56 a lot) to talk with a megasquirt. But I keep adding features and that keeps pushing the documentation back...

At the risk of begging for scope creep - what other functions you think would be cool to add to something like this?

karter74 12-10-2013 06:39 PM

I like it!

Can you issue commands to megasquirt through the can? Like enable logging? Would be cool to change the launch control RPM on the fly.

gooflophaze 12-10-2013 08:13 PM

I'd have to look at the MS3 code closer - I can write to variables - so on the fly I could change the spark/fuel/boost table (well.. I'd have to figure out tables first...). But it's sort of like cracking open your tachometer and pushing the needle to 6000RPM and expecting the engine to respond.

240_to_miata 12-10-2013 08:22 PM

I made a simple OLED gauge with my MS1 using serial (obviously) but gave up after realizing how insanely slow the update was, and how labor intensive it was considering MS1 is so outdated.

Awesome project.

Zaphod 12-11-2013 02:08 AM

I also do like that quite a lot...

I was always looking for a affordable Megasquirt CAN gauge for the gauge cluster... Keep up the good work!

richyvrlimited 12-11-2013 03:57 AM

X2 on the good work.

I really want an intuitive gauge over CANBus for my own car.

EDIT: As for functions, if you were to integrate this into an OEM NA dash cluster. a small 4DGL display would fit nicely where the seatbelt light/Handbrake light EML etc are.

So gut that area and fit the display there, but add 4 inputs into the Adurano to know when the handbrake is on etc.

When they're on the gauge interrupts whatever is showing and displays the appropriate light fuill screen, then after a delay (2-3 seconds), minimizes it to a small icon in one of the corners of the display.

gooflophaze 12-11-2013 05:23 PM

1 Attachment(s)
Ah - but I have a KG works... not a bad idea though.

https://www.miataturbo.net/attachmen...ine=1386800631

Total(ish) cost for these bits...

$59 for the mega arduino https://www.sparkfun.com/products/11061
$45 for the canbus shield https://www.sparkfun.com/products/10039
$25 oled 1.3 128x64 screen Monochrome 1.3 128x64 OLED graphic display ID: 938 - $24.50 : Adafruit Industries, Unique & fun DIY electronics and kits
$15 for a buck converter to 5v Mini DC/DC Step-Down (Buck) Converter - 5V @ 1A output [TSR12450] ID: 1065 - $14.95 : Adafruit Industries, Unique & fun DIY electronics and kits
$10 neopixel ring NeoPixel Ring - 16 x WS2812 5050 RGB LED with Integrated Drivers ID: 1463 - $9.95 : Adafruit Industries, Unique & fun DIY electronics and kits
$8 for cheap ebay gauge
$3 rotary encoder
-----
165ish

So - a bit pricey, but not too much more than an autometer. I should be receiving the max232 and a nifty i2c uart ($20) which'll let me poll the LC-1 next week.

It could definitely be done for cheaper if you didn't limit yourself to arduino - I did because I wanted to document how it was done.

Zaphod 12-12-2013 01:18 AM

1 Attachment(s)
Do so much want...

https://www.miataturbo.net/attachmen...ine=1386829124

thenuge26 12-12-2013 09:23 AM


Originally Posted by Zaphod (Post 1081940)
Do so much want...

I'll build you one, and trade you for your cluster with the maxigauge.

Zaphod 12-12-2013 10:05 AM

I hate to say that I relocated the Maxigauge to the DIN cutout in the center console... (but I will re-relocate it into the dash, or will make a new dash with such a nice Canbus gauge...)

JasonC SBB 12-13-2013 10:32 AM

Good stuff!

What is the rotary encoder for?

And what is the purpose of using CANbus, compatibility with CANbus cars/ECUs?

gooflophaze 12-13-2013 01:14 PM

So after pricing out my BOM and realizing how much I spent making it, I went back through and decided to see how much a CAN-native MCU would run - this would eliminate the $45 can shield and $59 Mega. After browsing digikey for awhile, I found that the at90can64/128 have 4k of SRAM and costs $12 a pop. This is clearly the "right" way to do it.

That's a hell of a difference. Almost makes me want to try and design my first PCB. I did, after all, just order an atmel jtagice3 last night to update my CNC machine...

So - CAN - I started on this while I was still using Serial to tune on my MS2, and didn't want to inhibit tunerstudio in any way. I originally was going to mount a permanent slot in a DIN space, with buttons to set stuff like launch control and table switching (before I really understood how a good tune doesn't need the power/economy settings). MSCan isn't compatible with any other CANbus standard though (except the broadcast functions, I think).

The rotary encoder is the navigation system - push to cycle through different displays/select, twist for different variables.

JasonC SBB 12-13-2013 03:00 PM

I didn't understand your answer about CAN bus. Must be my unfamiliarity with MS2.

shuiend 12-13-2013 03:18 PM

Just remember that MS does not use the standard CANbus protocol. I don't have all the details but many times at the Mega Meets I have heard them talking about it being slightly different then the standard canbus.

gooflophaze 12-18-2013 12:26 PM

I got my MAX232 yesterday and started reading the LC1 datastream, only to have my (old, busted) O2 sensor take a crap (Error 4, charge pump). Anyone have a quick hack to get this to start reading again? Trying to reset and do a heater calibration doesn't appear to have any effect. I've got another (old, busted) sensor (hoarding) at my parents place but that's 60 miles away and I'm lazy. I guess I could work on the todo's listed above..

Sorry - I had a bit of ADD hit when talking about CANBus. In MS, it's completely incompatible with OEM CANBus schemas; MSCan seems written for ease of implementation rather than conforming to any standard.

And I used CAN because I didn't want to have to unplug my gauge to load up tunerstudio. :)


All times are GMT -4. The time now is 08:06 AM.


© 2024 MH Sub I, LLC dba Internet Brands