Infrared communication between 2 arduinos

Hi guys, I am new to arduino and I want some help. I have 2 arduinos and i want to send from the first arduino, the input of the serial monitor, to the second arduino, using ir leds, and see the message in the serial monitor of the receiver.

I use something like that in the transmmiter:

void setup() { Serial.begin(9600); Serial.println("Enter a word or a phrase:"); }

void loop() { if (Serial.available() > 0) { serialinput = Serial.read(); } /*then i want here to use an irsend to put the serialinput and send it, via ir to the other arduino and see it in the serial monitor of the receiver. */ // something like this: irsend.sendSony(serialinput, 20) }

So, can you tell me if this would work and which irsend should i use, because i dont know the difference between them? (for example there is a sendSony, sendNEC, send RC5 and many other). Or if I can learn their differences from somewhere, because i cant find them.

10 seconds with Google found me this http://www.righto.com/2009/08/multi-protocol-infrared-remote-library.html and over 100,000 other hits

which irsend should i use,

It does not matter as long as your receiving program matches.

sotis7: Hi guys, I am new to arduino and I want some help. I have 2 arduinos and i want to send from the first arduino, the input of the serial monitor, to the second arduino, using ir leds, and see the message in the serial monitor of the receiver.

I use something like that in the transmmiter:

...

So, can you tell me if this would work and which irsend should i use, because i dont know the difference between them? (for example there is a sendSony, sendNEC, send RC5 and many other). Or if I can learn their differences from somewhere, because i cant find them.

Are you looking for a library, or are you writing the code yourself, as a learning experience? I did almost the same thing, hooking up four optocouplers between a Raspberry Pi and an Arduino, writing my own implementation of the SPI protocol at both ends. It worked well, though wasn't very fast, but that was not important.

The reason for the optocouplers being that the Raspberry runs at 3.3V and the Arduino at 5V.

The SPI protocol has the advantage that the direction (input/output) of all (four) pins is predetermined, and timing is explicit, contrary to TX/RX type serial comm. Also there are no pullups or pulldowns, as with i2c. If you're not familiar with SPI inner workings, then check it out on the internet. It is really an elegant protocol, and quite simple to implement. Timing is explicit, and it is by nature bidirectional. It can run as slow as you want, using LED's to see the status of the four lines. Great fun.

If you're looking for libraries, then I can't help you, sorry to say.

There are tons of libraries out there, its just a matter of finding the right search terms for Google.

:-)

This IR Thread may be useful.

…R