Digital Logic Voltage Threshold (w/ FreqMeasure library)

Status
Not open for further replies.

lenam

New member
I am trying to create an optical tachometer using a QRB1114 IR reflectance sensor, a Teensy 3.1, and the FreqMeasure library to count the rotations of a spindle that has reflective tape on it between 1Hz and 300Hz.

Before amplification, the sensor (phototransistor) outputs 0.2V when hitting the tape and 0.02V when not hitting the tape. These are my questions:

1. When trying to register an analog signal as a digital input--not only for this application but also, say, if I want to trigger an interrupt with an Analog signal--what is the "threshold voltage" I should be aiming to amplify my signal to to cross the line between digital LOW and HIGH? I assume that this is important for FreqMeasure to work.
2. Is the FreqMeasure library doing something functionally different from a CHANGE pin interrupt in terms of the voltage threshold it looks for? Before I found the FreqMeasure library I was planning on using an interrupt like this.
3. Do I need to use a Schmitt trigger, and if so, how do I find the best one for my purposes?

Thanks so much!
 
A normal Schmitt Trigger from the standard CMOS 74HC family will not be sensitive enough for this small voltage. Thus, you'll have to amplify it first by the factor 15, so that you get a voltage swing from 0.3V to 3V. This signal might still have logic incompatible values in-between these two voltages. Thus, a Schmitt-Trigger as a signal cleaner to decide clearly between HIGH and LOW will be required behind the amplifier.

The FreqMeasure library uses the Teensy's internal timer capture hardware which is more precise and requires less CPU resources than the interrupt stuff.

EDIT: I just looked at the QRB1114 specifications. Normally that photo transistor should give a much higher voltage swing by itself when correctly biased. Connect the collector (pin4) to 3.3V, the Emitter (pin3) to a 4.7k resistor and the other end of the resistor to GND. Then check the voltage across the resistor as the tape passes.
 
Status
Not open for further replies.
Back
Top