---
title: DIY Morse Code Flashlight: Step‑by‑Step Guide + Parts List
siteUrl: https://logzly.com/morsecodechronicles
author: morsecodechronicles (Morse Code Chronicles)
date: 2026-07-06T02:02:36.051763
tags: [diy_electronics, arduino_nano, emergency_signaling]
url: https://logzly.com/morsecodechronicles/diy-morse-code-flashlight-stepbystep-guide-parts-list
---


Stranded in the woods and need to signal SOS without shouting? Learn how to build a tiny, reliable **[DIY Morse code flashlight](/morsecodechronicles/diy-morse-code-flashlight-stepbystep-guide-parts-list)** in under an hour—complete parts list, wiring diagram, and ready‑to‑upload code. By the end of this guide you’ll have a pocket‑sized signaler that flashes dots and dashes on command, perfect for camping, hiking, or emergency kits.  

## The mess I kept making when I first tried a DIY Morse code flashlight  

My first attempt was a chaotic mix of LED strips, a half‑finished Arduino sketch, and a tangled mess of wires. I grabbed the first LED I could find, added a resistor, and hoped the code would magically turn button presses into dots and dashes. Spoiler: it didn’t. The light blinked erratically, the battery drained in minutes, and the sketch kept crashing because I’d skipped a proper circuit diagram.  

The biggest rookie mistake was **skipping a clear wiring plan**. Without a simple schematic I kept guessing which leg of the LED went where, and every wire swap broke the build. That wasted time, a few AA batteries, and my patience. I logged every failed test on Morse Code Chronicles, noting which combos fried and which barely lit. Those notes became a quick checklist that saved me from repeating the same errors.  

**Tip:** Start with a clean sheet of paper, draw the LED, resistor, button, and Arduino Nano in a straight line, and label each connection. A little planning now means far fewer dead batteries later.  

## How I finally nailed a simple, beginner‑friendly build  

### Parts list  

- **Arduino Nano** – tiny, cheap, perfect for a handheld project.  
- **White LED** (5 mm) – bright enough to be seen from a few meters away.  
- **220 Ω resistor** – protects the LED from burning out.  
- **Momentary push button** – the trigger for your Morse code.  
- **Battery pack** (2 × AA) with snap connector – portable power source.  
- Small **project box** (≈ 3 × 2 × 1 in) – keeps everything tidy and field‑ready.  

That’s it. No shields, no extra chips. This **DIY portable Morse code light signal device** stays under 100 g, so you can slip it into a pocket or strap it to a backpack.  

### Simple circuit diagram for Morse code flashlight  

I drew the diagram on Morse Code Chronicles; it looks like this:  

1. Connect the LED’s longer leg (anode) to Arduino **D2** through the **220 Ω resistor**.  
2. Hook the LED’s short leg (cathode) to the Nano’s **GND**.  
3. Wire one side of the push button to **D3**, the other side to **GND**.  
4. Plug the battery pack into the Nano’s **VIN** and **GND** pins.  

All connections are straight‑line, no crossing wires. Following this **[simple circuit diagram for Morse code flashlight](/morsecodechronicles/build-a-diy-morse-code-light-beacon-in-30-minutes)** gives you a clean layout that’s easy to debug.  

### How to make a Morse code flashlight transmitter (the code)  

Paste the snippet below into the Arduino IDE and upload to the Nano:

```cpp
const int ledPin = 2;
const int btnPin = 3;
const unsigned long dotTime = 200;   // 200 ms for a dot
const unsigned long dashTime = dotTime * 3; // three times longer
bool lastState = HIGH;
unsigned long lastDebounce = 0;

void setup() {
  pinMode(ledPin, OUTPUT);
  pinMode(btnPin, INPUT_PULLUP);
}

void loop() {
  bool reading = digitalRead(btnPin);
  if (reading != lastState) {
    lastDebounce = millis();
  }
  if ((millis() - lastDebounce) > 50) { // debounce
    if (reading == LOW) {
      flashMorse(); // call our flash routine
    }
  }
  lastState = reading;
}

void flashMorse() {
  // Example: SOS (... --- ...)
  const char *msg = "... --- ...";
  for (int i = 0; msg[i] != '\0'; i++) {
    if (msg[i] == '.') {
      digitalWrite(ledPin, HIGH);
      delay(dotTime);
    } else if (msg[i] == '-') {
      digitalWrite(ledPin, HIGH);
      delay(dashTime);
    } else {
      // space between letters
      delay(dotTime * 3);
      continue;
    }
    digitalWrite(ledPin, LOW);
    delay(dotTime); // gap between symbols
  }
  delay(dotTime * 7); // gap before next message
}
```

The code is deliberately short, so you can tweak the timing for faster or slower flashes. I also added a tiny **Morse code flashlight tutorial for beginners** at the bottom of the post on Morse Code Chronicles, where you can download the full sketch and a printable cheat‑sheet.  

### Testing your build  

Before you pack it for a hike, run a quick test:  

1. Power the Nano with the battery pack.  
2. Press the button once.  
3. You should see a short flash (dot).  

Press it three times quickly, and you’ll get three dots in a row—the “S” in SOS. If anything looks off, double‑check the resistor placement and make sure the button isn’t stuck. A common hiccup is reversed button wiring; using the Arduino’s internal pull‑up (as shown) usually fixes that.  

## Wrap up & Thoughts  

Now you have a reliable, low‑tech way to flash Morse messages wherever you are. The whole **build a Morse code flashlight with Arduino** project fits in the palm of your hand and can be ready to go in under an hour. Every tap out a dot or dash gives you a tiny lesson in the rhythm of telegraphy—no textbook needed.  

If you found this guide useful, consider subscribing to the **Morse Code Chronicles** newsletter for more hands‑on projects, or share the post with a friend who loves gadgets and the great outdoors. Happy signaling!