3 4 5
Keith Tanner
Keith Tanner MegaDork
7/2/22 1:18 a.m.

I've been beavering away at this, which is appropriate given that it's July 1st.

First, I decided it would be a lot more convenient if I could emulate the car on the bench. So I picked up a signal generator.

Which was a transparent excuse to do cool sci-fi things with the oscilloscope.

But really, I needed it to do this.

Which is a VSS signal for an NA Miata going about 13 mph. I spent some time trying to extract good data from these signals and made...some progress. It's been a challenge to get a consistent frequency reading quickly enough, especially in the 4000-7000 rpm range. I'm trying to match the GM CAN standard of an RPM signal every 125 ms. If this was being driven by an aftermarket ECU, it would be simple. But I'm starting with the worst case of a pre-OBD-II stock Miata instead.

Then this showed up in the mail, so I decided to check it out.

Since it uses a standard addressable LED, it was just a matter of telling my system what standard it was, bolting it up and running a little demo. The gauge face is just a junky home-made style with no masking on the back that's only half installed, so we can certainly clean that up somewhat. But that looks promising. Full RGB control of 44 "ring" LEDs, backlighting and needle lighting.

I also discovered that if you set the four needle lights to different colors, you can get some really trippy behavior.

 

Concept proven. The next step is to get some real gauge faces made, I think.

Pete Gossett (Forum Supporter)
Pete Gossett (Forum Supporter) MegaDork
7/2/22 6:36 a.m.

In reply to Keith Tanner :

Trippy Needles sounds like a bunch of kids in the 90's heard the Velvet Underground for the first time & decided to start a band. :)

I really like the way this is turning out!

Keith Tanner
Keith Tanner MegaDork
7/2/22 8:24 p.m.

Progress on the VSS and tach reading, so we're moving along. Lots of interesting possibilities to play with, that's for sure. 

Keith Tanner
Keith Tanner MegaDork
7/5/22 1:30 a.m.

Okay, so moving along with my plan of making this a peripheral...

We have the LED ring pretty much nailed, I think. The next step is to come up with a plug-in driver board for it. The LED uses 5V logic but a lot of microcontrollers use 3.3V. So that means a level shifter. Didn't take long to put this together. The level shifting breakout is actually capable of handling four channels but that's all I had :) My prototypes are being made out of easy-to use modular pieces called breakouts, that's one in red. Red means I sourced it from Sparkfun, who happen to be in CO so shipping is super-fast.

And, uh, if you have a CAN-equipped car this is all you need. An M4 CAN "Feather" from Adafruit ($25 these days), my level shifter board and the LED PCB that's currently installed in the cluster. That's the same microcontroller that's running everything in my current cluster. It literally plugs into my level shifting extension board, which is what Adafruit calls a "FeatherWing".

Sweet. But the goal is to have this thing read the signals coming into to a stock cluster. So I spent some time finalizing my inputs and outputs. I ended up with 4 analog 0-12v inputs (dash lighting, coolant gauge, fuel gauge, oil pressure for example), 2 digital 12v (ie, the tach) and 2 digital 5V (vehicle speed). The 0-12v analog inputs are actually more like 0-15v just in case the alternator gets a little excited.

Only 4 analog inputs? That's the limit on the RP2040 Feather I'm using for testing. With the standard Stemma QT connector on the Feather, I can add more inputs with little daughter boards but this will work. AFR and boost level are the most common requests, and it looks like the standard GM 3 bar MAP sensor has a 0-5V output while most widebands have a 0-5V. One $10 ADC (analog to digital converter) that handles 4 channels up to 5V, plug it in and voila.

Time to use the breadboard for a gut check. This always looks like mayhem. But we've got three voltage levels (3.3V, 5V, 12V), 8 inputs, a couple of outputs and other random stuff going on.

For the prototype, I had to go with a double-wide Wing footprint in order to fit everything in. That's the penalty for using nice neat breakouts. I spent some time paying attention to wire routing as a reaction to looking at the breadboard :)

And voila, all complete including an onboard voltage converter that provides enough 5V juice to feed the LED array at full blast. I managed to get everything into the footprint which is yay.

All assembled with a Feather (a $12 RP2040 unit because we don't need CAN), the level shifting Wing and the I/O double Wing. This should be everything I need to run a single LED ring like in the previous demo. If I wanted to run two (one behind the tach and one behind the speedo), I'd have to watch my power consumption. Each of those clusters can pull almost 3A. I never came close in my demo, probably less than half that.

Cute little thing. Not bad for a hand-soldered prototype. If I wanted to add control of the two needles, I could simply plug in a $20 motor control board. That's what I did on my own dash.

Next step is to actually hook it up to a cluster and make sure it works. It's all good on the bench so far, but you know how that goes.

 

Keith Tanner
Keith Tanner MegaDork
7/8/22 10:39 a.m.

A couple more bench tests to make sure it's working the way I think it should. Here it is living with nothing more than 12v, ground, VSS and tach. The screen is plugged in temporarily to make it easy to ensure everything is working, but it does a good job of illustrating the modular nature of what we're working with.

Next step is to turn those hand-built prototypes into proper circuit boards. I'm starting to learn how to use KiCAD, which is a whole new adventure!

Keith Tanner
Keith Tanner MegaDork
7/13/22 11:11 a.m.

Heads up for those who are interested - I'm doing another video on the progress, mostly because I'm scheduled to do a video and I'm more excited about this than anything else I'm working on. Besides, it has blinky lights and cool pieces of equipment.

If you want to watch it live, tune in to Flyin' Miata's Facebook page at 2:00 PM Mountain on Thursday and you can ask questions in real time. We'll post it to YouTube the next day and I'll link it here.

APEowner
APEowner UltraDork
7/13/22 12:14 p.m.
Keith Tanner said:

Heads up for those who are interested - I'm doing another video on the progress, mostly because I'm scheduled to do a video and I'm more excited about this than anything else I'm working on. Besides, it has blinky lights and cool pieces of equipment.

If you want to watch it live, tune in to Flyin' Miata's Facebook page at 2:00 PM Mountain on Thursday and you can ask questions in real time. We'll post it to YouTube the next day and I'll link it here.

In for the blinky lights.

MadScientistMatt
MadScientistMatt UltimaDork
7/13/22 6:09 p.m.

I'll have to take another look. The Dart's speedometer is not working (come to think of it, neither is the fuel gauge or ammeter, although the last one is bypassed due to wiring mods), and I'm considering replacing the needle with a LED sweep at this point.

frenchyd
frenchyd MegaDork
7/13/22 6:31 p.m.

I hope this hasn't been brought up but our own Calvin Nelson  has a digital  dash in his Studebaker. But I love the idea of a Chronometric tach.  Is this something we can talk Megasquirt into doing for us?   Heck I'd pay for that feature.    

Keith Tanner
Keith Tanner MegaDork
7/13/22 8:20 p.m.

I have accidentally created the chronometric tach a few times when I've done something with the coding that's overloaded the processor. The refresh rate drops way down and voila, chrono tach :)

It actually would be pretty easy to emulate. My current setup is reading the tach pulses and driving the LEDs in response, but I could easily have it drive the needle as well using the standard air core gauges. Just drop the update time to 500 ms instead of 12.5ms like I'm using and voila. Although IIRC they acted slightly differently going down than up, right?

If you wanted to emulate a chronometric tach from a functional air core one, I can give you a parts list and some code. It'll cost about $25 to buy the parts if memory serves. Might be $35.

Keith Tanner
Keith Tanner MegaDork
7/13/22 9:07 p.m.

Duh, it's not even that hard. I forgot a friend and I were working on that on the side. Watch this space :)

Keith Tanner
Keith Tanner MegaDork
7/15/22 11:07 a.m.

As promised/threatened. Lots of questions (in later FB comments, post-broadcast) about MS2 compatibility, so I guess I need to make a very clear guide on how to get this working with whatever the MS2 CAN implementation is. Matt, help? ;)

 

MadScientistMatt
MadScientistMatt UltimaDork
7/15/22 11:40 a.m.

In reply to Keith Tanner :

Best bet is to use 11 bit CAN broadcasting. There's also a 29 bit protocol, but it's a bit weird, uses part of the address as an instruction. Here's specs on 11 bit.

http://www.msextra.com/doc/pdf/Megasquirt_CAN_Broadcast.pdf

There is also a third party Arduino library out there that may help. 

https://www.msextra.com/forums/viewtopic.php?t=73129&hilit=Arduino

 

 

Keith Tanner
Keith Tanner MegaDork
7/15/22 11:47 a.m.

I just needed the message definitions, listening to an 11 bit CAN network is pretty straightforward. Thanks!

MadScientistMatt
MadScientistMatt UltimaDork
7/15/22 3:34 p.m.
Keith Tanner said:

I just needed the message definitions, listening to an 11 bit CAN network is pretty straightforward. Thanks!

You're welcome. The end user just needs to make sure 11 bit broadcast mode is turned on in TunerStudio, and stay away from the 29 bit mode if you want to keep your sanity.

3 4 5
Our Preferred Partners
5oekCG9IVxQ4yWl6uderXFKSynGqk3MhMTqaS4XTqEGFsHRU59SlARM4IH3h5UUu