Skip to content
← Back to Electronics
⚡ electronics July 25, 2026 by Nitvi 📖 2 min read

Arduino Morse Code LED — Blink SOS!

Use the built-in LED on your Arduino UNO R4 WiFi to send Morse code. No extra components needed!

Arduino Morse Code LED — Blink SOS!

After making my LED breathe, I wanted to try something different.

This time I made my Arduino UNO R4 WiFi blink SOS in Morse code using the same built-in LED on pin 13. 🆘

What does it do?

The built-in LED flashes:

  • S = three short blinks (...)
  • O = three long blinks (---)
  • S = three short blinks (...)

Then it pauses and repeats.

What you need

  • Arduino UNO R4 WiFi
  • USB cable

That’s it — still no breadboard, no wires, no resistor! 🎉

The code

/*
  Morse Code LED Flasher
  Uses the built-in LED on Arduino UNO R4 WiFi (pin 13).
  Flashes "SOS" in a loop: ... --- ...
*/

const int LED_PIN = 13;     // Built-in LED on Arduino UNO R4 WiFi
const int DOT_MS = 200;     // Short blink
const int DASH_MS = 600;    // Long blink (3 x dot)
const int GAP_MS = 200;     // Gap between parts of same letter
const int LETTER_GAP = 600; // Gap between letters (3 x dot)
const int WORD_GAP = 1400;  // Gap before repeating (7 x dot)

void setup() {
  pinMode(LED_PIN, OUTPUT);
  Serial.begin(9600);
  Serial.println("Morse Code LED Flasher started!");
  Serial.println("Flashing: SOS");
}

void loop() {
  flashSOS();
  delay(WORD_GAP);
}

// --- Morse helpers ---

void dot() {
  digitalWrite(LED_PIN, HIGH);
  delay(DOT_MS);
  digitalWrite(LED_PIN, LOW);
  delay(GAP_MS);
}

void dash() {
  digitalWrite(LED_PIN, HIGH);
  delay(DASH_MS);
  digitalWrite(LED_PIN, LOW);
  delay(GAP_MS);
}

void flashSOS() {
  // S = ...
  dot(); dot(); dot();
  delay(LETTER_GAP);

  // O = ---
  dash(); dash(); dash();
  delay(LETTER_GAP);

  // S = ...
  dot(); dot(); dot();
}

How I uploaded it

Same as before, with the Arduino CLI:

arduino-cli board list
arduino-cli compile --fqbn arduino:renesas_uno:unor4wifi MorseCodeLED
arduino-cli upload -p /dev/cu.usbmodem9888E00970202 --fqbn arduino:renesas_uno:unor4wifi MorseCodeLED

On Windows, use a port like COM3 instead.

How it works

SymbolLED actionTime
Dot .Quick ON200 ms
Dash -Long ON600 ms
Gap inside letterLED OFF200 ms
Gap between lettersLED OFF600 ms
Gap before repeatingLED OFF1400 ms

Try changing it!

  • Make the dot time faster or slower
  • Change the message from SOS to HI or your name
  • Add a second helper function for other letters

What’s next?

Next I want to add a push button so I can start and stop the SOS pattern myself. Then maybe a buzzer so it beeps instead of blinks!

See my earlier post: My First Arduino Project — Breathing LED!

Share this post: 𝕏 Share f Share