Lesson 7 Laser Transmitter

Share for us

Introduction

Laser is widely used in medical treatment, military, and other fields due to its good directivity and energy concentration. The Laser Transmitter module (as shown below), as the name suggests, is a one that can emit laser.

Components

– 1 * SunFounder Uno board

– 1 * USB data cable

– 1 * Laser transmitter module

– Several jumper wires

Experimental Principle

A laser is a device that emits light through a process of optical amplification based on the stimulated emission of electromagnetic radiation. Lasers differ from other sources of light because they emit light coherently.

Spatial coherence allows a laser to be focused to a tight spot, enabling applications like laser cutting and lithography, and a laser beam to stay narrow over long distances (collimation), enabling applications such as laser pointer. Lasers can also have high temporal coherence which allows them to have a very narrow spectrum, i.e., they only emit a single color of light. And its temporal coherence can be used to produce pulses of light—as short as a femtosecond.

Experimental Procedures

Step 1: Build the circuit

           Laser Transmitter Module          SunFounder Uno

                          S —————————————-Digital 9

                          –   ————————————– GND

                           + ————————————— 5V

Step 2: Program (Please refer to the example code in LEARN -> Get Tutorial on our website)

Step 3: Compile

Step 4: Upload the sketch to SunFounder Uno

Now, you can see the laser transmitter module send out Morse signals.

Note: DO NOT look directly at the laser head. It can cause great harm to your eyes.

C Code

#include “retrieval.h”const int laserPin = 9; //laser attach tostatic int dotDelay = 200; //void setup()
{
pinMode(laserPin, OUTPUT); //initialize laser as an output
Serial.begin(9600);
}void loop()
{
char ch = 0; //store the character or digit read from the serial monitor
if(Serial.available() > 0) //is there anything to be read
{
ch = Serial.read(); //read a single letter from serial monitor
}
morseSignal(ch); //flashes depend on the letter
}
//
void flashDot(char cha)
{
digitalWrite(laserPin, HIGH); //turn the laser on
if(cha == ‘.’) //
{
delay(dotDelay);
}
else
{
delay(dotDelay * 3); //gap between letters
}
digitalWrite(laserPin, LOW);
delay(dotDelay); //gap between flashes
}
//
void flashSequence(char *sequence)
{
int i = 0;
while(sequence[i] != NULL)
{
flashDot(sequence[i]);
i++;
}
delay(dotDelay * 3);
}
//
void morseSignal(char ch)
{
if(ch >= ‘a’ && ch <= ‘z’)
{
flashSequence(letters[ch – ‘a’]);
}
else if(ch >= ‘A’ && ch <= ‘Z’)
{
flashSequence(letters[ch – ‘A’]);
}
else if(ch >= ‘0’ && ch <= ‘9’)
{
flashSequence(numbers[ch – ‘0’]);
}
else if(ch == ‘ ‘)
{
delay(dotDelay * 4); //gap between words
}
}