serial protocol for IR leds

the title is enough self explanatory ; )

i'd like to establish a communication between an IR led and its respective sensor using the RX and TX pins, and the serial transmission protocol as well (the one used to communicate with the pc). In this way i should be able to send and receive data just using Serial.write() and Serial.read(), shouldn't i? is this possible? if yes, which is the proper baud rate? what distance range can i cover in this way? is possible to converge the light into a point (like a laser, but less dangerous)?

thanks in advance!!

HCPUNK:
the title is enough self explanatory ; )

Well, it's not, otherwise you wouldn't need to explain anything else, but you did! :wink: :stuck_out_tongue:

i'd like to establish a communication between an IR led and its respective sensor using the RX and TX pins, and the serial transmission protocol as well (the one used to communicate with the pc). In this way i should be able to send and receive data just using Serial.write() and Serial.read(), shouldn't i? is this possible? if yes, which is the proper baud rate? what distance range can i cover in this way? is possible to converge the light into a point (like a laser, but less dangerous)?

It is possible, sure, every optocoupler does exactly that and is used in many applications (i.e. MIDI IN, glass fiber stuff). The proper Baudrate depends on the emitter and receiver used, noise, ambient light, filters, frequencies etc. and the distance depends a lot on amplifying the output of a sender (you can use the mirrors on the moon if you like to run some serious test ]:smiley: ).

There are MANY IR emitters/receivers. If you read the specs of them you will see that many have data about the angle of transmission.

And, no, lasers are not dangerous at all as long as you do not exaggerate on power (<1mW i.e.) and use visible light (google for Laser security classes).

oh well, measuring the distance between me and the moon is not what i aim for :slight_smile:
instead, i'd like to build a laser tag gun (laser tag is such softair with ir "flashes" instead of bullets, and a life counter) and i need to establish the communication between the sensor (placed in a cap or a gilet, and somehow connected to the gun) and the gun (in which has been mounted an IR led, its lent and a microcontroller that should manage the life counter, avoid or let any friendly fire, a recharge time and something like a "killed" flag), that must cover almost 40 or 50 meters.. a middle way between a remote control and one of those lunar laser :wink:

so, i need to be able to send and receive data while moving, and from a long distance.. is it possible with IRs or should i use lasers? could you suggest me some emitter and receiver as well?

e soprattutto, visto che sotto al tuo nome c'è scritto Italy, perchè stiamo blaterando in inglese? =P

lol, italiano va bene per me, but we are in the english speaking forum.

Anyway, the setup is not entirely clear.

Also IR 50m with LED's is quite a distance to cover.

What about shooting with ~650nm lasers (in that case maximum class 2 or 2M lasers which do not pose a danger for the eye) and reporting the results via wireless modules like zigbees (mounted on an arduino Fio so you have also the LIPO charge as a nice by product); could that be an option? The zigbees are serial protocol and very easy to integrate.
How precise the laser point, maybe a divergent so you use less sensors on the body part?

I got some doubts about the modulation of a laser with a low price tag (I guess you search a low cost solution) so you could have also an ID on the shot.

the gun and the sensor module (cap or gilet) can (or ever ought to) be linked together, because everyone should use his own gun and sensor, so a wireless solution is not what i'm looking for, also because everything must be as cheap as possible (we managed to use a 16MHz@5V arduino mini powered by a standard Ni-MH softair battery).

but i agree that a class 2 laser might work better than a IR led, but i'm afraid i haven't understood the last part: do you think i'll need an expensive laser in order to send data to the sensor?

do you think i'll need an expensive laser in order to send data to the sensor?

Over that distance yes. An IR emitter is just not going to be powerful enough. There is no cheap solution for what you are trying to do, sorry.

got it. how much should one of those lasers cost?

Look on Ebay, about $5 - $10

oh yes, i've found lots of 650mn class 2 lasers at 6€, that is cheap enough.. are those lasers able to send serial data? are they affected by some kind of delay or inaccuracy?

still, the design is flawed if I understood all the specs.

  • You want shooting between players (like a laser arena), and distinct between enemy and friendly fire.
  • The results of shooting to be transmitted somewhere or between players only?

If you want to distinct between friendly and enemy fire you need to identify the source. That can be done by using pulsed lasers (not cheap laser pointers), high power IR-LED's. Modulated lasers are expensive but you could identify every single player hit.
The problem of using continues laser (or whatever light emitter) is sun light. Also the size of the receiving sensors will be a problem. You said a cap and gilet. But diodes are quite small, so you would need some of them. If you use laser pointers you need more sensors or widen the beam by using lasers that permit to change/move the collimator lens.

Anyway, also IR -LEDS could work if you use good lenses and high power LED's (but 50m is still a lot, I guess 20m is fair). In this case it is easy to receive a hit as the light beam will be diffuse and you can modulate very easily for various players and player situations (player is dead, player has shields and needs more hits etc.).

The transmission of results between players is not possible with just using lasers (the player needs to point it to where?), and if you need that the wifi come-in.

To make things short, you want to enhance a system like Q-ZAR (Q-ZAR - Wikipedia)?

The results of shooting to be transmitted somewhere or between players only?

not really. i'll try to explain better with an example:
-firstly, all the players need to select the settings (health, damage per shot, delay between each shot, recharge time, magazine capacity, friendly fire allowed/disallowed)
-the match starts: team1 (players A, B) vs team1 (players C, D)
-playerA shoots at playerC => playerC's controller recognizes the enemy shot and his health diminishes by "damage per shot"
-playerA shoots at playerB => playerB's controller recognizes the friendly shot and if friendly fire is allowed, his health diminishes, otherwise nothing happens
-playerA fires some shots to the air => if he has reached a "magazine capacity" number of shots, he have to press a recharge button and wait "recharge time" seconds
-playerA shoots again at playerC => playerC's controller recognizes the enemy shot, diminishes the health and if "health"<0, playerC dies and becomes unable to shoot anymore
-and so forth, until everyone from team2 dies..

is anyone still interested? come on guys, even the smallest help will be appreciated :slight_smile:

Have you looked at IRDA?