Arduino Morse Code Flaher by Bot1398
Featured
I am a big fan of programming but I like to keep it down to 555 timer but when it comes to complex functions like flashing a LED in a certain pattern programming is necessary.One day while surfing through the I came across something known as Morse code.I decided to read it and found it totally awesome.I tried to make it with an arduino and I was successful in doing so. And now here that project explaining what I did.This is a low cost fun to do project suitable for beginners ;it also requires minimal parts.

This instructable will explain how to create the circuit ,making a shield for the arduino,making some changes,displaying custom messages and how to install the Morse code library.

This instructable is a entry in the arduino contest so if you like it please vote.

Here is a short video of it in action:

 

 
The first message that it displays is the SOS the second that it displays is HI and the third message that it displays is HELLOW.You can see the LED blink for three or four times in between the message this means that a new code has been uploaded and a new message is been displayed.
 
Remove these adsRemove these ads by Signing Up

Step 1: Morse Code

International_Morse_Code_150.png
Morse code is a method of transmitting textual information as a series of on-off tones, lights, or clicks that can be directly understood by a skilled listener or observer without special equipment. The International Morse Code encodes the ISO basic Latin alphabet, some extra Latin letters, the Arabic numerals and a small set of punctuation and procedural signals as standardized sequences of short and long signals called "dots" and "dashes" respectively, or "dis" and "dahs". Because many non-English natural languages use more than the 26 Roman letters, extensions to the Morse alphabet exist for those languages.
Each character (letter or numeral) is represented by a unique sequence of dots and dashes. The duration of a dash is three times the duration of a dot. Each dot or dash is followed by a short silence, equal to the dot duration. The letters of a word are separated by a space equal to three dots (one dash), and two words are separated by a space equal to seven dots. The dot duration is the basic unit of time measurement in code transmission.In the picture you can see the Morse code for each alphabet and number.
waterlubber says: Feb 22, 2012. 8:53 AM
Cool. Never knew you could make custom libraries! I made a "hello" message manually:
/*This program has a buzzer hooked up to Pin 11.
(My buzzer fit right between GRD and 11, so I used that.)*/





int buzzerPin=11;

void setup()
{
  pinMode(buzzerPin, OUTPUT);
}


void loop()
{
  digitalWrite(buzzerPin, HIGH);
  delay(200); 
  digitalWrite(buzzerPin, LOW);
  delay(200);
  digitalWrite(buzzerPin, HIGH);
  delay(200);
  digitalWrite(buzzerPin, LOW);
  delay(200);
  digitalWrite(buzzerPin, HIGH);
  delay(200);
  digitalWrite(buzzerPin, LOW);
  delay(200);
  digitalWrite(buzzerPin, HIGH);
  delay(200);
  digitalWrite(buzzerPin, LOW);
  delay(1000);                 //....(H)
  digitalWrite(buzzerPin, HIGH);
  delay(200);
  digitalWrite(buzzerPin, LOW);
  delay(1000);               //.(E)
  digitalWrite(buzzerPin, HIGH);
  delay(200);
  digitalWrite(buzzerPin, LOW);
  delay(200);
  digitalWrite(buzzerPin, HIGH);
  delay(500);
  digitalWrite(buzzerPin, LOW);
  delay(200);
  digitalWrite(buzzerPin, HIGH);
  delay(200);
  digitalWrite(buzzerPin, LOW);
  delay(200);
  digitalWrite(buzzerPin, HIGH);
  delay(200);
  digitalWrite(buzzerPin, LOW);
  delay(1000);                  //.-..(L)
  digitalWrite(buzzerPin, HIGH);
  delay(200);
  digitalWrite(buzzerPin, LOW);
  delay(200);
  digitalWrite(buzzerPin, HIGH);
  delay(500);
  digitalWrite(buzzerPin, LOW);
  delay(200);
  digitalWrite(buzzerPin, HIGH);
  delay(200);
  digitalWrite(buzzerPin, LOW);
  delay(200);
  digitalWrite(buzzerPin, HIGH);
  delay(200);
  digitalWrite(buzzerPin, LOW);
  delay(1000);                 //.-..(L)
  digitalWrite(buzzerPin, HIGH);
  delay(500);
  digitalWrite(buzzerPin, LOW);
  delay(200);
  digitalWrite(buzzerPin, HIGH);
  delay(500);
  digitalWrite(buzzerPin, LOW);
  delay(200);
  digitalWrite(buzzerPin, HIGH);
  delay(500);
  digitalWrite(buzzerPin, LOW);
  delay(5000);               //---(H)
}


To do:
Right-Click,
Copy as HTML
IN THE EMBED VIDEO DIALOG:
Paste
Higgs Boson says: Mar 4, 2012. 8:03 AM
Typing the code up like that seems like a lot of work. I made a morse code translator where you type out the message on the serial monitor send it to the arduino where it translates the message to morse code and an led flashes the message.
mkunst says: Oct 7, 2012. 12:04 PM
see here code.

https://docs.google.com/document/d/1ieZq9nmCgYaISdEErRhkbx4r5UvNKsEg7bXtgpPOLnI/edit
Gelfling6 says: Feb 28, 2012. 7:16 AM
Nice job! Now, if someone could create a tone detector with an arduino, A program I adapted from an old MBASIC program, would go the other direction! (convert Morse code received off a radio, to ASCII text.)
RayBurne says: Aug 5, 2012. 3:33 PM
I gave it in BASIC for PICAXE... they are very cheap chips.

http://www.instructables.com/id/Morse-Code-Magic-An-Algorithm/

I've been to busy to convert to an Arduino lib, but should be straightforward.

BTW, there are a number of Magic Morse posts on Instructables... one even uses the algorithm in "reverse" to send the temperature as a number.

- Ray
e=mc^2 says: Mar 13, 2012. 4:15 AM
Great work I mean really great XD I am following
E_Tack says: Mar 6, 2012. 7:29 AM
Nice Project, but i have a few questions:
When I paste the SOS code from step 5 and I verify it, it says:


In file included from sketch_mar06a.cpp:1:
C:\Users\Doede\Desktop\Arduino\arduino-1.0\libraries\Morse/Morse.h:10:22: error: WProgram.h: No such file or directory

I have downloaded the .zip and placed it where I have to.
What can I do?
Bot1398 (author) says: Mar 7, 2012. 6:26 PM
You are using arduino 0.1 I also had problems with it switch back 0022 or 0023 and you will be fine
E_Tack says: Mar 9, 2012. 3:34 PM
Thanks, I downloaded both 0022 and 0023. This time, when verifying, there where no errors, but when I tried to upload it gave me this message on both versions:


Binary sketch size: 1362 bytes (of a 32256 byte maximum)
avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

(btw, this is my first arduino project, thats why I don't get it ;) )
Bot1398 (author) says: Mar 9, 2012. 5:34 PM
I suspect you havent installed the drivers so do it a step by step screenshot's can be found be here.I had the same error when I tried my first arduino program but then I realized I had to install the drivers.!
E_Tack says: Mar 10, 2012. 9:19 AM
I thougt that I allready installed the drivers, I'll do it again tonight.
gregoryfenton says: Feb 22, 2012. 9:27 AM
Great work so far, but rather than morse.dash(); morse.dash(); morse.dash(); why not have a function in the library with a list of characters and do morse.print("Save us! Save us now! OMG we are sinking!"); and let the library do the rest?
xJaymz says: Feb 21, 2012. 4:23 PM
Great Project!

oh, the song is Britney Spears - Till the World Ends
Bot1398 (author) says: Feb 21, 2012. 6:33 PM
Patched
TobaTobias says: Feb 21, 2012. 11:25 AM
Great work mate,
Check make projects, they've got something about morse code too. :)
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!