Laser transmitter, photoresistor receiver communications

Here is a demo of a laser/photoresistor transmitter/receiver.

On one Arduino is connected a laser. On another is connected a photoresistor. Data is transmitted from one to the other. Serial output on the receiver side shows the received packets.

My bench tests show 100% transmit/receive accuracy, but I’ve yet to apply the config to a practical across-the-room type test. Also, external light conditions may affect the code’s interpretation of on/off that the bench tests avoid (as I have the laser just an inch from the photoresistor in the test.)

I don’t actually have a practical need for this at this time, but having received a bag of lasers with photoresistors (amazon) I just had to try something.

Maybe someone wants to make a library out of this concept.

LaserXmit.ino (1.72 KB)

LaserRecv.ino (7.9 KB)

You may want to modulate the laser light at 35-40 KHz in a similar fashion as an IR remote does, and for the same reasons.

There are significant differences between Light Dependent Resistors (photoresistors) (which have a 20-30 ms response time) and modulated IR receivers. I won’t get into that here. Frankly, and perhaps mistakenly, I never considered kHz levels of blinking.

For my experiment, I kept my speeds down to the level of, basically, ship-to-ship morse code flashing.

Some of my tests with a pulse width of 50 ms started to get errors. I use 75 ms in my current tests, but the code I initially posted uses 100 ms. Also, the code is using a 10% pulse length margin of error which I have not considered expanding. The use of a double length pulse for ‘1’ bits could be reduced some without overlap, to say 1.5. Furthermore, I’m using a 2 ms sampling rate, that could be tweeked or changed to use interrupts. So, there is room for speed improvements.

I guess if transfer speed was my goal, I would have just used IR in the first place.

Let’s just say that if not for “seeing” the blinking laser, the project would have interested me less.