June 2008
I used a PIC microcontroller in a circuit to measure my car’s MPH. It measures the frequency of pulses from the Vehicle Speed Sensor, and converts it to miles-per-hour.
A summer project involving programming a PIC micro controller to measure my Honda Civic’s MPH. The circuit I made measures the frequency of the pulses coming from the Vehicle Speed Sensor wire in my car, and calculates my speed based on that, and displays it. The speed displayed is a little jumpy, but the average of the numbers you see measure the speed well.
For a 2002 Honda Civic:
The Vehicle Speed Sensor wire is a white/green wire attached via the Connector-A (of A,B,C,E connectors) to the ECU, The ECU is behind the glove box.
The VSS wire sends 8208 pules every mile.
A frequency meter using a Programmable Interrupt Controller (PIC) was built, referencing this site: http://freenet-homepage.de/dl4yhf/freq_counter/freq_counter.html
The assembly code was modified to multiply the frequency measured by a scalar number less than one (which varies depending on the pulses per mile).
My Digital Speedometer Video
PIC frequency counter circuit
PIC frequency counter code (see ‘CvtAndDisplayFreq’ section)
Related: Arduino Fuel Consumption Gauge – MPGuino
hi..is it possible to use your circuit with a PIC microcontroller in a digital odometer?
Hi Rizzelle,
Yes, indeed it is possible – instead of calculating the frequency of the pulses from the VSS, simply count the number of pulses, and divide that number by the pulses-per-mile for your car (my Civic is 8208). The code given here is for calculating the frequency of the pulses, so modifying it to simply count pulses should be simple.
Good luck!
Hi iam working to make digital speedometer to my car. can you please direct me to what modification shoud I do to the frequency counter circuit? and can you also send me the asm / hex files of the program. as i have very litttle knowledge ia assambly language.
thanks
wasantha:
Everything you need is listed above, including the already modified asm file.
If you have trouble with PIC programming and assembly, maybe checkout the MPGuino as an alternative project for you – https://mcclanahoochie.com/blog/portfolio/mpguino/
Good luck on your project!
Is the pulses-per-mile count for 1 second ?
Xiang:
The vehicle speed sensor produces a set number of pulses every mile (for honda, ~4014), regardless of speed. The faster you drive, the shorter the time period (higher frequency) the pulses become. Measuring the freqency of the pulses over a fixed, known time period, can be translated into MPH, depending on the car. MPH=Freq*Scale. I did calibration to tweak the scale factor, and if i remember, it was around 0.7 or 0.9.
How about putting this meter on my bicycle?
What additional should I need & sensor?
I assume you have factory tires hence you have 8208 pulses. If you changed tires that number will change as circumferance of tire will change as result number of pulses will change as result of it
hi, is it possible to create a cycle speedometer using a pic24h