Introduction: Nixie Spedometer and Mechanical Iris Without GPS
So, this is the car. I've been building this for about seven years now. This Instructable focuses on one part of it, the speedometer.
A brief background - the car is something I have had in my head for many years now, since I was a kid really. I'm an impulsive guy, and one hazy afternoon sat in a field in Chimay (Belgium) at a show called "European Bug In", after a hearty brunch of off-steak, undercooked eggs and several cans of fermented wheat juice, I said to my close friend in a slightly slurred voice:
"Y'know what, amma gonna build a thing. Wossit. Volksrod. Wivva keg forra fuel tank, and a turbo, and lots o craziness..."
My friend didn't really believe me. He nodded along passively, said something like:
"Yeah, sure, uh-huh..." in a disinterested sort of way.
"Really, though, you won't. You never get around to your projects..." he said.
Au contraire Monsieur!
Fast forward a few years, and I had started to make good on my inebriated pipe dream. The rules for the project:
- No technology that was not readily available when the car was manufactured, with the exceptions of safety grounds, or where cost is prohibitive to be done with 60's technology today, but it MUST be possible and I MUST prove so.
- No part of the car can be untouched. If a faithful restoration is "As it left the factory" then it must follow that this car has to be the inverse of that. "Nothing is left as it left the factory"
- This project is for me - it is to be the embodiment of the car that I have had in my imagination since I was a child, faithfully reproduced with as much flare as I can physically shoehorn into it.
The car has had a crazy amount of work done so far. A 9" roof chop, a 12" chassis extension and suicide front end, a turbocharged engine, a leather bench seat, the list goes on and on from the major "WOW" factors to the tiny subtle trick bits.
This Instructable focuses on one small, but key, part of the vehicle. The speedometer! Arguably the centrepiece for the driver. With that in mind, it just had to be special... Really, really special...
Stuff. Lots of stuff...
An Arduino of your choice (I developed this with my Arduino Mega, but have two Arduino Beetles to actually run this when I install it)
A hall effect sensor of your choice, there are lots available with nice boards that are plug & play for Arduino
An original VW Beetle speedometer to donate parts (you need the housing with the little spinning magnet, and the speedo cable)
A 3D printer
Some 0.2mm copper or brass sheet
Some brass round bar (I think I used 2.5mm, but the diameter just needs to match the holes and slots in the iris)
Two IN-12 Nixie Tubes
Two NixieTester driver boards
A suitable Nixie tube power supply (Old proverb say: "Buy cheap, buy twice!" - so buy the best you can afford!)
Solder and flux
A gas soldering iron or tiny blowtorch
Coffee. LOTS of coffee.
Step 1: Nixie Is the Way!
After thinking about unusual ways of displaying speed, I actually opted for something simple. A decimal display. For me, there really was only one contender for this - the nixie tube. Looking around, there are a few Nixie speedometers out there already, but every single one I found ran with a GPS. However, rule #1 means that I can't use a GPS. Besides, for me, that's a copout. Why not use the equipment that was already in the car? A Beetle (because that what the car was, once...) has a little magnet in the speedo that spins with the speedo cable driven by the front wheel. This in turns creates an eddy current, which would pull on the needle in the speedo and give a readout of speed. It wasn't especially accurate (that's why I was going a little fast, Officer!), but it worked well enough.
The beauty of this is that the little magnet, as it spins, makes it's magnetic field spin with it. If you mount something, say a hall sensor, next to the magnet, it will pick up the field as it spins. The hall sensor will see the polarity of this field change and so will output a pulse with it.
I must confess the hall sensor I used was just a random one I had kicking around, but it was on a board a little like this one:
Nice and easy, hook it up to an arduino - I'm using an Arduino Mega because that is what I had laid around the place. Yes, yes, this contravenes Rule #1. However, while I could use BCD decoders, a counter chip and various bits n pieces, this would not be cost effective. I designed an Arduino-free version using traditional components in some clever simulator software and it worked well enough, which proved that it could be done. Besides, it's my party and if I want to bend the rules a bit, then I will! Anyway...
The "DO" pin needs to go to whichever interrupt pint you assigning in your code (in my example for Arduino Mega it is interrupt pin 0).
VIn needs to go to the 5V output from your arduino.
You can probably guess that GND needs to go to GND on the Arduino.
Write yourself a little code to count the pulses... Or, if you're lazy, you can steal mine... I say "mine", but this was actually someone else's that I shamelessly pilfered from the internet and altered...
So, running this bit of attached code, opening the serial monitor, and spinning the magnet gives us a nice readout of pulses, and the time between rising edges of your pulses in microseconds. A little maths, convert the duration to seconds and divide 1 by that number and you have yourself frequency! Try running the code I posted here, open the serial monitor and see if it works. If it does, see if you can figure out how to convert revDuration to RPM. Or, you can cheat and look at my code later on ;-)
Step 2: It Has to Look Beautiful!
So. Before we delve deeper into the code and hardware, and because I have the attention span of a small child in a toy shop, lets think about making this thing look special. Properly, awesomely special.
A Nixie speedometer is just not enough, boys and girls. Oh, no no no. It needs to have some style, a bit of panache, a little something about it.
I've always been fascinated by mechanical irises. So. why not use one?
I broke out the Sketchup, fired up my 3D printer, and I checked out this guys Instructable:
This is what I came up with. I won't repeat the steps "kommodore" already put in his Instructable, the credit for this part is almost entirely his.
After some careful measurements and a little tinkering, I was ready to print it out...
I would upload my sketchup files, but where would the fun in that be? Besides, my dimensions are very specific to my car, and hinge on the space available in the dashboard etc etc. You're better off drawing up your own!
Oh, OK then, since you asked so nicely you can have my SketchUp file too...
Step 3: A Mechanical Iris
So, this is how it looks after some careful assembly, sanding and minor tweaks.
The leaves are 0.2mm brass, rather than copper. The pegs are just brass pins cut down and soldered to the leaves.
I don't have a photograph, but I hand made a stainless steel former, cut the brass sheet int strips, clamped the former onto it, and used a flapwheel in an angle grinder to make my leaves.
I drilled holes in the former and through the leaves to locate the pins and soldered them into place with a small gas soldering iron, flux and regular electrical solder.
I wish I had more photographs of this stage, but really it's not an exact science. There's plenty of ways to catch a monkey, you will find yours if you attempt this. Scissors would work well enough if you take the burs off it leaves behind.
The plan is to attach the mechanism to an actuator or something so that when you turn the car on, the iris opens to reveal the nixie tubes. Pretty neat, huh?
Step 4: More Electronics. and Coding.
So back to the coding and electronics.
I really hit several walls at this stage. I'm a coding novice, and for me getting from measuring RPM to outputting speed to nixie tubes was a leap.
Nixie tubes with the numbers 0-9 have eleven pins, one for the high voltage supply input, and then when one of the other ten pins are grounded, it lights up a number corresponding to that pin.
There are chips out there for driving nixie tubes using Binary Coded Decimal (BCD). To give an example of what BCD is, the number "12" in decimal is, well, 12. In binary, it is "1100" - both of these are easy to output from an Arduino. But, 12 in BCD is "0001 0010". This is slightly more complicated to output. It would also mean a frightening number of connections to the Arduino!
There would then have to be some transistors to drive the Nixie tubes, and lots of other pokery jiggery that I could really have done without having to design. Outputting the data to a shift register would have made less connections to the arduino, but would have made for a no-less complicated circuit. I'm all for simplification where possible.
The answer I found quite by accident. This beautiful product:
I was searching for something quite unrelated, but when I stumbled on these, along with the library for using them with Arduino, I immediately bought several. I won't go into depth about the wiring right here, but it is extremely simple and explained in full on the website. You can daisy chain these together with just three connections to the Arduino (clock, EN and Data In). for all the boards you use, the clock and EN pins are common, and data out from the first board goes to data in of the second, and so on. Add the VIn (5v) and ground, and the HV from a suitable nixie supply like this one:
As if by magic, it all fell into place here. Almost... A few false starts, and I had code that sort of worked, but it was buggy as hell, kept freezing, and did not behave quite as I wanted.
However, I'll spare you the pain, and we can just skip straight to the good bit in the next step! But for those interested, the issues I had were ironed out in this forum discussion:
Step 5: The "finished" Product
This is the finished speedo, attached to a drill, and doing what it should do.
It pains me to release something to the public at large that I worked so hard on and spent hours trying to get right, but it is only right I give back to a community that has helped me so much!
The wiring will depend entirely on which pins you assign in the code, and which Arduino you choose to use.
So, here is my code. Actually my code this time. Not pilfered and stolen. What you need to really note is firstly the pin definitions, they will change depending on what Arduino you have. Secondly, the calculation for MPH, that is based on my wheel circumference. My wheel is, give or take, 22" or so in diameter. So the line in the code that reads:
"SpeedMPH = 500000 * 4 / revDuration;" will need to change depending on your wheel size, and the method by which you are measuring pulses. yes, I could have simplified it further, but to be honest I was so happy I got hte code working properly, I didn't want to poke the bear any more.
The way I calculated my speed:
Frequency = 1/revDuration
However, there are two edges per magnet rotation, so:
Frequency actually = 0.5/revDuration
Wheel circumference = 0.001112257 miles (this was calculated from the diameter of the wheel in mm multiplied by Pi, divided by the number of mm in a mile which is 1609344mm)
SpeedMPH = MagnetPulseFrequency * 60 * 60 (to give pulses per hour) * Wheel circumference
So MPH = 4 * Frequency
Happily, this makes a very convenient bit of maths to play with.
I hope the code makes sense, I haven't annotated it as much as I maybe should have...
Step 6: Sadly, Not "totally" Finished... But a Glimpse of What Is to Come!
Because of the craziness of Covid-19, I am unable to get to my workshop where my foundry and casting equipment is.
The next step is to cast the front face in aluminium or brass, and mount it in the car. Unfortunately I can do neither :-(
What's more, I got sent away short notice with work, and I am typing this from my hotel room. So I can't even assemble the actuator. However, left to do:
I'm going to use an Arduino Beetle in the finished product.
The dashboard will also feature a Nixie rev counter, and IN-9 indicators for oil temp, boost pressure etc.
As I said, I will cast the front face in a nice metal to really finish it off.
I've popped some pictures up of the dashboard, it's a solid mahogany board cut to shape and fixed in place with turned brass fixings. The plan is to bore a hole to fit the speedometer once I have cast the front in a nice metal. I've also included a picture of the layout for where the IN-9 tubes will go in the 3D printed housings I made. These will read out:
Cylinder head temperatures
I've also given a little sneak peek of the nixieclock that will also be fitted in the dash.
I am developing a nixie rev counter too to really finish it off. The whole dash will have laser cut brass cover plates with etched annotations for everything.
I hope you have enjoyed my almost-finished Instructable, and will forgive me for not having a totally finished polished product to show you.
Participated in the
3D Printed Contest