Vehicle Speedometer
Map63Vette
Posts: 4
This project has gone through a few different phases, but I think I've finally found the beginnings of a decent solution. The problem I have is that I just swapped a modern transmission into an older car. The modern transmission uses an electronic speed sensor, but the old gauge is mechanically driven. They make a converter for this kind of thing, but at over $300 and with questionable reviews I decided to try to make something myself for the fun of it. Also, the guage is a ribbon style horizontal setup as opposed to the more common round variety, so I haven't be able to find any electronic aftermarket ones to simply replace it and don't feel like mounting another one somewhere else. I took some microprocessor classes in college a few years ago, so I have an SX28 and BS2 on hand, but my preference would be to use the SX since the BS2 is currently set up for cruise control on a different car.
The simple solution would be to lock the magnetic couple on the speedometer and just use a stepper to position the needle appropriately, but doing this would render my odometer inoperable which I would rather not. To keep the odometer functional, I worked on trying to direct couple a motor to the speedometer where the cable used to attach. This worked okay, but finding a small enough motor that would work at very low rpm (less than 2000) without a gearbox was difficult. I managed to scavenge one out of a printer that worked okay, but if the coupling between it and the gauge wasn't near perfect, there wasn't enough startup torque for the guage to function at low speeds. The vehicle environment is also such that I doubt I could build a substantial enough mount to keep the motor in this near perfect alignement while driving that would fit behind the dash. I did prototype a circuit for this setup that consisted of the SX reading the input pulses from the speed sensor which then controlled a digital potentiometer that fed a 555 timer that I set up as a rudimentary PWM motor driver.
However, I've come across a speedometer from another vehicle that maintains an analog odometer while using only an electronic input. It appears the needle for the guage is controlled by a stepper and the odometer has a separate motor to run it. The new plan is to use the guts of this gauge behind my current speedo faceplate. I believe this new gauge functions with a square wave input that varies frequency based on speed. This makes the circuitry on my side a little easier as now all I need to do is read the speed sensor input and output a varying frequency as opposed to controlling a motor, but I'm unsure if the SX is capable of performing both tasks simultaneously. I need to read in pulses from a hall sensor, do some math based on tires and gear ratios, and output a corresponding square wave of appropriate frequency. The trick is that as much as possible I'd like to have a constant output (granted the frequency of the output will vary on an update cycle). My very basic approach would be to poll a sensor for a set period, then do my tire/gear ratio math, and update the frequency, but I'm not sure how to keep an output going during the sensor input and math operations. I bypassed this on my original design by offloading the output signal job to the 555, but I got to wondering if it would be possible to keep all the operations on a single chip to reduce circuit complexity. Also, the digital potentiometer I have is limited in the number of steps available, so if I was only using the SX I could potentially have more precise control of the output signal than what I can achieve with the RC circuit that drives the 555.
The simple solution would be to lock the magnetic couple on the speedometer and just use a stepper to position the needle appropriately, but doing this would render my odometer inoperable which I would rather not. To keep the odometer functional, I worked on trying to direct couple a motor to the speedometer where the cable used to attach. This worked okay, but finding a small enough motor that would work at very low rpm (less than 2000) without a gearbox was difficult. I managed to scavenge one out of a printer that worked okay, but if the coupling between it and the gauge wasn't near perfect, there wasn't enough startup torque for the guage to function at low speeds. The vehicle environment is also such that I doubt I could build a substantial enough mount to keep the motor in this near perfect alignement while driving that would fit behind the dash. I did prototype a circuit for this setup that consisted of the SX reading the input pulses from the speed sensor which then controlled a digital potentiometer that fed a 555 timer that I set up as a rudimentary PWM motor driver.
However, I've come across a speedometer from another vehicle that maintains an analog odometer while using only an electronic input. It appears the needle for the guage is controlled by a stepper and the odometer has a separate motor to run it. The new plan is to use the guts of this gauge behind my current speedo faceplate. I believe this new gauge functions with a square wave input that varies frequency based on speed. This makes the circuitry on my side a little easier as now all I need to do is read the speed sensor input and output a varying frequency as opposed to controlling a motor, but I'm unsure if the SX is capable of performing both tasks simultaneously. I need to read in pulses from a hall sensor, do some math based on tires and gear ratios, and output a corresponding square wave of appropriate frequency. The trick is that as much as possible I'd like to have a constant output (granted the frequency of the output will vary on an update cycle). My very basic approach would be to poll a sensor for a set period, then do my tire/gear ratio math, and update the frequency, but I'm not sure how to keep an output going during the sensor input and math operations. I bypassed this on my original design by offloading the output signal job to the 555, but I got to wondering if it would be possible to keep all the operations on a single chip to reduce circuit complexity. Also, the digital potentiometer I have is limited in the number of steps available, so if I was only using the SX I could potentially have more precise control of the output signal than what I can achieve with the RC circuit that drives the 555.
Comments
I'm surprised no one replied to you.
I think the SX is capable of performing both tasks, how long do you need to read the in pulses from the hall sensor?
Let as know how it's going.
The speedo needle is driven by an air core motor, and since I couldn't drive it directly with the SX, I decided to maintain the driver board that came with the speedo to handle this function. The odometer is just a plain bipolar stepper though, and I had a darlington array IC from the SX kit that I could use to drive it directly from the SX, so I pulled it off into it's own circuit. Next, it finally clicked to me that the stepper doesn't need a constant signal, it just needs to know to step after so many pulses from the speed sensor. This was easy enough by just using a counter in the program that steps the motor after X amount of pulses. This made me realize that the speedo operated on a similar principle. The driver board reads pulses and positions the needle accordingly, so it's really the one doing the frequency output. The SX just has to scale the pulses from the speed sensor to match what the gauge driver is expecting. To do this, I have a second counter that keeps track of pulses for the speedo and just alternates a pin output after Y number of pulses. Constantly flipping the output of the pin makes an "artificial" frequency output that doesn't have to happen in the background.
I haven't fully written the code, but my current plan is to have the speed sensor on one of the B registers and to use it as an interrupt signal. When the sensor detects a tooth, it will trigger an interrupt that increments the speedo and odometer counters. When the counters rollover whatever limits I set for them (to acheive proper scaling), it will either step the odometer motor or flip the speedo output pin. The control board on the speedo will then convert this high/low pin output to drive the gauge. My main concern is whether all the processing and rollover check can happen between tooth pulses at high speed. If I'm doing the math correctly, the fastest output I should see from the speed sensor is around 1 KHz. With the SX running at 4 MHz I'm pretty sure I should be fine, but I haven't tried it out yet to see.
My circuit is now working well,but needs a bit of tweaking before reinstalling the instrument cluster.I also tried driving the mechanical speedometer head with different motors and found that because they need to spin so fast that vibration and noise were too annoying.
Peace
I actually made a cruise control for my 71 Vette back in college for a microcontroller project. It had pretty bad resolution (started with just one magnet and ended up using two), but it would still jump a few mph at a time because it didn't have enough counts. Did largely the same thing you're looking for (read in speed signal and control servo), but my other issue was refresh rate. I'd poll the hall sensor I installed on the rear half-shaft for half a second or something like that then command the servo to adjust position, so I would have a stepped throttle response you could notice.
I had originally considered a servo for the needle control on the Dart, but didn't know that it would move fast enough for my taste. Thought about a stepper as well, but the problem with it is you have to step all the way up from zero, you can't just command a position (toughter coding, but not impossible). The air core is nice because it's similar to a servo, just without all the extra gearing. Just a straight shaft sitting in two perpendicular coils. Current through the coils causes a magnetic field that the shaft aligns itself with. If you can control the voltage to each coil independently you can get whatever angle you want using a formula.
I wonder if converting an old speedo to a stepper motor is wise. There might not be enough space under the dash to do so.
I would consider just relocating the speedo cable and having an electric motor with quadrature sensor drive the speedo cable, OR switch to a digital display.