General Miata Chat A place to talk about anything Miata

STACK'd Miata Arduino-Controlled Gauge Cluster

Thread Tools
 
Search this Thread
 
Old 03-26-2015, 11:52 PM
  #1  
Junior Member
Thread Starter
iTrader: (9)
 
scenturion's Avatar
 
Join Date: Dec 2011
Location: SFBay
Posts: 408
Total Cats: 61
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 01:54 AM.
scenturion is offline  
Old 03-27-2015, 12:01 AM
  #2  
Junior Member
iTrader: (1)
 
3rdCarMX5's Avatar
 
Join Date: Jan 2011
Location: PORTLAND
Posts: 421
Total Cats: 5
Default

Awesome
3rdCarMX5 is offline  
Old 03-27-2015, 12:06 AM
  #3  
Senior Member
 
timk's Avatar
 
Join Date: Dec 2004
Location: Brisbane, Australia
Posts: 1,278
Total Cats: 37
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  
Old 03-27-2015, 12:30 AM
  #4  
Senior Member
iTrader: (8)
 
cyotani's Avatar
 
Join Date: Jan 2012
Location: Azusa, CA
Posts: 1,407
Total Cats: 116
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  
Old 03-27-2015, 12:34 AM
  #5  
Junior Member
Thread Starter
iTrader: (9)
 
scenturion's Avatar
 
Join Date: Dec 2011
Location: SFBay
Posts: 408
Total Cats: 61
Default

Originally Posted by cyotani
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  
Old 03-27-2015, 12:51 AM
  #6  
Senior Member
iTrader: (1)
 
Schuyler's Avatar
 
Join Date: Apr 2011
Location: Columbia, SC
Posts: 1,332
Total Cats: 87
Default

Not gunna lie, I really like how it sweeps when you start the car. lol.
Schuyler is offline  
Old 03-27-2015, 12:56 AM
  #7  
Junior Member
Thread Starter
iTrader: (9)
 
scenturion's Avatar
 
Join Date: Dec 2011
Location: SFBay
Posts: 408
Total Cats: 61
Default

Originally Posted by Schuyler
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 01:24 AM.
scenturion is offline  
Old 03-27-2015, 01:22 AM
  #8  
Senior Member
iTrader: (1)
 
Schuyler's Avatar
 
Join Date: Apr 2011
Location: Columbia, SC
Posts: 1,332
Total Cats: 87
Default

Will this be something you're selling?
Schuyler is offline  
Old 03-27-2015, 01:53 AM
  #9  
Junior Member
Thread Starter
iTrader: (9)
 
scenturion's Avatar
 
Join Date: Dec 2011
Location: SFBay
Posts: 408
Total Cats: 61
Default

Originally Posted by Schuyler
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  
Old 03-27-2015, 04:21 AM
  #10  
Elite Member
iTrader: (1)
 
richyvrlimited's Avatar
 
Join Date: Jun 2006
Location: Warrington/Birmingham
Posts: 2,642
Total Cats: 42
Default

Man, that is awesome work.

Many props to you sir.
richyvrlimited is offline  
Old 03-27-2015, 10:46 AM
  #11  
Junior Member
iTrader: (2)
 
OneTwo's Avatar
 
Join Date: Apr 2014
Location: Sacramento, CA
Posts: 396
Total Cats: 36
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  
Old 03-28-2015, 02:35 PM
  #12  
Senior Member
iTrader: (1)
 
gesso's Avatar
 
Join Date: Mar 2010
Location: Bay Area, CA
Posts: 811
Total Cats: 270
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  
Old 03-28-2015, 06:51 PM
  #13  
Junior Member
Thread Starter
iTrader: (9)
 
scenturion's Avatar
 
Join Date: Dec 2011
Location: SFBay
Posts: 408
Total Cats: 61
Default

Originally Posted by gesso
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  
Old 03-28-2015, 06:57 PM
  #14  
SADFab Destructive Testing Engineer
iTrader: (5)
 
aidandj's Avatar
 
Join Date: Apr 2014
Location: Beaverton, USA
Posts: 18,642
Total Cats: 1,866
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  
Old 03-28-2015, 08:30 PM
  #15  
Junior Member
Thread Starter
iTrader: (9)
 
scenturion's Avatar
 
Join Date: Dec 2011
Location: SFBay
Posts: 408
Total Cats: 61
Default

Originally Posted by aidandj
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.

Originally Posted by aidandj
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  
Old 03-28-2015, 08:33 PM
  #16  
SADFab Destructive Testing Engineer
iTrader: (5)
 
aidandj's Avatar
 
Join Date: Apr 2014
Location: Beaverton, USA
Posts: 18,642
Total Cats: 1,866
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  
Old 03-29-2015, 03:33 AM
  #17  
Junior Member
 
AdrianD2's Avatar
 
Join Date: Feb 2014
Location: Chicago, IL
Posts: 94
Total Cats: 1
Default

That is really awesome, huge props to you man!
AdrianD2 is offline  
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
zephyrusaurai
Meet and Greet
2
09-28-2015 10:59 PM
btabor
ECUs and Tuning
10
09-28-2015 05:33 PM
ihiryu
General Miata Chat
9
09-28-2015 10:22 AM
ProjectDDoS
Build Threads
1
09-09-2015 01:52 PM
D_Breezy
Meet and Greet
5
09-08-2015 05:37 PM



Quick Reply: STACK'd Miata Arduino-Controlled Gauge Cluster



All times are GMT -4. The time now is 02:35 AM.