Laser communication with Arduino Uno

I'm actually quite new with usage of Arduino so forgive me for asking this.I'm currently trying to create a simple FSO(laser) connection between two PCs using two Arduino Uno and Processing software.The main goal for the project is to be able to send and receive text or file from one Arduino to the other.I've tried some of the codings I could find however I've still no luck in actually achieving a successful transmission.The laser diode I'm currently using is KY-008 laser module and I've tested using a photoresistor and an SKU 198519 photodiode to sense/receive the light from the laser diode.Perhaps my choice of photodiode was wrong or I'm lacking some of the components required? Therefore,I would like to ask for some guidance on my current project.The coding I'm using is based on the one posted on this page https://stab-iitb.org/wiki/1RE30_DATA_TRANSMISSION_USING_LASER.

Your link appeard duff.

Post your circuit diagram and code

OK i found it.

Circuit diagram shows a 2 terminal diode.
Picture shows a 3 terminal laser diode.

Diagram shows +5V (continuous supply), no modulation !

I have seen better instructables than this.

For modulations,I've read that the standard 38kHz or Manchester encoding would work but I'm not really familiar with them.I've also read that Arduino itself can modulate the pulse of the laser diode with proper coding.Do you have any recommendations on hardwares or codings that I could or should use to achieve the transmission?

I would suggest you start with ir remote circuits.

https://www.google.co.uk/search?q=ir+remote+circuits&rlz=1C1CHWL_enGB674GB674&espv=2&biw=1600&bih=799&tbm=isch&tbo=u&source=univ&sa=X&ved=0ahUKEwi3h5zihpPMAhVEuhQKHaD9D9IQsAQIMA

These use ir leds and recievers which are easier to use than a laser diode.

A proper ir reciever is better as the diode sensor in that example is clear and will pick up allsorts of light (noise).

Driving a laser diode correctly can also be tricky.

If you search there are various modules available for arduino.

This 3 pin device has the photodiode, amplifier and decoding all built in

https://arduino-info.wikispaces.com/IR-RemoteControl

IR led can be driven directly by arduino for short ranges without a transmit amplifier.

I found offers for combined KY-008 laser and sensor kits, which should be usable in first experiments.

I built my own light barrier from a LED and a transistor with its metal case cut off, many decades ago, so that it should be possible to find some usable sensor. Photoresistors are way too slow for reasonable data transmission. Specialized sensors may have a limited frequency band, determined by both the receiver and filter lens (anti-daylight filter...).

I also played around with laser diodes, which look very similar to the one on the KY-008 module. These diodes seem to have a resistor incorporated, and can be used with voltages from about 3 to 8V (triangle wave test). They can be used like a LED, with an (optional) resistor to reduce the peak current when driven by a digital output pin. Dunno what the component on the module is, resistor or capacitor? No problem if it's a resistor, that shall reduce the current - eventually the middle pin allows to bypass that resistor? If it's a capacitor, it should be removed for use in data transmission.

In detail many (IR) remote control receivers with digital outputs have a built-in software filter and demodulator for the detection of a specific carrier frequency (30-50kHz). Such components are not very useful in data transmission, limiting the signal bandwidth to a few kHz. They also have a large sensitive angle, for capturing indirect (reflected) beams, while you want to use a narrow laser beam.

If you don't want to use a kit with paired digital transmitter/receiver components, a scope will be helpful to determine the (possibly very low) response of the receiver. You may have to add an amplifier (comparator) later, in order to obtain digital signal levels. Start with a moderate frequency square wave to pulse the laser diode, until you find a receiver of reasonable response. Then you can increase the frequency, to find out the achievable data transmission rate.

Just curious, how do you want to fix the laser beam to the receiver, in a practical environment?

Boardburner2,I’ve tried following your advice on using IR and indeed it was easier to work with and I’m able to achieve a simple transmission of roughly 15cm in distance using codes from zolalab.

https://www.zolalab.com.br/references/serial2ir.php

DrDiettrich,iirc the KY-008 have a small resistor incorporated though I’m not sure what the middle pin is supposed to do as I once read that it was mistakenly labeled.I do have an extra SYD1230 5mW laser that I bought just in case I’ll need it.

Cryozenics:
Boardburner2,I've tried following your advice on using IR and indeed it was easier to work with and I'm able to achieve a simple transmission of roughly 15cm in distance using codes from zolalab.

https://www.zolalab.com.br/references/serial2ir.php

DrDiettrich,iirc the KY-008 have a small resistor incorporated though I'm not sure what the middle pin is supposed to do as I once read that it was mistakenly labeled.I do have an extra SYD1230 5mW laser that I bought just in case I'll need it.

What are you trying to achieve. ?
Laser is good for long distance (KM are possible) but t has a very small beam width which means that pointing accuracy is very important.

The technical details of using a laser diode are somewhat different to using a simple led however.

Basically,if possible I want to upload small data(txt file etc.) from a pc to the Arduino(transmitter) which will then convert the bits and transmit it to another Arduino(receiver).The receiver would then reconvert the bits into the original format on another pc.For the laser comm,my original goal was actually to achieve data transmission within a few Meters(roughly 1-3 Meters)

If you amplify the IR diode output rather than driving direct from arduino you should easily achieve that range and more.

I wonder can a 38kHz IR detector be used with a laser? If so the concept in this IR Thread may be of interest.

...R

Robin2:
I wonder can a 38kHz IR detector be used with a laser? If so the concept in this IR Thread may be of interest.

...R

Its possible but using CW modulation can easily saturate those recievers.

Hi,
What are you actual data link distances, can you post a diagram of how your PC to PC link will be layed out.
If is within a house or room, use wifi PC to PC.

Tom... :slight_smile:

Boardburner2:
Its possible but using CW modulation can easily saturate those recievers.

infrared - Can I use a 940nm laser diode for a remote control? - Electrical Engineering Stack Exchange

I used a cheap, red, pen laser. It had no problem working at ~40 feet targetting a Vishay TSSP4038. Even at that distance it was tricky aiming the laser though so you definitely want a laser pointer with a focusing optic so you can de-focus it and widen the beam.

Chagrin:
I used a cheap, red, pen laser. It had no problem working at ~40 feet targetting a Vishay TSSP4038. Even at that distance it was tricky aiming the laser though so you definitely want a laser pointer with a focusing optic so you can de-focus it and widen the beam.

Interesting.
I used an ir laser , finding a focusable one was a challenge.

De focussing was needed to avoid saturation i found.

I guess despite being red the intensity is such that it gets through the ir filter.

Yeah you'll find that a red (~one meter distance) or white LED (~three meter distance) works as well. An IR LED certainly gives you the most distance, but I guess what I'm saying is that it's a bit unnecessary to chase after a much-less-common IR laser unless you're really after some extreme ranges. The problem of aiming the laser is going to be much more important than the laser's emitted color.