IR gate works only on short distance.

Hello everyone,

i'm trying to make a time measuring IR gate. Code is running, everything works fine...BUT only on very short distance.

The idea behind the sensor (gate) part was to put IR led and IR sensor in the same box and let the beam bounce on the reflector.

Simple scheme:

Why it is like this? Because it will be measuring passing cars and I wanted to avoid a cable being run over.

How does it look:

I tried a lot of options and positions with that PVC pipes, it "worked" kind of same in all situations.

Used led diode: https://www.gme.cz/data/attachments/dsh.520-049.1.pdf; 30 ohm resistor.
Used sensor: https://www.gme.cz/data/attachments/dsh.520-045.1.pdf

Part of code which is responsible for the IR (with only function: light up some light when you see signal, you can see it in the picture above, the red one):

#include <IRremote.h>

#define PIN_IR 3
#define PIN_DETECT 2
#define PIN_STATUS 13

IRsend irsend;
void setup()
{
  pinMode(PIN_DETECT, INPUT);
  pinMode(PIN_STATUS, OUTPUT);
  irsend.enableIROut(38);
  irsend.mark(0);
}

void loop() {
  digitalWrite(PIN_STATUS, !digitalRead(PIN_DETECT));
}

Back to the issue:

In the photograph you can see maximum working distance. I need to squeeze a speeding car in that space :slight_smile:
I have no idea why it does not work on, for example, 3-4 meters. LED is running great (theoretically). Sensor is good aswell, when I take an TV remote and aim at the sensor from distance, it catches light beautifully.
I tried a 1,6V 50mA LED with 70 ohm resistor aswell but it works even worse...

Where could be the problem?

Thanks, John

Firstly a retro-reflector like that reflects directly back, not offset 3cm or so like your TX and RX are - place them
closer together with a light-proof screen between them.

Once you get to longer ranges this won't be so important as the angular difference is less.

In general increasing range means reducing optical losses - meaning lens on the transmitter,
lens on the receiver. You may need to change to using a laser for longer range.

Losses on any path like this are 1/r^2, so doubling the distance reduces the signal to 25%. You have
to increase path perhaps 10 to 20 times, so you need 100 to 400 times better signal path. Lenses
can probably achieve this, but aligning IR lens systems means you need a digital camera that can see
IR (most have IR filters).

MarkT:
Losses on any path like this are 1/r^2, so doubling the distance reduces the signal to 25%. You have
to increase path perhaps 10 to 20 times, so you need 100 to 400 times better signal path.

I understand, but how it is possible that any IR TV remote in the house is able to "trigger" my timer on like 8 meters (mabye more)?

Does it mean taht the LED is weak? Mabye the IR library makes is somehow weak?

MarkT:
Firstly a retro-reflector like that reflects directly back, not offset 3cm or so like your TX and RX are - place them
closer together with a light-proof screen between them.

Had it without the tubes, didn't work...

JohnyStone:
I understand, but how it is possible that any IR TV remote in the house is able to "trigger" my timer on like 8 meters (mabye more)?

Did you get my point about the retro reflector reflecting straight back into the transmitter?

MarkT:
Did you get my point about the retro reflector reflecting straight back into the transmitter?

I did. I moved the transmitter as close as possible (about 0,5-1cm) to the reciever and prevented a "light-short-circuit". That made massive improvement. Now it works in 135cm instead of 30cm.

Now it's really just about that leds performance...or not?

Any more ideas?

Thanks for helping! :slight_smile:

Well there are various factors aren't there? Quality of retroreflector, accuracy of geometry of the light path.
Playing with lenses ought to make quite a difference.

This receiver AFAIK won't work with a continuous (not modulated) IR signal.
From the datasheet: "After each burst which is between 10 cycles and 70 cycles a gap time of at least 14 cycles is necessary."
Leo..

What I did:

I added second led in series, this enlarged "working" distance to approx 1,5m.

Strange thing I observed:

When I touch a wire (the conductive part...) connected to leds, signal gets better. It kind of intensifies the performance of the leds.

MarkT:
accuracy of geometry of the light path

This is kind of letdown for me. This is why I have chosen IR over laser. I hoped that the beam tracing will be simple, considering 10° angle of the leds.

MarkT:
Playing with lenses ought to make quite a difference.

I will try some more different types of transmitters. Physically moving with leds does not make any difference.

Wawa:
This receiver AFAIK won't work with a continuous (not modulated) IR signal.
From the datasheet: "After each burst which is between 10 cycles and 70 cycles a gap time of at least 14 cycles is necessary."
Leo..

Thats strange. On short distance it works perfectly.

I think that the problem is just that transmitter(s) are not powerful enough. Even without the refletor (direct TX -> RX) it is unstable. Like I wrote before, every IR remote is much stronger any my device reacts perfecly on long distances (8-10m).

Read your IR LED datasheet. It may say something like max pulse current at some % duty cycle. They may handle upwards of 1000mA when you're playing with a measly 30-50mA.
TV remotes are pulsed and most likely give more current than you expect.

Use a modulated IR transmit signal (too slow for speeding cars).
Or..
Use a continuous mode IR receiver.
The PNA4602M works for me.
^ that, and only 30mA peak LED current with a battery powered transmitter on the opposite side of the track gave me a reliable five meters in daylight.
Leo..

Wawa:
The PNA4602M works for me.

They are not manufacturing this one anymore...
What about this one?
http://docs-europe.electrocomponents.com/webdocs/0d1b/0900766b80d1bdc8.pdf

Or...

What about to make it all a laser technology...
The retroreflector should make the aligning easy...theoretically.

As others have said, modulation, more transmit power, and your light shield tubes need to be much longer so that the transmitter and receiver can only see the reflector and nothing else in the background.

When using IR outdoors you have to compete with the IR light from the sun which swamps the receiver and greatly reduces its sensitivity. Shielding it from the ambient light is the key to success.

Had a quick look at the Vishay TSxxx range.
I seems that the TSS4038 (the third "S" for sensor and the "38" for 38kHz) is made for beam break.
Maybe someone else can confirm this.
Leo..

I've heard before that IR LEDs in remote controls are indeed pulsed at a pretty high current, indeed towards that 1,000 mA. It works as signals are very short, so the LED doesn't get a chance to heat up. Doing so on a break beam sensor (which is active all the time) will kill the LED very soon.

You mention the LEDs have a 10° angle - this means intensity drops fast when distance increases. Your PVC tubes are not helping here - they catch a lot of the stray IR.

mikb55:
When using IR outdoors you have to compete with the IR light from the sun which swamps the receiver and greatly reduces its sensitivity. Shielding it from the ambient light is the key to success.

Unfortunately, these poor results (like cca 1,5m max) were "achieved" indoors, with lack of direct sunlight. But I have the point.

Wawa:
Had a quick look at the Vishay TSxxx range.
I seems that the TSS4038 (the third "S" for sensor and the "38" for 38kHz) is made for beam break.

You mean this one?

http://www.mouser.com/ds/2/427/tssp40-461157.pdf

Mabye I should buy some "freindly" leds aswell. For example, something like this:

3° angle! Thats some solid light flow going to the retroreflector...

wvmarle:
I've heard before that IR LEDs in remote controls are indeed pulsed at a pretty high current, indeed towards that 1,000 mA. It works as signals are very short, so the LED doesn't get a chance to heat up.

Thats true, I did some research.

wvmarle:
You mention the LEDs have a 10° angle - this means intensity drops fast when distance increases. Your

Check the led I posted few lines above. They sell 3° and 5° models. But I'm not sure if they will suit an arduino pin well...

JohnyStone:
You mean this one?
http://www.mouser.com/ds/2/427/tssp40-461157.pdf

Mabye I should buy some "freindly" leds aswell. For example, something like this:
https://www.vishay.com/docs/84240/vsly5940.pdf
3° angle! Thats some solid light flow going to the retroreflector...

Yes. As said, the third letter has to be "S", not "O" as most ones are.
But have not tried this...

I used the SFH400 (6°) in a project (also obsolete now), and that was hard enough to line up.

The SFH400 and the PNA4602M gave me a solid five meters in bright indoor light (7meter dropoff) with only 30mA peak current.
Two units (no reflector), no optics, no tubes/shielding, bright indoor light.

Tried the reflector way, and abandoned it. Too hard to line up quickly, and inefficient.

You can use two or more LEDs in series in a vertical array to increase distance.
Each LED doubling is about 1.4 times the distance.
You should be able to drive two (maybe three) IR LEDs (Vf 1.2-1.5v) in series from an Arduino pin.
Leo..

I will buy a 3° model and give it a try.
I did some trigonometry -> 3° will make on 5m a circle with approx. 26cm diameter. Thats ok to hit that reflector.

I just don't understand that current thing.
The led has 1,65V, 100mA. Does it mean, that with the right resistor it will work, but only with Arduinos approx 50mA? So on half power? Is the performance drop linear?

If I solder 3 in series, I dont need any resistor?

Vf of a LED is temp and current dependent, so always use a CL resistor.
Use an external transistor if you need to drive the LEDs with more than ~30mA peak.
Leave at least 1.5-2volt headroom for the CL resistor.
Leo..

I don't understand. With the use of the Ohm formula, for 1,65V 100mA led and 5V power suply:

1x led => 33,5 ohm resistor
2x led (series) => 17 ohm resistor
3x led (series) => 0,5 (0) ohm resistor

So this kind of thinking is wrong? You say that I have to use transistor and power the led from "5V" pin? Then I can use the calculations above?

Sorry for my newbieness...

Now calculate the current with those resistor values, but change the drop of the LEDs to 1.6V or 1.55V. Or increase your voltage from 5V to 5.15V.

In the latter case you will notice that the current jumps by 300 mA with that 0.5 Ohm resistor. Doesn't bode well for your LEDs.

The 1 and 2 LED options are safe.