IR LED and Photodiode Communication

Hi! Does anyone have a sample code for IR LED and Photodiode Communication that uses two Arduinos? The IR LED goes on another Arduino while the Photodiode goes on to another and the Photodiode still has to get values from the IR LED. Thanks in advance. :slight_smile:

Start by reading the Arduino Cookbook, it will give you a great incite as to what you want to do and how to do it. This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil

You won’t get much range with that say about 3 mm. For greater range you need an amplifier.

What sort of signals do you want to transfer? Is it just a beam breaker? If so see
http://www.thebox.myzen.co.uk/Hardware/Sneak_Thief.html

If not a beam breaker what are you trying to do? Communicate can mean many things

The code is simple turn the LED on and off just like in the blink sketch and look at the photo diode with a digital read or analog read depending what pin it is connected to.

gilshultz:
Start by reading the Arduino Cookbook, it will give you a great incite as to what you want to do and how to do it. This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil

thanks! I will try to check it out

Grumpy_Mike:
You won’t get much range with that say about 3 mm. For greater range you need an amplifier.

What sort of signals do you want to transfer? Is it just a beam breaker? If so see
http://www.thebox.myzen.co.uk/Hardware/Sneak_Thief.html

If not a beam breaker what are you trying to do? Communicate can mean many things

The code is simple turn the LED on and off just like in the blink sketch and look at the photo diode with a digital read or analog read depending what pin it is connected to.

Say, the LED is on one Arduino board and the photodiode (which is on another Arduino board) is supposed to read it and return values to the serial monitor. I’m not sure how photodiode will be able to read the LED if they’re in separate Arduinos. :cry:

I'm not sure how photodiode will be able to read the LED if they're in separate Arduinos

Sorry but I am not understanding what you are not understanding about this.

The photo diode is read with a digital read or analogue read, depending on what sort of pin you connect it to. Then that Arduino prints out the result to the serial port.

The fact that the light is coming from another Arduino has nothing to do with anything, it is just a source of light. It could be an IR flashlight for all it knows or cares.

Maybe something like this: http://www.zolalab.com.br/references/serial2ir.php
It demonstrates serial communication between two Arduinos over an infrared link using an Ir emitter and photo diode/photo transistor.