IR circuit issues

Vizier87

Active Member
Hi everyone.

I've built an IR circuit for "event detection" like this:



I just used one of the op-amps from an LM358.

Between L1 and L2, it needs to be sensitive enough so that even a strand of hair sets the LED D1 on.

Which I managed to do quite nicely.

My problem is, the circuit's comparator tuning at R3 is not specific for different power sources, even when they're all at 5V. If I plugged in different supply sources, I'd have to recalibrate the pot again. And also, once powered off, the calibration sometimes need to be tweaked again too, though not as much as switching to a different supply.

Is there a better way to handle this analogically? I know I could just probably use a uC to establish a baseline and capture the event based on the minor perturbations from the baseline but I prefer to keep this as analog as possible.

Thanks!
Vizier87
 
Unless your speaker has a very high resistance it will act almost as a short circuit on the LM358 output and will drag the output voltage down, probably below the point at which D1 (if that is meant to be an LED) will light.
 
1) Add positive feedback round the opamp, to make it 'snap', this is very important in comparator circuits.

2) Add PSU decoupling capacitors, essential in all electronic circuits.

3) Use a 5V regulator (7805 or 78L05) to power it, again with the required capacitors.

4) Remove the speaker - as already suggested you can't just hang a speaker on an opamp.
 
You can drive a speaker, at low levels, by using a series R with speaker to decouple
the low Z load a speaker represents. You sacrifice efficiency and audio volume.
Start by using 1K ohm and drop it, maybe not < 100 ohms.



Or use a LM386 kind of part, take a look at this thread -


Read the LM386 datasheet carefully as that part can oscillate and is not tolerant of HV (generated
by L loads).

Hysteresis calculator for comparator : https://www.allaboutcircuits.com/tools/hysteresis-comparator-calculator/




Regards, Dana.
 
Last edited:
Another approach is to remove the preset pot and connect the opamp positive input to a capacitor to 0V, and a fairly high value resistor (10k?) to opamp negative in.

Then add a much! higher value resistor from positive in to positive power, so the positive in is offset by just a few millivolts higher than the negative.

That should make it self-adaptive regardless of the exact photodiode or supply voltage - though it will not see a permanent interruption to the light beam. Some overall supply regulation would still improve it though.

Edit - just noticed that the opamp inputs appear reversed? As shown, the photodiode would be conducting and pulling the negative input low when there was no interruption, so setting the output high? Or is it supposed to be sensing reflection rather than interruption?

If it's for reflective sensing, the high value resistor should be from positive in to ground, rather than positive in to power. That will also be less sensitive to supply variations.


If you want to keep the fixed bias, try adding a normal or shottky diode (or two or both) in series with the 0V end of the preset, so the wiper voltage changes less with supply variations.
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…