RBG LED Detection

Hi there, I'm quite new to this but just started working on a project.

What I am trying to do is have 2 devices each with 1 RGB LED installed and as I bring them within a certain range of each other, the devices will detect one another and change LED colour accordingly. For example if i have the LED set to Red on the first device and the LED on the second device set to Blue then I bring them close to each other, they both turn Magenta.

So basically I just need some idea of what sensors would allow this, whether it be IR or something else and maybe just an idea of the best way to go about it all. Thanks.

How far is " a certain range"? Is it ok if the communications is directional so they have to be facing each other?

I'm quite new to this but just started working on a project.

And you have picked an almost impossible one. Many people have asked about this sort of thing and I haven't seen a solution for this yet. It involves measuring the range between two devices in an omnidirectional way. I am not sure if this is possible but I know for sure it is not easy.

For small ranges inductive coupling would work rather like an RFID reader but you are restricted to about 6".

JesseJames112:
What I am trying to do is have 2 devices each with 1 RGB LED installed and as I bring them within a certain range of each other, the devices will detect one another and change LED colour accordingly. For example if i have the LED set to Red on the first device and the LED on the second device set to Blue then I bring them close to each other, they both turn Magenta.

That's really, really difficult to do.

The only way I can think of doing it is with a video camera looking from above and tracking the LEDs with a vision system. The LEDs would need a radio receiver inside them to receive orders from a controlling computer. Even then it's going to be really really easy to fool the camera.

JesseJames112:
So basically I just need some idea of what sensors would allow this, whether it be IR or something else and maybe just an idea of the best way to go about it all. Thanks.

IR won't tell you the distance between the LEDs.

(And it's directional, easy to cover up with your hand, won't work if there's three of them, etc...)

Grumpy_Mike:
For small ranges inductive coupling would work rather like an RFID reader but you are restricted to about 6".

I agree with this. I don't know how easy it would be to implement inductive RF. I would start with some IR sender code to put out a 40 KHz carrier and on the receiver side filter out the 40 KHz to get a digital stream. The VirtualWire library could be used to receive and interpret messages. You would need a 'broadcast' probe message to see if anyone is in range and then some data exchange messages to allow two devices to agree to mix colors.

What happens when all of the cubes are the same color?