What rate are you pulsing it? If you are comparing two measurements, one with the LED on and one with it off, I think you will run into problems.I do it by pulsing the IR LED and checking for a difference on the received ADC values in the receiver/Optotransistor.
Doesn't make sense to me. Why do you need a delta of 200 counts? 5 or 10 should be enough for detection.The resistor is 33k. I started at 3k9 but then there is too little gain to detect the object at 2". The 33k gives a good on/off delta of around 200 on the ADC at the desired obejt range. 900 when the sensor is covered by hand comlpetely.
Your bias seems to be a weak AC signal riding a DC component. When you want to emphasize the AC, install a capacitor in the emitter leg. You don't need to amplify the DC portion nevertheless DC current has a path to ground through the ohmic resistance. The capacitor gives you increased gain of the AC portion.
View attachment 159709
The bias has sufficient DC voltage to turn on the transistor. The 40 kHz AC is only 10mV amplitude yet it's amplified about 100x by the transistor.
When the light becomes strong ( I use an IR emitter as test source), there is no more AC signal detectable. The collector voltage simply goes to Vcc/2
I replaced the resistors with 10 turn pots and experimented for several hours but all to no avail.Resistance adjustments need to be done delicately. The challenge is to find the right bias for the phototransistsor.
It would be easy to say 'amplify the signal with an op amp' but still the phototransistor itself needs careful attention to voltages and currents reaching it, if you wish to get the most out of it.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?