Tachometer based on OPB606A Reflective Object Sensor

So I have one of those thermoelectric fans for our wood stove and have wondered how fast it goes (I already knew it really doesn't move much air).

I used a OPB606A Reflective Object Sensor to detect a fan blade moving past a given point. Here is a link to the data sheet. It consists of an infrared LED and a phototransistor mounted together in an opaque housing. When it "sees" something reflective, the transistor turns on and drives the corresponding pin near ground. I had to use a Schmitt trigger (74LS14) to get good rise times (when the transistor turns off) because I had a fairly long RC time constant. Long wires with the signal adjacent to ground and a 20K pullup.

I implemented an circular buffer of 15 samples of 4 seconds each. Every four seconds, I compute the total of the samples, round it, and divide by two (two-bladed fan). This gives me the total of revolutions for the preceding 60 seconds (RPM).

I display the current RPM and maximum RPM on an 8-digit MAX7219 stick.
2048 x 1536 - 545K
2048 x 1536 - 561K
Re-inventing the wheel is not a waste of time if, when you are done, you understand why it is round.
Cool, CA, USA 95614

Comments

  • 1 Comment sorted by Date Added Votes
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 21,226
    edited February 13 Vote Up0Vote Down
    Nice setup, Tom!

    I'm sure you already know this, and it's probably not a factor with your setup at the speeds you're running. But for those who don't: although a Schmitt trigger yields good rise and fall times, it does not improve the response time of the phototransistor feeding its input. To improve the response time you can use a simple common-base transistor circuit.

    The following circuit diagrams illustrate:

    opto_receivers.gif

    Circuit A is a typical common-collector opto hookup. Its response time suffers due to the phototransistor's Miller capacitance. To overcome the Miller effect, a PNP transistor can be added in a common-base configuration, as shown in Circuit B.

    To test these circuits, I hooked up a transistor-output optocoupler, whose LED was driven by a Prop pin through a 1K resistor. Here's an actual output recorded on my 'scope from Circuit A. The yellow trace is the output from the Prop; the magenta trace, the output from the phototransistor:

    opto_response_A.gif

    Here's the output from Circuit B using the same stimulus:

    opto_response_B.gif

    As you can see, the output transitions from Circuit A barely register, due to the photransistor's slow response. By contrast, the output from Circuit B tracks the input much better.

    -Phil
    373 x 253 - 3K
    480 x 360 - 14K
    480 x 360 - 16K
    “Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-Exupery
Sign In or Register to comment.