|1 of 5| next› last »

Long long long ago in early 90's friend asked me if i could make tachometer for his car. Should prolly ramble about how it works, umm, well... despite the name, a tachometer does not measure how tacky something is, instead is supposed to measure the number of times the car's engine revolves every minute and thats related to how many times the car's spark plugs fire which is eazy to detect by wrapping a coil of wire around the spark plug wire because of the nutty amount of voltage needed to generate a spark it puts out alot of electromagnetic energy that the coil picks up creating a signal each time its fired. If u counted the number of times this signal happened a minute and divided by the number of times the spark plug fires for each revolution (this is a constant for each type of motor dependent on the number of cylinders) you get count of RPM! Perfect eh? Notrly cause who wants to wait a minute to get a reading?!? So instead of counting, i measure the amount of time in-between each firing which would be the period of the frequency. Btw frequency = 1/Period.
Each coil signal triggers an interrupt on the processor. Also a timer increments a value a few million times a second. Every interrupt the timer value is checked and compared against the last timer value giving the amount of time elapsed between firings.
The thing was coded in spaghetti style assembly. mmm spaghetti!
Hope that wasnt too confusing and rambling, if anyone is interested i can write some pseudo C code to illustrate the operation better, but for now enjoy the purdy pics plz! :D