Subtotal: 0
View Cart
Tachometer Minimize

Submitted by Stan Cloyd

 

My  2008 Toyota Yaris hatchback  did not come with a tachometer. I purchased a BS2 starter kit several years ago and had never even opened the package. After buying the car I started playing around with the chip, code, and laptop to try to build a custom tachometer for the Yaris. At first I used a 555 timer chip on a bread board to generate a tachometer signal for testing. In the early stage of testing I was limited to a four LED display because they draw more current than the BS2 can supply. I downloaded the data sheet for the LM324 op-amp and built an impedance matching unity gain amplifier stage to drive the fifteen output LEDs. When I upgraded my laptop to a modern USB type I had to buy a USB to RS232 converter dongle and software driver. The one I bought was an IOGEAR USB-to-Serial Adapter (GUC232A).  At this stage I was able to bench test (on a breadboard) my basic output circuits and the PBASIC code.
 
I didn’t have any idea what the input signal from the Yaris was so I bought a used dual trace oscilloscope. I started sampling signals from the pins on my OBD-2 service connector until I located the tachometer signal. It was a zero to twelve volt periodic symmetrical square wave with frequency proportional to RPM. I then went back to the breadboard and installed a 10 kilo-ohm current limiting resistor in series with a five volt zener diode so that the BS2 could safely see a zero to five volt square wave on pin fifteen. Because the output from the 555 timer chip wasn’t high and low equal amounts of time, I had to use pulse in high and low to calculate an accurate time count for the period in software.  The same sample routine worked equally well on the better behaved signal from the Toyota ECU. It took numerical analysis to find the scaling factors that allow the BS2 to function within the limits of the integers. I used a digital tachometer to calibrate the breadboard tachometer so that the debug numbers on my laptop were correct. I used a data set stored in EPROM to determine which outputs needed to be set high and low with each scan. I was able to use-and-abuse the super carrier board in my starter kit to build a stitch-wired prototype. I pulled the dash apart to build the LED display. Software feats are: 1) A hardware diagnostic that, when the key is on but the engine not running, flashes the LEDs left and right like KIT from Knight-Rider. The other is a shift-indicator that starts flashing all on LEDs at four hertz when you hit 6000 RPM. I downloaded free schematic and layout software from ExpressPCB. Be sure to link the schematic to the layout. I didn’t, and therefore made rooky mistakes on the layout.  The color print of the layout has the corrections incorporated in it.  I ordered three boards from express for about $60. At that price they don’t have silk screen or solder masks but they work well and are of high quality. The boards are 2.5” by 3.8”. It’s so much less work to assemble them to a PCB that I’ll skip the stitch wire exercise next time. It was actually a lot of fun using the Express products. The most tedious work for the whole project is producing a complete bill of materials for parts ordering. The folks at DigiKey were very patient considering that I had never done these things before. The occasionally needed tech support from the Parallax staff was also superb.  Now I’m on-ward and up-ward with similar but more advanced applications for the Propeller chip.

Resources and Downloads:
Tachometer Source Code (.zip)
Techometer Layout (.jpg) 
Techometer Schematic (.jpg)
Contact Stan Cloyd

   Print  
Home    |    Contact Us    |    Job Opportunities    |    About Parallax    |    Privacy Statement    |    Terms Of Use    |    Copyright 2008 by Parallax, Inc.