Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

Infra Red Proximity sensor and Sunlight Problem

userx2

Member level 5
Joined
Sep 19, 2008
Messages
90
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
2,378
Hello,

I am working on a sensor to detect an object at around 1-2" (25-50mm)

I do it by pulsing the IR LED and checking for a difference on the received ADC values in the receiver/Optotransistor.

With no object, there is little to no difference in the off/on values.
When a reflection occurs from an object, there is a larger difference which I then detect.

Problem is in strong sunlight.
I cannot get it to detect any noticeable on/off difference when the object is present.

Basically, the sunlight is so strong that it just also seems to reflect from the object and into the sensor as if it was not present and still drown out the sensor pulses.

Does anyone have any suggestions for how I can improve this perhaps?

Best regards
X
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
17,294
Helped
3,916
Reputation
7,830
Reaction score
3,779
Trophy points
113
Activity points
114,803
Hi,

I'd expect the AC signal not to be influenced by the DC (sunlight) signal.

Maybe your circuit is not suitable.

Klaus
 

betwixt

Super Moderator
Staff member
Joined
Jul 4, 2009
Messages
14,121
Helped
4,676
Reputation
9,366
Reaction score
4,414
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
120,664
I do it by pulsing the IR LED and checking for a difference on the received ADC values in the receiver/Optotransistor.
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.

A better solution is to continuously pulse the LED at high frequency, at least several KHz and then use an electrical filter to pass only that frequency from the sensor. It will eliminate almost all the background light problems, including light from artificial sources. Most commercial IR proximity sensors work in the 30KHz to 60KHz range.

Brian.
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
46,788
Helped
13,893
Reputation
28,034
Reaction score
12,524
Trophy points
1,393
Location
Bochum, Germany
Activity points
273,037
Sounds like receiver saturation, disclose your circuit and receiver type.
 

userx2

Member level 5
Joined
Sep 19, 2008
Messages
90
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
2,378
I need to clarify...

The IR sensor has LED and phototransistor built in.
I only have a pulldown resistor on the transistor e and that goes into the micro ADC.

I do an ADC converion for LED off. Then turn the IR LED on and do another conversion.

There is no exact frequency as I have multiple sensors of this type in round robin and other stuff, interrupts etc.

The receiver is saturating in that the 10bit ADC just sits at 1023 ish, regardless if my IR is on or off.
Without sunlight I get vastly different on and off values if an object is present.

In sunlight it will work if the sensor is fully covered, not allowing stray IR to get in.

I may need a circuit that removes the DC saturation but am not sure.

- - - Updated - - -

Sensor is OPB733TR
Here is a napkin schematic...
 

Attachments

Last edited:

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
17,294
Helped
3,916
Reputation
7,830
Reaction score
3,779
Trophy points
113
Activity points
114,803
Hi,

for sure the voltage at the resistor is non linear with the given circuit ...
you need to calculate currents, dimensionate the parts (resistors) ... and maybe you see you need an amplifier...

The internet is your friend: do a search on "IR circuit sunlight suppression"

Klaus
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
46,788
Helped
13,893
Reputation
28,034
Reaction score
12,524
Trophy points
1,393
Location
Bochum, Germany
Activity points
273,037
It's a photo transistor problem in the first place. Too sensitive despite of black (solar light blocking) window. What's the present sensor load resistor value? It may be reduced to about 500 ohm.
 

userx2

Member level 5
Joined
Sep 19, 2008
Messages
90
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
2,378
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.

Yes, there is a IR transparent special window in front of the sensor.
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
17,294
Helped
3,916
Reputation
7,830
Reaction score
3,779
Trophy points
113
Activity points
114,803
Hi,

the resistor must not be defined by the "gain" for sensing the object but it must be defined by the max intensity of light ... which obviously is the sunlight.

If the signal then is too low for sensing the object you need to add an AC amplifier.


Klaus
 

userx2

Member level 5
Joined
Sep 19, 2008
Messages
90
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
2,378
I will investigate.

Do ypu think the actual comparatively weak pulses would still be present and detectable in sunlight? That would be good news.

I will try to lower the gain so the bright sunlight will not reach max outpu voltage of the circuit and the AC couple it into an amplifier.
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
46,788
Helped
13,893
Reputation
28,034
Reaction score
12,524
Trophy points
1,393
Location
Bochum, Germany
Activity points
273,037
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.
Doesn't make sense to me. Why do you need a delta of 200 counts? 5 or 10 should be enough for detection.

Anyway, the problem has been clarified, I think. The alternative is between a simple circuit with lower load resistance and limited sensitivity or more complex circuit with AC amplifier.
 

BradtheRad

Super Moderator
Staff member
Joined
Apr 1, 2011
Messages
13,435
Helped
2,656
Reputation
5,306
Reaction score
2,560
Trophy points
1,393
Location
Minneapolis, Minnesota, USA
Activity points
100,463
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.

weak AC rides bias NPN RC in emitter leg passes AC.png

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.
 

dick_freebird

Advanced Member level 5
Joined
Mar 4, 2008
Messages
6,722
Helped
1,981
Reputation
3,966
Reaction score
1,799
Trophy points
1,393
Location
USA
Activity points
53,908
Have you put a proper shroud on the detector to exclude
sources not directly in the desired field-of-view?
 

userx2

Member level 5
Joined
Sep 19, 2008
Messages
90
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
2,378
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.

I have built this circuit to test.

The idea is good but I am having problems with that too.

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 am suspecting the transistor may be saturating.
That would be bad as then all bets are basically off.

Perhaps the test source is not representing real sunlight.


And yes, we have a proper sensor housing which shields light form all but the wanted direction and it is covered with special IR lens material as well.

Testing continues...


Regards
X
 

BradtheRad

Super Moderator
Staff member
Joined
Apr 1, 2011
Messages
13,435
Helped
2,656
Reputation
5,306
Reaction score
2,560
Trophy points
1,393
Location
Minneapolis, Minnesota, USA
Activity points
100,463
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
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.
 

userx2

Member level 5
Joined
Sep 19, 2008
Messages
90
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
2,378
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.
I replaced the resistors with 10 turn pots and experimented for several hours but all to no avail.
The sensor just can't handle it. I could not find any details on IR intensity vs base or collector current. No real further info on the phototransistor.
Due to time constraints, I have given up on doing this with discrete sensors and I am now experimenting with Vishay VCNL4020 sensors that run I2C.
So far, they work quite well in even extreme sunlight. The challenge now is to get firmware working that can talk to them.
 

Toggle Sidebar

Part and Inventory Search


Welcome to EDABoard.com

Sponsor

Sponsor

Design Fast


×
Top