Morse Code With Arduino+LED





Introduction: Morse Code With Arduino+LED


I don't know the real reason, but I have that crush on the old technology and its stuff , one of the most thing I ever loved is morse code and how they communicate, so in my first days with arduino -three years ago I think !- one of my first projects was morse code with it, then I decided to try another method to use this codes, so I came with the LED idea in that night and did it.

Now in my very first instructable I'll write about this old MEMORY :)

Step 1: What Will Need!

Nothing just any Arduino board and LED

and some knowledge about the morse code

you need to install arduino IDE and the drivers to communicate with the board

you can download it from this link >>>>>

that's it lets start fun :)


the morse code reference>>>>

Step 2: Programming....

before I start you need to that the programming is a fun thing just you need to get the right mode :)

now go and take a TRIPLE ESPRESSO

cause the code is easy but tricky (very!) -if you prefer to test the code or too lazy to write it my code files is attached just compile and upload it!-

all done lets start :

- first we need to but the LED in it's right place so but the taller part in the 13 pin and the shorter in GND pin like th pics.

- now all is ready connect the arduino to the computer and lunch the arduino IDE -don't forget to select the port-

- it's programming time :D,,,,,

to start programming u need first to download the reference to know the codes, this is some explanation and how we will do it with arduino :

-now u need to understand some points

-the dot and the dash, the dot is the short sound in morse code and the dash is the long one I made the time for the dot is 300 millisecond and 900 for the dash cause the dash is triple dot.

-u will find the time and the length of the morse code in the reference pic, maybe u will find the time I but different in some situation if u did please post and I'll explain.

-the code...............

//morse_code by LED
/* This code was written by Ebrahim Bawazir in 2013 and updated in 2015 U R FREE TO USE IT AND MODIFY IT AS U WANT ***************** */ int led =13;//the led pin char input;// to save the input void setup () { pinMode (led,OUTPUT);//tell that the 13 pin is an output Serial.begin(9600);//for the connect with the boared }

void loop () { if (Serial.available()) { input =;//read the input if (input == 'a' || input == 'A') {lA();}//if the input is a or A go to function lA if (input == 'b' || input == 'B') {lB();}//same but with b letter if (input == 'c' || input == 'C') {lC();} if (input == 'd' || input == 'D') {lD();} if (input == 'e' || input == 'E') {lE();} if (input == 'f' || input == 'F') {lF();} if (input == 'g' || input == 'G') {lG();} if (input == 'h' || input == 'H') {lH();} if (input == 'i' || input == 'I') {lI();} if (input == 'j' || input == 'J') {lJ();} if (input == 'k' || input == 'K') {lK();} if (input == 'l' || input == 'L') {lL();} if (input == 'm' || input == 'M') {lM();} if (input == 'n' || input == 'N') {lN();} if (input == 'o' || input == 'O') {lO();} if (input == 'p' || input == 'P') {lP();} if (input == 'q' || input == 'Q') {lQ();} if (input == 'r' || input == 'R') {lR();} if (input == 's' || input == 'S') {lS();} if (input == 't' || input == 'T') {lT();} if (input == 'u' || input == 'U') {lU();} if (input == 'v' || input == 'V') {lV();} if (input == 'w' || input == 'W') {lW();} if (input == 'x' || input == 'X') {lX();} if (input == 'y' || input == 'Y') {lY();} if (input == 'z' || input == 'Z') {lZ();} if (input == '1') {n1();}// the numbers if (input == '2') {n2();} if (input == '3') {n3();} if (input == '4') {n4();} if (input == '5') {n5();} if (input == '6') {n6();} if (input == '7') {n7();} if (input == '8') {n8();} if (input == '9') {n9();} if (input == '0') {n0();} if (input == ' ') {space();}//the space Serial.println (input);//print the latter saved in the input var } } //fonctions for the letters and the numbers void lA () {dot();dash();shortspace();}//letter A in morse code! void lB () {dash();dot();dot();dot();shortspace();}//same for B void lC () {dash();dot();dash();dot();shortspace();} void lD () {dash();dot();dot();shortspace();} void lE () {dot();shortspace();} void lF () {dot();dot();dash();dot();shortspace();} void lG () {dash();dash();dot();shortspace();} void lH () {dot();dot();dot();dot();shortspace();} void lI () {dot();dot();shortspace();} void lJ () {dot();dash();dash();dash();shortspace();} void lK () {dash();dot();dash();shortspace();} void lL () {dot();dash();dot();dot();shortspace();} void lM () {dash();dash();shortspace();} void lN () {dash();dot();shortspace();} void lO () {dash();dash();dash();shortspace();} void lP () {dot();dash();dash();dot();shortspace();} void lQ () {dash();dash();dot();dash();shortspace();} void lR () {dot();dash();dot();shortspace();} void lS () {dot();dot();dot();shortspace();} void lT () {dash();shortspace();} void lU () {dot();dot();dash();shortspace();} void lV () {dot();dot();dot();dash();shortspace();} void lW () {dot();dash();dash();shortspace();} void lX () {dash();dot();dot();dash();shortspace();} void lY () {dash();dot();dash();dash();shortspace();} void lZ () {dash();dash();dot();dot();shortspace();} void n1 () {dot();dash();dash();dash();dash();shortspace();}//number 1 in morse code void n2 () {dot();dot();dash();dash();dash();shortspace();} void n3 () {dot();dot();dot();dash();dash();shortspace();} void n4 () {dot();dot();dot();dot();dash();shortspace();} void n5 () {dot();dot();dot();dot();dot();shortspace();} void n6 () {dash();dot();dot();dot();dot();shortspace();} void n7 () {dash();dash();dot();dot();dot();shortspace();} void n8 () {dash();dash();dash();dot();dot();shortspace();} void n9 () {dash();dash();dash();dash();dot();shortspace();} void n0 () {dash();dash();dash();dash();dash();shortspace();} void space () {delay (1200);}//space between words void dot () {digitalWrite(led,HIGH); delay (300); digitalWrite(led,LOW); delay (300);}//the dot this code make the led on for 300 than off for 300 void dash () {digitalWrite(led,HIGH); delay (900); digitalWrite(led,LOW); delay (300);}//the dash this code make the led on for 900 than off for 300 void shortspace () {delay(600);}//space between letters /*done*/

any Q ask and I'll respond.

Step 3: Test the Code and Have FUN

if U read this than congrats U've done it

now have fun>>>>>>> xD

I hope u enjoyed with my memories and loved the project

ANY Q ARE WELCOME.............




  • Science of Cooking

    Science of Cooking
  • Trash to Treasure

    Trash to Treasure
  • Paper Contest 2018

    Paper Contest 2018

We have a be nice policy.
Please be positive and constructive.




can u share code with me please @ please

This is great! Thanks for sharing and welcome to the community!