Author Topic: TSOP38x 38Khz IR sensor issue  (Read 1748 times)

0 Members and 1 Guest are viewing this topic.

Offline mribbleTopic starter

  • Regular Contributor
  • *
  • Posts: 202
TSOP38x 38Khz IR sensor issue
« on: November 22, 2017, 09:18:20 pm »
I've been working on a sensor.  The core of it is a TSOP38238 and an IR LED that blinks at 38 Khz with a 50% duty cycle (is 50% duty cycle a reasonable choice?).  I was hoping that with a mirror I could create a light based tripwire just using a mirror to reflect the light that would be at least 20 feet wide as long as I blocked the sensor from direct sunlight.

The circuit I attached was always detecting the signal even when I didn't think it should be.  I tried blocking the IR LED with tape, but it still was being detected.  I added some extra caps in parallel to C3 and C2 thinking it might be a noisy voltage line.  That didn't help.  I then looked at the voltage line on pin 3 of the TSOP package and I couldn't see any signal leaking through at 38 Khz, but I probably wouldn't see anything less than 0.05V with my low end scope.

Then I ran some experiments:
A) I tried changing the IR LED pulse signal to use some frequency that was not 38Khz.  This stopped the detection completely as expected.
B) I tried increasing R1 from 20R to 100R.  That didn't fix it.  Then I tried increasing it to 1K.  This did fix it.  I could now verify the circuit worked, but because the current was so low I could just detect reflected light off my hand to a few inches so I'll need to use much more power in my IR LED.

The only things I can think would cause this issue are what I already tried to check.  Namely:
1) Voltage 38 Khz fluctuations on TSOP's Vs pin that trick it into into thinking there is IR light due to the amplification that happens in the the TSOP.
2) IR light is somehow getting from the LED to the TSOP even though I thought I was blocking it.

I put in 20R for R2 to help with the kind of noise in #1 based on the example circuit they had.  However, the datasheet says this is only needed for Vs under 2.8V.  I'm using 3.3V.  They also didn't recommend a resistor or capacitor value so I just picked some values.

How sensitive are these TSOP devices to 38Khz ripple currents in Vs?  Any ideas on what I can do to improve this circuit?

-Maurice
 

Offline Buriedcode

  • Super Contributor
  • ***
  • Posts: 1611
  • Country: gb
Re: TSOP38x 38Khz IR sensor issue
« Reply #1 on: November 22, 2017, 10:24:48 pm »
Ok, so drastically reducing the current in the IR LED helps, so have you tried removing the IR LED completely?  That would indicate whether it is electrical crosstalk or optical - my bet is optical.

These devices are remarkably sensitive - by design, and you are correct that they can be sensitive to the power supply (thus a good 47ohm + 22uF cap RC filter).  It really does require good optical isolation, with IR blocking materials, surrounding both the emitter and receiver - with just a divider between the two light form the IR led could light up the whole room, bounce of several walls/objects and still be mroe than enough for the receiver to pick up.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5869
  • Country: de
Re: TSOP38x 38Khz IR sensor issue
« Reply #2 on: November 22, 2017, 10:55:48 pm »
You have an optical problem.
You need to block that IRLED completely, meaning at least sliding a piece of aluminium tube over it so it only irradiates the spot you want to monitor. You may also have to block the rear of the LED optically, as stray radiation from there will bounce of anything and confuse the TSOP as well.
 

Offline mribbleTopic starter

  • Regular Contributor
  • *
  • Posts: 202
Re: TSOP38x 38Khz IR sensor issue
« Reply #3 on: November 23, 2017, 12:01:10 am »
Buriedcode, initially I didn't know what you meant by removing the LED, but then I realized you mean short it so that the current usage is the same, but there is no light.  I did this and confirmed it was the optical issues Bena said it was.

Just using aluminum tubing doesn't work.  it must be leaking through the back.  I tried covering it as best I can and there was still some light leaking over.  Then I covered the detector as best I could.  Only with both completely covered in tinfoil could I get things good enough to stop triggering.

I built a separate emitter and when I had emitter/detector separated by a few feet then things worked as I wanted.  That said the distance wasn't what I was hoping to get.  I think I'm going to need to separate the emitter and detector.  Plus I'm going to need to increase the current of the emitter significantly to get the range I want.  Is there anything about briefly using IR LEDs beyond their current spec with a low duty cycle?  I seem to remember IR remotes emit lots of current when active.  Does anyone know what kind of LEDs they use and the circuits?  I will just switch to a 555 timer to handle the pulse generation if I separate the emitter from my main micro.
 

Offline Buriedcode

  • Super Contributor
  • ***
  • Posts: 1611
  • Country: gb
Re: TSOP38x 38Khz IR sensor issue
« Reply #4 on: November 23, 2017, 02:14:48 am »
I didn't necessarily mean short the LED, just remove it to eliminate optical crosstalk.  But you are right, shorting it would keep the same current, which could possibly induce small currents in nearby wires, so was worth a check.

If you have the emitter in the same housing as the receiver, then yes you will require double the range (20 foot, gap - 40 foot for there and back) but that still isn't unheard of with standard IR receivers and emitters.

I don't see why you would need a mirror, I would have thought just a white strip or a retro-reflector (the kind used on bicycles, road cats eyes etc..) would be much more appropriate and wouldn't require careful alignment.

I believe you can reduce the duty cycle of the 38kHz carrier and raise the current, but remember - devices used in remotes are "low duty" by use as well, never designed to constantly transmit for hours on end. I wouldn't go over 100mA peak (although many datasheets say you can go much higher).  Also, you can double modulate, if you don't mind a slight delay between beam, breaking and output, or if you don't mind missing very fast objects that break the beam for milliseconds.  This would require two 555's but will save power, and with 38kHz bursts every say 10ms, plenty of time for the emitter die to cool down so you could increase the peak current.  If you only wish to detect relatively slow objects, or large ones where the beam break will last longer, you can of course reduce the burst frequency further.
Detecting would require a missing pulse detector - starts to get more complicated.

One thing that will increase range, and most likely improve the optical crosstalk situation would be decent optics.  I'm not suggesting lab grade IR lenses here (we're still talking light here, not long wave IR) but a couple of cheap convex lens, and a couple of plastic tubes to mounting them in.  With the lens for the emitter to make it diverge less, and the one for the receiver to make it 'see' less.
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 6958
  • Country: ca
Re: TSOP38x 38Khz IR sensor issue
« Reply #5 on: November 23, 2017, 07:13:32 am »
These IR receivers like quiet power and I'm not sure how good your 3.3V rail is, with pulsing the TX led.
I would use 100uF cap and 100R as a Vcc filter to the module. Your 0.1uF and 20R I think is too small. Even 100mV of noise hugely affects range. You might be getting some feedback through the 3.3V rail, as well as the optical feedback.
 

Offline macboy

  • Super Contributor
  • ***
  • Posts: 2254
  • Country: ca
Re: TSOP38x 38Khz IR sensor issue
« Reply #6 on: November 23, 2017, 03:41:03 pm »
These IR receivers like quiet power and I'm not sure how good your 3.3V rail is, with pulsing the TX led.
I would use 100uF cap and 100R as a Vcc filter to the module. Your 0.1uF and 20R I think is too small. Even 100mV of noise hugely affects range. You might be getting some feedback through the 3.3V rail, as well as the optical feedback.
+1
I commonly use 100 R and 100 uF as well. These module use very little power so the 100 R doesn't drop any significant DC voltage, but it is a HUGE impedance for noise. A small ferrite bead on the Vs line of the module, or on one leg of that 100 R resistor might also help, worth a try if you have one handy.

I'd try limiting the slew rate of the drive signal for the MOSFET.  Try a capacitor around 1 nF from Gate to ground (time constant RC is then 1 microsecond, plenty fast enough but not too fast). This can very significantly reduce switching noise. Also put a decoupling capacitor (10 uF, maybe 0.1 uF in parallel) directly from the +3.3V side of R1 to the ground side of the MOSFET, and keep these components close together without long leads (i.e. make the LED's current loop as small as possible). Again this is to reduce radiated/conducted noise, which can and will trick the receiver (specifically, lots of constant background noise at 38 kHz will mess with the AGC circuit making it much LESS sensitive).

Use black heatshrink tubing to aim both the Tx and Rx. Aluminum tubing is reflective, so it still provides a lot of scatter or off-axis output. Compare off-axis performance of aluminum tubing vs heatshrink with a red LED, and you will see what I mean.

You absolutely can use a reflector. A bicycle reflector works very well, as it is retro-reflective. That means that the reflection always goes back toward the source, regardless of angle of incidence, which is very different than a mirror. Red or white should work equally well, as most red plastic is transparent to IR.

edit: I see you'd like to cover 20 feet. You may have better luck without a reflector in that case. There will be a lot of reflection off of surfaces other than the reflector which will be hard to deal with without carefully aimed lenses and such. Pointing the LED directly at the receiver from the far end will be easier.
« Last Edit: November 23, 2017, 03:51:48 pm by macboy »
 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
Re: TSOP38x 38Khz IR sensor issue
« Reply #7 on: November 24, 2017, 03:14:03 am »
I don't think an IR remote receiver would make a very good break beam detector with the IR TX and RX right next to each other, the RX will just detect the IR reflected of the target instead of the mirror!
I would think putting the TX in place of the mirror would be better so the target completely blocks the TX to RX path.
« Last Edit: November 24, 2017, 03:15:34 am by StillTrying »
.  That took much longer than I thought it would.
 

Offline mribbleTopic starter

  • Regular Contributor
  • *
  • Posts: 202
Re: TSOP38x 38Khz IR sensor issue
« Reply #8 on: November 24, 2017, 07:38:20 pm »
Buriedcode, a retro reflector is an interesting option.  I don't think the double duty cycle is very useful since I do want to detect fairly short duration events.  Using a lower duty cycle though would be useful.  Does anyone know how low of a duty cycle these kind of IR circuits work with well?  Would going from 50% to 1% duty cycle be ok?  Any pointers on where you can get cheap optics in smallish (100x) quantities?  I'm not sure I want them though since they would make alignment harder. 

Floodbydust and macboy, in my earlier posts I showed that the false detections were not caused by the noise.  Buy you indicate that the noise could reduce range, which I had no idea. Thanks for that info.

Macboy and StillTrying, thanks for the feedback about separating the transmitter and receiver.  I will do that.  This will also solve the noise issues since I'll just use a different power supply for the tx now.

My main open question is does anyone have experience with the lowest duty cycle I can use with TX and still good detection?  This is my best way to save power during transmission.

Another question is for a 30 ft range outside where the receiver is shaded from direct sun.  What kind of IR LED power should I be using?  Is 100 mA enough or should I be using multiple IR LEDs at 100 mA for this?

 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 6958
  • Country: ca
Re: TSOP38x 38Khz IR sensor issue
« Reply #9 on: November 25, 2017, 05:24:12 am »
The IR module needs some carrier (time) to establish the AGC level. This is why there are five different types of modules.   
That doc also gives hints towards lower duty-cycle (5-50%) being better for battery power, 10% they say but a bit higher IR emitter current.

For range at 30' I believe lenses are required to keep things efficient, instead of wasting optical energy in a relatively wide coverage cone.
I am thinking of possibly a similar application, with garage door safety sensors. Common two-wire bus (combined power and detect and light switch button).  I use a laser pointer for alignment.
I do not know much about the lenses used. Kid's science stores have low cost plastic ones, and Edmund for the big dollar coated glass ones.
 

Offline Buriedcode

  • Super Contributor
  • ***
  • Posts: 1611
  • Country: gb
Re: TSOP38x 38Khz IR sensor issue
« Reply #10 on: November 25, 2017, 03:42:29 pm »
I don't think an IR remote receiver would make a very good break beam detector with the IR TX and RX right next to each other, the RX will just detect the IR reflected of the target instead of the mirror!
I would think putting the TX in place of the mirror would be better so the target completely blocks the TX to RX path.

This is something I think we all skipped over!  It is generally easier to have the emitter and receiver in the same housing (one power supply, one mounting) but this is the main reason one shouldn't do it this way.  One could use a passing object as the reflector, so in normal operation it doesn't detect the carrier (no reflector, no object to reflect it) but then there is no guarantee that an object passing in front will reflect enough to be detected.  You would have to do extensive testing.

Even though you probably have the IR emitters, and we don't know how many you're producing, I'm surprised you haven't got cheap IR laser modules (<1mW).  These will give huge range, and wouldn't require a sensitive receiver.  But again, as Still Trying pointed out, would be much better to have this mounted on the 'otherside' of whatever gap you're using.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf