View Single Post
Old 01-30-2022, 10:14 PM   #12
nsocwx
Registered User
 
nsocwx's Avatar
 
Join Date: Jan 2022
Location: NE
Posts: 9
Re: Digital Speedometer, a homebrew idea

As an update to this thread, I've had some nice weather over the last few days to road test the truck and speedometer project. I finally reached a point of confidence in the speedo that I put the Terminator's screen away that was showing me the speed before.

I did replace the 10k ohm resistor in my diagram with an optoisolator from Amazon to reduce noise, that removed all of the noise so.. score! It connects to +12v and PWM- from the terminator and fires a transistor that cleanly signals the Arduino each pulse without any background noise.


I've also found a few issues with the original code. 1- the multiMap module doesn't work as expected. I was going to re-write that module, but it turned out to be really short and so to make it easy I just embedded it in my code instead of updating that library. 2- counting the VSS pulses isn't very precise at 4k ppm, the easy fixes would be to increase the sample time (jumpy/laggy speedo) or to increase the PPM (not everyone can do that). To fix 2 I added a 2nd file to the Git repo,DigitalSpeedoMode2.ino. This file uses a different method of sampling the VSS where it measures the time between pulses to determine the frequency instead of counting pulses in a known time period. It's a little more complex, but results in a lot higher speed resolution and it's instant.

I'm hoping to get some more of the code nuances ironed out over the next few weeks barring any snow and I'll update with a video once I'm happy with how it looks. Thanks for the support and ideas folks!
nsocwx is offline   Reply With Quote