Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

IR sensor fails on high lighting intensities

Status
Not open for further replies.
Hello,

I am using the Tsop4838 ir sensor and I am
able to sense objects at different distances.

I then tried to detect those same objects but
with a flash light directed right on the tsop sensor.

To my dismay, the sensor completely died off
producing NO signal at all!!!!

Is this normal? I thought this part was able to
distinguish any disturbances such as Dc lighting,
sunlight ect... from its 38khz signal ???

Has anyone experienced these disturbances
with this sensor ?

PS... For now I have not provided the details
of the optical signal I am using.... as I was only
interested to know if I am the only one experiencing
these issues. However if relevant, I can provide
all the signal details should we think that this
sensor really can work under intense lighting conditions
such as dc lighting or sunlight.

thanks for all feedback
r
 
I haven't used that exact TSOP, but similar TSOP modules have very good immunity to ambient light. Are you sure your IR signal is centered on the right frequency, and that the IR emitter is working right? Try illuminating the sensor with a TV remote...
 
I use a similar TSOP detector in bright sunlight without a problem.

1) Are you modulating the 38 KHz source? A steady 38 KHz source might be your problem.
2) You will need to give more details, like what do you mean by various distances? Are you referring to something like 1,2, or 3 cm or 1,2, or 3 meters? How are the optical components aligned? Please show your schematic.

John
 
Hi guys,

Thanks for your replies.

For my IR LED, I am providing it a 38KHZ burst for approximately 600 us (aprox. 22 cycles). Then I am allowing a gap time of approximately 4.8 ms (aprox. 182 cycles).
According to the datasheet I *think* I am within specs (not sure though)…. You can view the signal the IR is generating in "LED_OpticalSignal.jpg" attachment.

Please view the “Schematic.jpg” attachment for more details.

In the "Schematic.jpg" attachment, I simply vary the Rx resistor to obtain the power desired for the infra red led. Doing so, permits me to see different distances. For example, if I require to detect an object at 3 feet, well there is a particular setting of Rx that will detect an object at 3 feet or closer. All the sensor does is output a continuous square wave when the object is within 3 feet of the sensor as shown in the “SensorOuputSignal.jpg” attachment.

When the lighting in the room is approximately 0-800 LUX, the TSOP sees the wall which is at aprox. 36” and its signal is normal as shown in the “SensorOuputSignal.jpg” attachment.

However, when I direct a flash light right at the TSOP4838 part the TSOP produces no signal as can be seen in the “NoSignalFromTSOP.jpg” attachment.

-Questions...

1) Can you confirm if my IR LED is receiving the correct signal ?
2) I am generating the 38KHZ burst from the PIC32. I am actually generating it from a timer interupt which is:

-Prescalar of 64 and a duty cycle of 16. Ths give the following calculation:

80,000,000/64 = 1,250,000 hz
1,250,000/16 = 78,125 hz

But since it takes two interupts to create 1 cycle, we divide by two to obtain our 38KHZ

78,125/2 = 39062.5 Hz

Now, I have no choice , this is the closest I can come to 38KHZ, since a prescalar value of 17 as opposed to 16 would give me 36764.7 hz which is even worst!

So my question is, would it make a big difference if I have 39.0625 Khz as opposed to 38.0 KHZ?

3) I am using the TSAL6100 IR emitter led. I can't remember where I read this, but apparently the 6200 IR led would be a better match for the TSOP4838 sensor in terms of wave lenght. Should I stay with the 6100 or try the 6200?


I really wonder if this part can handle the brut intensity of the sun and still measure my distances as described above?

All help appreciated.... Thanks

Sincere regards
Rob
 

Attachments

  • Schematic.jpg
    Schematic.jpg
    143.8 KB · Views: 544
  • LED_OpticalSignal.jpg
    LED_OpticalSignal.jpg
    172.6 KB · Views: 186
  • SensorOuputSignal.JPG
    SensorOuputSignal.JPG
    142.1 KB · Views: 201
  • NoSignalFromTSOP.JPG
    NoSignalFromTSOP.JPG
    167.5 KB · Views: 191
Last edited:
How much current are you driving the IR emitter with? Your driver circuit is an emitter follower, so cannot put the full 5V across the IR emitter and its current-limiting resistor. Use a common emitter driver where the IR Led and its resistor is between the collector and the +5V supply. Also, get the IR emitter current to ~35mA (check its data sheet). You are pulsing it, so operating it near its max rating is ok.

You do not need the series resistor between the TSOP output and the MCU port pin.
 
Hi Mike,

Last I measured was approximately 50ua. But you can
rest assure that if I put 35 ma through the IR led I will
detect objects at 12 feet!!! which is way too far for me.

Are you thinking that there is lack of power through
the IR led and causes my Tsop to produce no signal
when I expose it to a flashlight??
 
...

Are you thinking that there is lack of power through
the IR led and causes my Tsop to produce no signal
when I expose it to a flashlight??

Yep. The drive current needs to be several mA, minimum. I was trying to make a beam-break detector with a range of several tens of feet in bright sunlight, and I ended up putting about 50mA peak through the IR emitter.
 
Hi MikeMl,

I have to apologize.... I measured the IR Led current while the 38Khz burst was running. Holding the PN2222 in forward biasing mode (Fully saturated), I measure 25ma! This allows the sensor to detect 10 feet.

Unfortunately, when I flash the flashlight right on the sensor it blanks out and I receive no more signal???
Man!!, am I discouraged!!

I think even though I move the Rx and the IR led to the collector side I will still get the same problem.

I was wondering, are you sure its not the IR led that is not the best match for this sensor... maybe I should try a TSAL6200 instead... what do you think?

Also, are you sure its not the fact that my 38KHz burst is a little higher which may cause the problem???

r
 
...Unfortunately, when I flash the flashlight right on the sensor it blanks out and I receive no more signal???
Man!!, am I discouraged!!

That may not be a fair test. Have you tried with just normal room illumination...
 
That may not be a fair test. Have you tried with just normal room illumination...


Yes, it works very well with incandescent/fluorescent lighting... up to about 1000 lux or even perhaps a bit more. But when a bright source like the sun or a flashlight
beams right at the sensor... it seems like the sensor can't handle it and completely stops sending any signals!!!!

This is weird... some people say this is normal, others say, this should not happen and others say it is possible but you have to tweak the circuitry with some sort of
suppression circuits.... LOL.... I don't know what to make of this anymore.... :)))

bof!


Oh by the way, I removed the series resistor... but the issue persists.
r
 
Last edited:
I then tried to detect those same objects but with a flash light directed right on the tsop sensor.
The flashlight probably saturates the detector. Too much light and IR from the flashlight.
 
I have never put my TV in bright direct sunlight and tried to change channels with the remote. I betcha it will not work.
 
The flashlight outputs IR.
If the flashlight only output "white" with no IR, the receiver probably can not filter out all the white light.
 
I will try one last test tomorrow... I will raise the
led's current up to 50 or 60ma and see if
the tsop will detect the signal even while exposed
by the flashlight.... just curious to see what will happen!


then if it still won't work.... I will just have
to change the sensor's direction more towards
the ground.... or something like that....

thanks all for your help...
really appreciated
r
 
... I will just have
to change the sensor's direction more towards
the ground....
r
Just dont aim the flashlight at the detector while you expect it to respond to your remote.
 
As I mentioned earlier, I have used a TSOP receiver in direct sunlight to detect an object by reflected light. It also works indoors. The IRED is shown. The steel tubing is 1" square. The receiver is behind the plastic.

Here's a picture:
latch_closed.png

I run the emitter at 5 mA or so directly from a pin of a 12F509. I don't recall whether you are using reflected light or beam break. To do reflected light at several feet might be tough. But for beam break, it should be possible. Have you tried putting the detector at the bottom of a short (2 cm), IR-opaque tube about 4 to 6 mm in diameter?

John
 
Hi MikeMl,

Just dont aim the flashlight at the detector while you expect it to respond to your remote.

Yes! But I would be cutting corners!!! read on as to why....

Hello jpanhalt,

As I mentioned earlier, I have used a TSOP receiver in direct sunlight to detect an object by reflected light. It also works indoors. The IRED is shown. The steel tubing is 1" square. The receiver is behind the plastic.
...
To do reflected light at several feet might be tough.

Yes that's what I am trying to do is detect reflected IR light for several feet... 3 feet max to be exact. So I guess what I am doing is not a beam breaker after all... its simply a sensor which detects reflected light bouncing back from an object like a wall or anything else for that matter. So yes, my set up consists of the sensor and the IR led emitter placed next to each other facing the object(s) they must detect.

But even if its one foot away ... its still not as easy as we might think even though we put the IR receiver behind a dark opaque plastic... here's why:

The beauty of having an IR led next to a sensor that can detect the IR signal bouncing back from an object several feet away is that the detection should always occur within a pre-selected distance weather in sunlight or not.

You see, I have done tests today, and I can detect an object 12 inches away while a flash light is smack on the sensor. What made this possible is just by increasing the amount of current through the IR led. At this point the led is drawing approximately 35 ma. So this works. Yes, I will confirm that 10KLux of DC lighting coming from a flash light straight into the TSOP4838 sensor works!!! The problem is, that when I shut the flash light and the lighting goes down to 400 LUX (which is my regular office lighting...I simply have a fluorescent light above my head)... well, the sensor still detects the object, but now, it detects it as far as 4 feet!!!!!

That's not good!!!! I have to somehow, measure the ambient lighting every minute or so and then, based on the required distance, I have to set the correct current for the IR led so there would be no IR overshoot in respect to the amount of ambient lighting at that instance in time.

My device has to constantly adjust its self according to the amount of sun/ambient lighting available at any given time because I always want that object to be detected at 12" and not 4 feet!!!

Now I used, the above example with a 12" distance. At other times, one may set the maximum detectable distance at 18", 24" 28" or even 3 feet!!


Bof..... I am taking a break now LOL!

I will wait and hear what you guys have to say about this!!!

Thank you for any suggestions !
r
 
Last edited:
Have you considered the Vishay 4038 (etc.), which is a sensor designed for sensing distance based on signal strength?

**broken link removed**

Many other applications require a reflective sensor that detects not only presence but also proximity by measuring the strength or weakness of the reflected signal. Instead of a fixed detection threshold, analog information from the sensor is needed. This is possible with the TSOP4038, TSOP58038, and TSOP58P38 IR proximity sensors. The length of the sensor’s output pulse in response to the emitter signal varies in proportion to the amount of light reflected from the object being detected. For near objects, the output pulse approaches 100 % of the emitted pulse, for far objects the output pulse becomes shorter.

Trying to get an on or off detector under such differing conditions could be a real challenge.

John
 
Hi jpanhalt,

Well, I don't think that a sensor sensing distance based on signal strength would
be the answer. Because the way I see it, suppose my object
is at 20" from the sensor and at noon where the sun is at its maximum
intensity, the sensor may provide a pulse width
in respect to the strenght of the ir light being reflected from the object.

But because of the sun's strength, the sensitivity of any sensor might
be attenuated. As the sun heads towards its sunset, even though the object
is still at 20", because the sunlight intensity weakened, I think the sensor's
sensitivity will rise a little hence allowing the detection on the
object at further than 20".... perhaps 40"!!!!!

I think the issue here is that all these sensor's distingiluish
a particular Ir signal in any lighting condition by varying their
sensitivity, and when this happens,the trade off is that the maximum/minimum
distances are altered....

I may be wrong in my analyses... but so far
my experiments portray what I am trying to explain!

r
 
Status
Not open for further replies.

Latest threads

Back
Top