Laser Modem with an Arduino Microcontroller

This started when I ordered an IR led and phototransistor pair from Spark Fun along with some spare ATMega168 microcontrollers. I first experimented using the IR led to transmit 2400 baud serial to the phototransistor. I programmed my Arduino Diecimila with the sample serial program altering the baud rate and allowing it to run in a continuous loop.

diff ~/arduino-0011/examples/Communication/ASCIITable/ASCIITable.pde laserModem.pde

<   Serial.begin(9600);

>   Serial.begin(2400);
<     while(true) {
<       continue;
<     }

>     number = 0;

<   delay(100); // allow some time for the Serial data to be sent

>   delay(10); // allow some time for the Serial data to be sent

After programing the Arduino, I took out the ATMega168 and wried it into a breadboard along with a 16mhz crystal and 5 volt regulator. For the receiver I used the phototransistor wired into two logic gates of a inverting Hex Schmitt trigger. I used the Schmitt trigger to act as a buffer and ensure only proper logic level enter the USB to serial converter on the Diecimila board. While the first test was successful, I was was not able to place the led more than an inch away from the phototransistor. To allow for more range I used an AD620AN instrumentation amplifier IC. For control I wired the gain pins of the amplifier into a small 10k potentiometer. After adjusting the gain I was able to get about a foot of range with reliable data transfer. Any further and there was too much noise in the signal.

At this moment I wondered if I could use a laser to extend my range. I happened to have a small laser that I pulled from a cheap laser level. I pulled out the laser and wired it where the IR led was minus the resistor. I then pointed the laser at the phototransistor and noticed it instantly reacted. In fact I had to turn the gain on the amplifier way down to use the signal. To test my range I wired my ATMega168 to a 9v battery and mounted the laster in a small vise a few feet away. After adjusting the gain I was able to transmit data easily. Attached is a video along with the final schematic I used.

View the Laser Modem Video Here

This entry was posted in Eletronics. Bookmark the permalink.

4 Responses to Laser Modem with an Arduino Microcontroller

  1. Pingback: Connor

  2. plantpark says:

    that’s wonderful ,could you send me the source code ? Thanks

  3. Vamsi says:

    Yeah Please post the code,at least some encoding /decoding should do.

  4. Me-me says:

    What was the transfer rate ?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>