Morse Code

Morse code follows conventions on timing for the lengths of dots and dashes, spaces between elements, spaces between letters, and spaces between words.


In the original telegraph system, keyers used a single button straight key, kind of like a typewriter key, and held it for short or long durations.

CC A-SA 4.0 Morse Key image by HP. Baumeler
Did you know that electronics distributor Digi-Key was named after founder Ronald Stordahl's "Digi-Keyer Kit" he designed for sending radiotelegraph code? It's true!

An alternative to the straight key are paddles (either "bug" or "iambic" style) that can be pressed in two possible directions — a push with the index finger is a long duration 'dash', while a push with the thumb is a short 'dot'. By keeping the paddle pressed in one of the directions, it will automatically repeat with proper spacing between dots or dashes.

GNU Free Documentation License paddle photo by Henryk Kotowski

The letter 'D' for example, is made with a 'dash-dot-dot'. The dots and dashes are separated by inter-element gaps, which are equal to a dot in duration, so it really looks like 'dash-gap-dot-gap-dot'.

When using a traditional straight Morse code key, the sender would use one finger to manually hold for the correct 'dash' duration, release, pause for the correct 'gap' duration, tap a 'dot', release, pause for 'gap' duration, and tap another 'dot', and release.

A Morse code paddle automates some of this process. By tapping the paddle with the thumb from left to right, a 'dot' is sent with the correct duration no matter if the paddle is only very quickly tapped. In other words, the timing is taken care of. By pushing the paddle with the index finger from right to left, the 'dash' duration is automatically sent. And, holding the paddle continuously repeats the dot or dash (depending on thumb or index finger direction) with the proper gap.

The Arduino code will set the dot duration at 100ms, and then derive the gap space between elements -- 1x a dot - and duration of dashes  -- 3x a dot - from that.

It will be up to you to pause the appropriate time between letters (3x a dot length) and words (7x a dot length). 

Here's an example: SOS  . . .  - - -  . . .  can be sent by paddling thumb and holding for three dots, index finger for three dashes, and thumb for three dots. That's only three presses with the paddle for the complete word, versus nine presses on a traditional Morse key!

Arduino Sketch

Copy the code here, paste it into a new Arduino sketch, and then save it as AM_Radio_Morse.ino. Now, upload it to your Gemma M0 board.

// SPDX-FileCopyrightText: 2018 John Edgar Park for Adafruit Industries
// SPDX-License-Identifier: MIT

// For Adafruit_AMRadio library -- Morse code transmits on AM 540.
// Connect antenna (40" wire) to pin A0 and GND
// Morse "dot" key is a contact switch connected to D2 and GND
// "Dash" key is switch connected to D0 and GND
// Adapted from Phil Burgess's AMRadio sketch

#include <Adafruit_AMRadio.h>

Adafruit_AMRadio radio;

const int buttonDotPin = 2; //pushbutton pin for dit
const int buttonDashPin = 0; //pushbutton pin for dah
const int ledPin = 13; //to light the onboard LED

int buttonDotState = 0; //to store button state
int buttonDashState = 0;

//Morse varaiblas
const int PITCH = 680;
const int DOT = 100; //duration of short dot in millis
const int DASH = DOT * 3;
const int GAP = DOT;

void setup() {
  pinMode(ledPin, OUTPUT);
  pinMode(buttonDotPin, INPUT_PULLUP);
  pinMode(buttonDashPin, INPUT_PULLUP);

  radio.begin(540000); //start radio object, transmits at 540MHz AM

void loop() {
  buttonDotState = digitalRead(buttonDotPin);
  buttonDashState = digitalRead(buttonDashPin);
  if (buttonDotState == HIGH) {    // not pressed
    digitalWrite(ledPin, LOW);   // light is off
  else {                        // pressed
    digitalWrite(ledPin, HIGH);  // light on
    radio.tone(PITCH, DOT);
  if (buttonDashState == HIGH) {    // not pressed
    digitalWrite(ledPin, LOW);   // light is off
  else {                        // pressed
    digitalWrite(ledPin, HIGH);  // light on
    radio.tone(PITCH, DASH);

You can test this out by, again, holding the board near the AM radio tuned into 540MHz, and then use a piece of wire to bridge D0 or D2 to GND. Each time you close the contact, it will beep either a "di" or a "dah" with proper duration and spacing.

Next, we'll turn this into a proper Morse code keying paddle!

This guide was first published on Mar 08, 2018. It was last updated on May 17, 2024.

This page (What is Morse Code?) was last updated on May 17, 2024.

Text editor powered by tinymce.