J. Mike Rollins (Sparky) [rollins@wfu.edu]
  CISSP, GIAC GPEN
Hyperbola New
My Cats New
Kitty New
Mike is on
  LinkedIn
  FaceBook
BackYardGreen.Net
HappyPiDay.com
Green Cycle Design Group
CamoTruck.Net
  Resume  
  My Stuff  
  Art  
  My Truck  
  People  
Electronics
   AC Inverter
   Taz (My EV)
      On/Off
      Tachometer
      RPM Sensor
      Data Meter
   Ethernet
   PIC Switch
   LM3524 Motor Control
   Microcontroller
   PWM and MOSFET
   SMP with 317
   Power Supply
   Function Gen
   Simulator: Zener
   Charge Controller
   IR Audio
   PWM with 555
   Solar
   Entertainment Center
   BLDC
   GPS & WD-C2401P
Jacob's Ladder
Scripts
Math
Notes
My House
My Cars
My Cats New
My Jokes
Pi Poetry
pumpkin
Toro Mower
Development
Speed of a Piston
Not a Pipe
Linux
















Tachometer

I highly recommend a tachometer for anyone building an electric vehicle. My truck did not have one, so I made one. The first step was to develop an RPM sensor. The next step was the display unit. I wasn't sure what kind of signal store-bought tachometers expected, so I could not develop with this in mind. So, I made my own display unit.

The concept is fairly simple. The PIC18F microcontrollers have a timer port used to process external clock signals. I feed the signal from the sensor into this port. The microcontroller measures the passage of time with another timer driven by the oscillator. In general, I divide the number of pulses by the elapsed time to determine the RPM and light up the appropriate LEDs.

I was not sure how bright to make the LEDs, so I added a potentiometer and used the pulse width modulation feature of the PIC18F.

I did not need the fuel gauge anymore. So, this is now the spot for my tach. Here are the front and back sides of the display.

Here is the PIC18F4550 Firmware Code for the tach.

Here is an Excel file that was helpful in the code development. This will seem cryptic unless you are studying the calculation algorithm. The challenge is that you want to measure revolutions per minute. But, you start with something like the number of pulses over a duration of 65535 ticks of the external oscillator divided by 4 divided by the prescale of 64 where there are two pulses per revolution. The units are then converted into revolutions/minute. Then a simple calculation converts this to the number of LEDs to display.

Update: July 2010
I reworked most of the wiring over the past few weeks. I had some problems with the display and decided to make some modifications to the system. The output from the RPM sensor incorporates two transistors in a push-pull formation. It is capable of much higher current.

A capacitor on the display is charged and discharged from the sensor's push-pull output. A voltage comparator converts this into a nice 5 volt square wave for the Microcontroller.

The display is now much more stable.