A friend who on occasion does some machining and metalwork for me, spoke to me about designing a tachometer that could be used to show the speed of his mill and lathe. The requirement was that the tachometer would need to be low priced and be able to input various optical and magnetic sensor types. I decided to base the first prototypes on optical sensors since these are normally very low priced and easy to find.
The first prototype was a wire wrapped design using the 8052 based microcontroller driving 8 seven segment led display characters. The sensor was an optical reflector sensor much like the fairchild semiconductor qrb1114. The advantage to these sensors types is that they are usually in stock at digikey, mouser and sometimes on the surplus market at various outlets- plus they are cheap (around $3 in single qty). The sensor contains both an ir led and ir photo npn transistor as a detector. Both the sensor and detector are contained in an angled plastic case with a focal point approximately 2 inches from the sensor. The case allows the sensor distance to be adjusted by way of a slot for a setscrew.
One problem with these sensors is that
they produce a varying small signal depending on the type of material used to
reflect ir light from the led into the detector and the distance from the
material. An opamp circuit can be used to amplify this signal to a more usable
level. However, I chose to design a simple transistor amplifier instead.
Once the detector signal was amplified and
conditioned, the next question was what to do with it? I opted to try measuring
the period from pulse edge to pulse edge using the 8052's timer input. This
worked but the readings were quite jittery even after averaging several periods.
The next method tried was using multiple pulses per revolution integrating the
periods over time to produce rpm. An 8-bit spdt dipswitch was used on port 0 for
setting the number of pulses used per revolution. This was problematic since
once the object stopped rotating, the rpm reading would continue showing
decreasing values for several seconds.
Finally, what seemed to work best was to
use the 8052's counter input and measure the number of pulses that occur in a
sample period (e.g. 1 second). Then, simply multiply the number of pulses by 60
to get rpm. The problem with this method is that you cannot measure rpm values
less that 60 rpm with a single pulse. Multiple pulses are required to increase
the tachometer's accuracy. On the software side, this is much easier to program.
Once the design appeared to be a working
one, a printed circuit board was designed and fabricated. This initial pcb was
designed to work only with the optical sensor mentioned above. It was still
possible to tryout various sensor inputs by using the test points to bypass the
For the next prototype revision, something
like a general purpose connector will connect directly to a buffered input
before entering the 8052's inputs. A modular sensor board will be designed for
each sensor type and connected to the tachometer board via an RJ-11 or similar +
cable and connector.