After the problems with the mechanical speedo (in 2005) I decided to build an electronic one. I used an Atmel AVR ATTINY2313 processor and based the software on some example code published in EDN.
The ECM in my S4 generates 4000 pulses/km, and with this information I computed the calibration constants to convert the measured time between two pulses from the ECM into kmh. Checked it using a GPS and it works perfectly.
This is the first prototype being tested
I also built one with a different, larger LCD (below). In the end, I used a blue LCD and put the new speedometer at the location of the digital clock
After the mechanical speedo broke down the second time (a hot day again), I replaced the digital clock in the dash with a 2 line blue-white LCD that shows both the digital speed and the distance traveled. The following four pictures show the installation and the result.
LCD speedo without frame. LCD speedo with frame installed