Slotted transmissive (or transflective) optical sensors are widely used in many applications. The interface is very simple; just ensure that an ample amount of current flows through the emitter, and properly load (but lightly) the sensor side. This requires as simplest only two resistors, see Fig.1.
However, this basic circuit - in its simplicity - has some downsides:
This variation of the sensor interface has the following benefits:
The trick is to run the sensor in a local negative feedback mode. In this configuration, the IR emitter gets just as much current as is required to keep the sensor's output current constant - and at a predefined level. If this equilibrium cannot be held (ex. when no signal is hitting the receiver) then the transmitter current will increase but only to a safe predetermined level.
The phototransistor output is not used as the output, instead, the current dumped in to the IR-emitter is converted to a voltage and this is used as the signal output. This analog signal can directly be interfaced with an ADC (in an MPU) for very fine and high-precision detection. This signal is a precise representation of the current going into the IR emitter - the current needed to keep the circuit in its equilibrium. This circuit arrangement where the IR-emitter is connected to the PNP-transistor's emitter side also keeps the voltage across the phototransistor fairly constant and high enough to ensure linear operation. At the same time the phototransistor's Miller (and other capacitance's) influence is effectively cancelled, increasing the overall speed even when running at relatively low phototransistor currents. Please note that this strong negative feedback also linearizes and widens the optical sensing gap of the sensor.
The question arises - why would you like to shallow the slope (or gain) of the sensor and have a wider optical sensing gap, since you just want to sense reliably an edge in a slotted sensor, or a certain distance in a tranflective sensor? When you use an ADC input to sense the sensor's output voltage this has no relevance. On the contrary - now that the edge sensing area is wider (and linearized) you can fine-tune the sensing point in software - and probably also avoid a mechanical adjustment of the sensor itself in applications that need very precise (and maybe user fine-tunable) reference sensing! However, this is not something I have tested but the sensing area is extended so this is feasible. Using the ADC also gives you better diagnostics - a missing or malfunctioning sensor can easily be detected without additional hardware.
Only one general-purpose PNP transistor is added to the original circuit to facilitate this improved behavior. Any small signal transistor with hfe>200 will do, BC327 is one good candidate. Due to the nature of the circuit, the output voltage can never exceed VCC-VF[diode]-VSAT[Q1]. In a +5V application, this is typically +3.75V, in an +3.3V circuit the maximum voltage is 2.05V. This is usually not a problem when feeding an ADC input. TTL-compatible digital inputs can also be driven with such a low signal. If a true digital signal with a full voltage swing is needed, such a circuit is presented at the end of this article.
Here are simple some steps for dimensioning the two resistors. In this example, the transmissive OPB859 sensor is used. This slotted coupler has a CTR of only 0.0125 (1.25%) and is, therefore, trickier to use than many others. However, this is a quite typical CTR for a transflective sensor so this is a good worst-case example.
In many applications, you just need a digital input that reflects the status of the sensor (on/off), or you cannot use an analog input.
With the addition of only one transistor and two resistors, you can convert the sensor's analog output to a digital output with a built-in Schmitt trigger operation. The low power consumption is preserved, as well as the speed and precision. By varying one resistor's value the hysteresis can be tailored. And there is no need to add an additional Schmitt trigger to square up the signal since the sensor already produces a good digital signal, with low output impedance and symmetrical rise and fall times.
NOTES:
Due to the fact that the sensor function needs only 3 wires, and the sensor itself is happy also with 3 wires (you can combine IR-LED anode and phototransistor collector) it is possible to add the extra circuitry either at the main PCB - or at the sensor. If the sensor is close to the PCB you can wire it directly and build the circuitry on your main PCB. t is strongly recommended to build the circuitry on the same small PCB close to the sensor if the sensor is further away.
Fig.1 Basic and simple interface of a transmissive (or transflective) optical sensor.
Fig.2 Typical application using the OPB859 slotted optosensor. Note that the wiring can be alternatively done with the resistors at the +VCC side. Function is the same.
Fig.3 Improved sensor with added transistor Q1. Check the text for functional explanation.
Slotted transmissive (or transflective) optical sensors are widely used in many applications. The interface is very simple; just ensure that an ample amo
Copyright @ DEXTREL / 2022 / All Rights Reserved