STACK'd Miata Arduino-Controlled Gauge Cluster - Miata Turbo Forum - Boost cars, acquire cats.

Welcome to Miataturbo.net   Members
 


General Miata Chat A place to talk about anything Miata

Reply
 
 
 
LinkBack Thread Tools
Old 03-27-2015, 12:52 AM   #1
Junior Member
Thread Starter
iTrader: (9)
 
Join Date: Dec 2011
Location: SFBay
Posts: 339
Total Cats: 39
Default STACK'd Miata Arduino-Controlled Gauge Cluster

This has been my project over the past 4 months or so. I thought I should make a thread to document the project.

After the SweepOTron board, my previous project, I learned the basics of electronics design and layout.

As I was designing that board, I was thinking about how cool it would be to emulate the non-linear compressed tachometer action of a STACK cluster for my track NB1:



After I got the SweepOTron board on my AWD cluster working and installed in my MSM, I decided to try and take on the project of making a custom cluster for the NB1.

I thought I would have to use some kind of microcontroller to make the scale non-linear. I thought I could use an Arduino, but had never used a programmable microcontroller like it before. I liked the small ones that Sparkfun sold, so I ordered a couple.

I also thought I could use the same gauge controller that I used on the SweepOTron by forcing a voltage from the microcontroller to manually point the needle where I wanted it, but it turned out there was an even better option. Theres another gauge controller that could be controlled via SPI serial connection, which it turns out the Arduino supports natively.

I ordered a bunch of parts and hacked it all together until I could control the gauge from the Arduino. This was a huge coup for me, since this was uncharted territory.

I also got lucky and found that the FreqMeasure library would do exactly what I needed in terms of reading in the RPM of the engine. The RPM was fed in from the tach at 12V, but the Arduino only ran at 5V, so I used a way-overkill optocoupler circuit to drive the RPM input.


At this point, I was feeling confident enough that this would work to have Adam @ revlimiter.net make me a custom set of gauges with a compressed tachometer.

We designed some gauge faces that were a true homage to the STACK gauges

We went back and forth and finally settled on a design down to the fonts and thickness and length of the tick marks.

In the meantime, I started the layout of the actual board. I decided it was above my abilities to put the Arduino directly onto a custom board, so I designed the board to socket the Sparkfun Arduino onto a simpler board. The board, which I called SuperSweep, had an automotive 5V/12V regulator, some power stabilization caps, and the gauge controller and optocoupler. I also ran two of the general I/O pins to a separate header in case I thought of something in the future.



With the Arduino board installed







Old busted on left, new hotness on right



When the new faces arrived, I was incredibly pleased. The oil pressure gauge isn't installed in this picture because I'm using an NA gauge and sender and had to modify the housing to fit.



I had to tweak the scale and offset in the Arduino code to get it right, but it ended up working out extremely well


I also decided that since I already had the RPM input on the Arduino, I should make use of it and impement a shift light.

I found a super-bright LED that fit into a drilled-out bulb holder, and replaced the seatbelt light. I used the 6101 LED for the red shift light. I needed to solder a current limiting resistor in series, but the LED was much brighter than the incandescent bulbs.





I wrote some code so it would be steady above a certain RPM and flash at a higher RPM. I was absolutely shocked when it worked the first time.


I eventually discovered that the whole board was too deep so I couldnt mount the cluster flush, so I had to replace the connector sockets with right angle versions and replace the standoffs with slightly shorter versions to reduce the height.

Finally today I got it all put back together.





With wiring harness and CEL relocated











The cluster does a simple staging sweep on startup


And the shift light works great, though it's hard to show while revving in neutral.

Attached Thumbnails
STACK'd Miata Arduino-Controlled Gauge Cluster-st400.jpg   STACK'd Miata Arduino-Controlled Gauge Cluster-067a3099.jpg   STACK'd Miata Arduino-Controlled Gauge Cluster-067a3093.jpg   STACK'd Miata Arduino-Controlled Gauge Cluster-067a3109.jpg   STACK'd Miata Arduino-Controlled Gauge Cluster-067a3112.jpg  

STACK'd Miata Arduino-Controlled Gauge Cluster-img_20150212_175222.jpg   STACK'd Miata Arduino-Controlled Gauge Cluster-img_20150212_182123.jpg   STACK'd Miata Arduino-Controlled Gauge Cluster-img_20150221_165006.jpg   STACK'd Miata Arduino-Controlled Gauge Cluster-img_20150304_180047.jpg   STACK'd Miata Arduino-Controlled Gauge Cluster-img_20150326_175712.jpg  

STACK'd Miata Arduino-Controlled Gauge Cluster-img_20150326_175717.jpg   STACK'd Miata Arduino-Controlled Gauge Cluster-dsc01303.jpg   STACK'd Miata Arduino-Controlled Gauge Cluster-dsc01299.jpg   STACK'd Miata Arduino-Controlled Gauge Cluster-dsc01301.jpg   STACK'd Miata Arduino-Controlled Gauge Cluster-dsc01302.jpg  

STACK'd Miata Arduino-Controlled Gauge Cluster-st400.jpg   STACK'd Miata Arduino-Controlled Gauge Cluster-067a3099.jpg   STACK'd Miata Arduino-Controlled Gauge Cluster-067a3093.jpg   STACK'd Miata Arduino-Controlled Gauge Cluster-067a3109.jpg   STACK'd Miata Arduino-Controlled Gauge Cluster-067a3112.jpg  

STACK'd Miata Arduino-Controlled Gauge Cluster-img_20150212_175222.jpg   STACK'd Miata Arduino-Controlled Gauge Cluster-img_20150212_182123.jpg   STACK'd Miata Arduino-Controlled Gauge Cluster-img_20150221_165006.jpg   STACK'd Miata Arduino-Controlled Gauge Cluster-img_20150304_180047.jpg   STACK'd Miata Arduino-Controlled Gauge Cluster-img_20150326_175712.jpg  

STACK'd Miata Arduino-Controlled Gauge Cluster-img_20150326_175717.jpg   STACK'd Miata Arduino-Controlled Gauge Cluster-dsc01303.jpg   STACK'd Miata Arduino-Controlled Gauge Cluster-dsc01299.jpg   STACK'd Miata Arduino-Controlled Gauge Cluster-dsc01301.jpg   STACK'd Miata Arduino-Controlled Gauge Cluster-dsc01302.jpg  


Last edited by scenturion; 03-27-2015 at 02:54 AM.
scenturion is offline   Reply With Quote
Old 03-27-2015, 01:01 AM   #2
Junior Member
iTrader: (1)
 
Join Date: Jan 2011
Posts: 377
Total Cats: 0
Default

Awesome
3rdCarMX5 is offline   Reply With Quote
Old 03-27-2015, 01:06 AM   #3
Senior Member
 
Join Date: Dec 2004
Location: Brisbane, Australia
Posts: 1,272
Total Cats: 32
Default

This is awesome, subscribed. I've been playing with a spare NB OPG, looking at driving it with an AVR and a 0.5-4.5v pressure transducer.
timk is offline   Reply With Quote
Old 03-27-2015, 01:30 AM   #4
Senior Member
iTrader: (8)
 
Join Date: Jan 2012
Location: Azusa, CA
Posts: 1,376
Total Cats: 80
Default

Very nicely done!

The freqmeasure library is great. I used it for a shiftlight array. did you have any problems using both the freqmeasure and SPI librarys in the same program? I tried that once and got some weird errors. Also using an Arduino pro mini.
cyotani is offline   Reply With Quote
Old 03-27-2015, 01:34 AM   #5
Junior Member
Thread Starter
iTrader: (9)
 
Join Date: Dec 2011
Location: SFBay
Posts: 339
Total Cats: 39
Default

Quote:
Originally Posted by cyotani View Post
Very nicely done!

The freqmeasure library is great. I used it for a shiftlight array. did you have any problems using both the freqmeasure and SPI librarys in the same program? I tried that once and got some weird errors. Also using an Arduino pro mini.
Nope, didn't have any issues [that I noticed]. I wanted to use the pro micro at first, but the comments on the arduino forums said that it has issues working with the freqmeasure library.
I did run into some strange issues with the CS4122 and the SPI library where the device wanted LSB first, but it only worked if I set the SPI mode to MSB first
scenturion is offline   Reply With Quote
Old 03-27-2015, 01:51 AM   #6
Senior Member
iTrader: (1)
 
Join Date: Apr 2011
Location: Columbia, SC
Posts: 1,342
Total Cats: 78
Default

Not gunna lie, I really like how it sweeps when you start the car. lol.
Schuyler is offline   Reply With Quote
Old 03-27-2015, 01:56 AM   #7
Junior Member
Thread Starter
iTrader: (9)
 
Join Date: Dec 2011
Location: SFBay
Posts: 339
Total Cats: 39
Default

Quote:
Originally Posted by Schuyler View Post
Not gunna lie, I really like how it sweeps when you start the car. lol.
Hah yeah, its a small thing but I thought it was cool. I previously owned a GTI, and the "instrument staging" was a big thing in that scene.


Also: funny story. When I put it all together today I found that the car wouldn't turn off. I turned the key off and removed it, but the car kept running. I had to remove the cluster to stop the car.

Turns out, the CEL relocation wire from IGN wore through the tape underneath the light, connecting IGN and +. Effectively, I hotwired my own car

Attached Thumbnails
STACK'd Miata Arduino-Controlled Gauge Cluster-img_20150308_135048.jpg  

Last edited by scenturion; 03-27-2015 at 02:24 AM.
scenturion is offline   Reply With Quote
Old 03-27-2015, 02:22 AM   #8
Senior Member
iTrader: (1)
 
Join Date: Apr 2011
Location: Columbia, SC
Posts: 1,342
Total Cats: 78
Default

Will this be something you're selling?
Schuyler is offline   Reply With Quote
Old 03-27-2015, 02:53 AM   #9
Junior Member
Thread Starter
iTrader: (9)
 
Join Date: Dec 2011
Location: SFBay
Posts: 339
Total Cats: 39
Default

Quote:
Originally Posted by Schuyler View Post
Will this be something you're selling?
Nah, it's a pretty complicated part and not really meant for public consumption. You have to be willing to get custom gauge faces and then be competent enough in programming to modify my Arduino code to work with your gauge face design.

I have a single spare if anyone is hugely interested, but it's definitely not for the average Miata enthusiast.
scenturion is offline   Reply With Quote
Old 03-27-2015, 05:21 AM   #10
Elite Member
iTrader: (1)
 
Join Date: Jun 2006
Location: Warrington/Birmingham
Posts: 2,658
Total Cats: 39
Default

Man, that is awesome work.

Many props to you sir.
richyvrlimited is offline   Reply With Quote
Old 03-27-2015, 11:46 AM   #11
Junior Member
iTrader: (2)
 
Join Date: Apr 2014
Location: Mountain View, CA
Posts: 362
Total Cats: 21
Default

Props, that is awesome! I have a new mk7 GTI and love how the gauges sweep on start up. Love the stealthy shift light too.
OneTwo is offline   Reply With Quote
Old 03-28-2015, 03:35 PM   #12
Senior Member
iTrader: (1)
 
Join Date: Mar 2010
Location: Bay Area, CA
Posts: 695
Total Cats: 140
Default

This is really cool and relevant to a side project I'm working on as well mind sharing your 12to5v conversion parts/schematics?

EDIT: The Pro mini is also on sale today at sparkfun. Just an FYI
gesso is offline   Reply With Quote
Old 03-28-2015, 07:51 PM   #13
Junior Member
Thread Starter
iTrader: (9)
 
Join Date: Dec 2011
Location: SFBay
Posts: 339
Total Cats: 39
Default

Quote:
Originally Posted by gesso View Post
This is really cool and relevant to a side project I'm working on as well mind sharing your 12to5v conversion parts/schematics?

EDIT: The Pro mini is also on sale today at sparkfun. Just an FYI
Thanks, just bought two, which should cover the two spare boards I have.
Anyone want one?

For the power supply circuit, I used the now-discontinued CS8156.
It's perfect for what I needed - dual 12V and 5V regulation and qualified for automotive use.

Rochester Electronics has these parts on closeout but has a min-spend of like $50.

I bought a dozen of them as I intend to use them in all future potential automotive electronics projects. I can probably spare one if that's all you need.

The schematic is simple, I mostly followed the reference design. I put a .1uF ceramic bypass on Vin, and put separate 22uF 25V electrolytics on the 5V and 12V lines. According to everything I read (or tried to read), matching the impedance of the stabilization caps to the rest of the downstream circuit is supposed to be important, but the process for getting it right required more patience and effort than I had, so I ignored it. In addition, the Pro Mini has its own built in stabilization cap, so the effective capacitance on the 5V line is higher (and impedance is lower I guess), but it doesn't seem to matter in the least.
I also put a 20k resistor on ENA to make sure it didnt sink too much current.

Originally I had ENA connected to IGN and Vin connected to +, but it resulted in some weird behavior I couldn't diagnose where the Arduino wouldnt always reset properly. I ended up connecting both to IGN and it works fine now.

I'd be happy to send you the actual schematic but I need to clean it up a bit first.
scenturion is offline   Reply With Quote
Old 03-28-2015, 07:57 PM   #14
SADFab Destructive Testing Engineer
iTrader: (5)
 
aidandj's Avatar
 
Join Date: Apr 2014
Location: Beaverton, USA
Posts: 17,992
Total Cats: 1,457
Default

12v to 5v is really simple. Radio shack sells a 5v regulator that will take 5-35v.

Any chance of posting your schematics and board design files? I am interested in this for a future project.
aidandj is offline   Reply With Quote
Old 03-28-2015, 09:30 PM   #15
Junior Member
Thread Starter
iTrader: (9)
 
Join Date: Dec 2011
Location: SFBay
Posts: 339
Total Cats: 39
Default

Quote:
Originally Posted by aidandj View Post
12v to 5v is really simple. Radio shack sells a 5v regulator that will take 5-35v.
Oh, I think I misunderstood what Geoff was asking about. If you just need regulated 5V from automotive supply, there's a bunch of better automotive duty regulators out there. Most modern regulators don't need the bypass/stabilization caps that I have in my design, and you can get them sized to your exact power draw in either through-hole or SMT.
Try out the ONSemi LDO recommendation tool here or look through and sort all of the options here.

Quote:
Originally Posted by aidandj View Post
Any chance of posting your schematics and board design files? I am interested in this for a future project.
I hadn't really thought about it as I didnt think anyone would use them, but I guess I'd consider posting them under a Creative Commons Non-Commercial license or something if there was enough interest. I would need to re-do the schematic with a frame, notes, pin/net names and a reasonable layout so it might stand a chance of making sense to anyone who reads it.
To be honest, the schematic and board design are pretty simple; Theres only about a dozen parts including standoffs and connectors. The far trickier part is the Arduino code, which took much longer to get right than the schematic and board layout. I did a decent job of documenting that code, so it would be easier to post.
scenturion is offline   Reply With Quote
Old 03-28-2015, 09:33 PM   #16
SADFab Destructive Testing Engineer
iTrader: (5)
 
aidandj's Avatar
 
Join Date: Apr 2014
Location: Beaverton, USA
Posts: 17,992
Total Cats: 1,457
Default

There are some good open source sites around. I'm most interested in the board files so I don't have to mess around with the cad design. The schematic and the code is the easy part for me.
aidandj is offline   Reply With Quote
Old 03-29-2015, 04:33 AM   #17
Junior Member
 
Join Date: Feb 2014
Location: Chicago, IL
Posts: 95
Total Cats: 1
Default

That is really awesome, huge props to you man!
AdrianD2 is offline   Reply With Quote
 
 
Reply

Related Topics
Thread Thread Starter Forum Replies Last Post
3rd Time's a Charm...hopefully. zephyrusaurai Meet and Greet 2 09-28-2015 11:59 PM
wiring wideband ground to battery terminal btabor ECUs and Tuning 10 09-28-2015 06:33 PM
Another Alternator thread ihiryu General Miata Chat 9 09-28-2015 11:22 AM
Project DDoS: '99 "Budget" boost build ProjectDDoS Build Threads 1 09-09-2015 02:52 PM
Obligatory "N00B" post! D_Breezy Meet and Greet 5 09-08-2015 06:37 PM


Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



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