Show Posts
Pages: [1]
1  Using Arduino / Sensors / Re: Working with IR and lenses on: June 24, 2011, 06:18:20 pm
Errr...what kind of lens? Lenses can either focus light or disperse it. Additionally, some lenses are good at passing infrared light and some lenses heavily attenuate it. It's not just a piece of glass!

It's a double convex lens. I don't have any information on whether it works with IR well, but it works with a red LED perfectly.

There's also the focal length of the lens to consider

I have the LED exactly the focal length away from the lens (in this case it is 15 cm), and I did make sure that it was focusing well using a red LED first. I could see the red LED on a white piece of paper in the day time (my windows were closed and lights were off but light from outside still gets in anyway) from 10 feet away.

What specific IR sensor are you using?

The sensor I'm using is the TSOP4856 (Datasheet:
2  Using Arduino / Sensors / Working with IR and lenses on: June 24, 2011, 04:29:00 pm

I am making a laser tag system with my arduino and I've moved on to the step of sending my IR LED through a lens to focus the light to get more distance and prevent a huge tag radius that would form otherwise.

Some background about my protocol: Every time the gun is shot, I send a unique ID of who is shooting (so that the player who is shot will know who shot him) using SoftwareSerial through a 555 timer chip. The chip is hooked up to create a frequency of 56khz so the IR light will be the right frequency to be sensed by my 56khz IR sensor. To make sure no bit errors are observed, I simply send the UID, currently simply a number between 1-14, twice in the same byte. Eg: for UID 3, the bits sent would be 0011 0011. Then on the receiving end, if the two nibbles are not the same, the byte is ignored and it waits for the next byte.

Anyway, the system works 100% close up and without a lens. The UID being sent by the laser gun is always correctly decoded and there are never any problems. When I introduce using a lens, though, the data transfer only works up to a foot away from the lens with an error rate of around 1 wrong identification in 10, but any farther and the whole transfer goes to hell. At one point about 4 feet from the lens, the data being sent through the beam was 0% correct; it was literally never decoded correctly (for the example UID 3, it detected values 5, 10, 11, and 13 but rarely ever detected the same incorrect value more than a few times in a row).

And yes, these error rates are including my automatic ignoring of bytes whose nibbles are not the same, meaning that at 4 feet away the transfer of data somehow changed from 0011 0011 to 0101 0101 for 5, 1010 1010 for 10, etc.

My main question is this: If my system worked 100% without a lens, why does adding a lens cause such terrible failure rates? Is there something else I should be doing to use a lens?
3  Using Arduino / Sensors / Re: Infrared communications on: June 06, 2011, 12:36:29 pm
If you want to modulate the serial stream, look at putting an external 555 circuit to do that bit for you.

Thank you so much! Using the 555 timer plus the SerialSoftware code you showed me (with some tweaking) worked like a charm!
4  Using Arduino / Sensors / Re: Infrared communications on: June 04, 2011, 05:26:55 pm
The problem with just straight sending the bits is that with an IR receiver, it has to receive a signal at a specific frequency, eg the IR receiver only outputs that a signal is detected when the IR LED is blinking (I tried with always on and it didn't work, then I tried blinking it at some arbitrary frequency and it worked sort-of). The SoftwareSerial you provided is actually the first thing I tried to do, before I realized I needed to have an actual frequency along with the data.

I'm thinking that I can blink the LED at the frequency (in order for the receiver to detect it) when I need to transfer a 1 and turn it off when I need to transfer a 0, but I don't know how to easily sync up the sending and receiving to make sure it goes over well.

Here is the spec of an IR receiver:  . Look in the section of "TYPICAL CHARACTERISTICS", where it shows that for the receiver to detect the IR light, the light has to be turning on and off.
5  Using Arduino / Sensors / Re: Infrared communications on: June 04, 2011, 11:44:56 am

That's how IRDA does it.

Well the problem with that is that I'm also going to use an XBee wireless shield for the game, which also uses the serial port. Is there a way to switch between where the serial writes to?

Also, if I were to use the serial pins to send/receive, how would I know at what frequency it will send to use the correct IR receiver? (or is it a setting like when calling Serial.begin() )
6  Using Arduino / Sensors / Infrared communications on: June 04, 2011, 12:01:20 am

I'm trying to create a laser-tag unit with my Arduino. Right now the issue I'm working through is how to tell who tagged whom when a shot is fired at someone else.

I know IR receivers receive signals at a certain frequency, but I am having trouble figuring out how to transmit and receive at that exact frequency. Once I can sync up the sender/receiver, I'm sure I could finagle up some on-off keying system to send a few bits of data identifying the shooter. I'm sorry, I'm probably not being very clear here...

Basically: Does anyone know how to send a few bits of data from an IR LED to an IR receiver?
Pages: [1]