The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Make a basic Arduino Morse code generator by sending text through the Serial Monitor and using an LED to flash the matching dots and dashes. The build needs an Arduino board, an LED, a 220-ohm resistor, a breadboard, jumper wires, and a USB cable. Add a piezo buzzer for sound after the LED version works.
How the generator works
The sketch reads characters, finds each letter or number in a Morse lookup table, then switches the output on and off according to that character’s dot-and-dash sequence. A dot lasts one timing unit; a dash lasts three. The output pauses briefly between symbols, longer between characters, and longest between words.
Arduino’s Morse Code Project demonstrates the one-LED approach. Its wiring guidance emphasizes that the output pin in the sketch must match the pin connected to the LED.
Parts and wiring
- Arduino-compatible board and USB cable
- One LED
- 220-ohm resistor
- Breadboard and jumper wires
- Optional piezo buzzer for audio output
- Connect the LED’s longer anode leg to a digital output pin, such as pin 13.
- Connect the shorter cathode leg through the 220-ohm resistor to GND.
- If adding a buzzer, connect it to a digital pin supported by the sketch; the example below uses pin 9.
- Check that the pin numbers in the sketch match your actual wiring before uploading.
Upload a text-to-Morse sketch
Install Arduino IDE, connect the board, and select the matching board and serial port. The following implementation pattern uses arrays for A–Z and 0–9. Pin 13, pin 9, and the 700 Hz tone are example choices, not guarantees that every board or buzzer will behave identically.
#1 Best Overall
- [Morse code decoder soldering kit] The finished product of this soldering kit is not only a practical Morse code decoder, but also a perfect learning and practice tool. Through hands-on soldering and assembly, you can gain a deeper understanding of the basic principles of Morse code and apply them to real-world decoding tasks.
- [Multi-functional LCD display] The soldering kit is equipped with a brightness-adjustable LCD display, capable of displaying up to 16 characters simultaneously, to meet your needs in the process of learning Morse code. Get clear, intuitive feedback for both practice and real-world applications.
- [Practical teaching and course production] This soldering kit is not only suitable for personal practice for electronic DIY enthusiasts, but also perfect for practical teaching and course making, it is a great tool for learning and teaching soldering skills.
- [detailed installation instructions] We understand the challenges of DIY projects, so we provide you with detailed installation instructions. Whether it's clearly labelled on the PCB or detailed instructions in paper and electronic format, it will help you to ensure the successful completion of your project.
- [Perfect after-sales service] We are committed to providing comprehensive after-sales service support. If the project encounters any problems or you have any questions, just contact us and we will provide you with professional guidance and assistance. Our goal is to make sure you are 100% satisfied and experience the joy of soldering successfully.
const int ledPin = 13;
const int buzzerPin = 9;
const int dotDelay = 200;
const char* letters[] = {
".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..",
".---", "-.-", ".-..", "--", "-.", "---", ".--.", "--.-", ".-.",
"...", "-", "..-", "...-", ".--", "-..-", "-.--", "--.."
};
const char* numbers[] = {
"-----", ".----", "..---", "...--", "....-",
".....", "-....", "--...", "---..", "----."
};
void flashSymbol(char symbol) {
digitalWrite(ledPin, HIGH);
if (buzzerPin >= 0) tone(buzzerPin, 700);
delay(symbol == '.' ? dotDelay : 3 * dotDelay);
digitalWrite(ledPin, LOW);
if (buzzerPin >= 0) noTone(buzzerPin);
delay(dotDelay);
}
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(buzzerPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
if (!Serial.available()) return;
char ch = Serial.read();
if (ch >= 'a' && ch <= 'z') ch -= 'a' - 'A';
if (ch == ' ') {
delay(4 * dotDelay);
return;
}
const char* code = nullptr;
if (ch >= 'A' && ch <= 'Z') code = letters[ch - 'A'];
else if (ch >= '0' && ch <= '9') code = numbers[ch - '0'];
else return; // Ignore unsupported characters
for (const char* p = code; *p; ++p) flashSymbol(*p);
delay(2 * dotDelay); // Character gap, including the final symbol gap
}
Set the Serial Monitor to 9600 baud to match Serial.begin(9600). The dotDelay value controls the speed: reducing it makes the sequence faster; increasing it makes the flashes easier to follow. This sketch ignores punctuation that is not explicitly mapped.
Test and troubleshoot the output
- Upload a basic blink sketch first to confirm the board and LED circuit work.
- Upload the Morse sketch and enter
Sin the Serial Monitor. The LED should flash three short times for.... - Enter
O; the LED should produce three long flashes for---. - Try a word with a space to check that the sketch pauses between words.
- If the LED stays dark, check its polarity, the ground connection, and that the wired pin matches
ledPin. - If the sequence is too fast or slow, adjust
dotDelay. Add and troubleshoot the buzzer only after the LED output is reliable.
Ways to expand the project
Add a buzzer
A piezo buzzer can play a tone during each LED flash; Arduino’s Morse Code Project and a SunFounder R4 UNO lesson describe buzzer-based output. The sketch’s tone frequency is an example setting, so adjust it to suit the buzzer and board.
Rank #2
- Morse code experiment kit for use in teaching principles of the telegraph
- Includes D-cell battery holder, telegraph key, lamp with holder, and three connector cords
- Package Dimensions: 6.858 L x 14.224H x13.97W x(centimeters)
- Country Of Origin: United States
Use a button as a Morse key
A button-based trainer reverses the input direction: measure how long the button is held, treat a short press as a dot and a long press as a dash, then display or report the interpreted symbol. SunFounder’s R4 UNO lesson uses a button, LED, and buzzer and reports the interpreted dot or dash in Serial Monitor.
Add an LCD or keyboard
For a standalone text-to-Morse unit, a keyboard can supply text and an LCD can show characters while the LED or buzzer outputs Morse. Arduino Project Hub examples include a Nano with a 128x64 LCD and PS/2 keyboard, and an Uno Rev3 build with a 16x2 LCD that encodes serial messages while displaying characters. A simpler LCD-and-button build is also described in the Arduino forum. These additions increase wiring complexity and may require extra libraries.
Recommended Free Tools
Quick Recap
Best Value
- Compatible Brand:Universal
- Custom Bundle:Regular
- Compatible Model:Universal
Rank #4
- Sufficient quantity: you will receive 800 pieces round spacer beads in black and silver colors (400 beads per color, with diameter approx. 0.12 inch/ 3 mm), 400 pieces long tube spacer beads in black and silver colors (200 beads per color, in the size of approx. 0.12 x 0.28 inch/ 3 x 7 mm), together with 20 pieces Morse code decoding cards and 20 yards waxed cord in 4 colors, sufficient quantity and different types to meet your diverse jewelry and craft needs
- Mysterious Morse Code: the Morse code decoding card represents different English letters, each character is showed by a sequence, long tube beads represent horizontal lines and round beads represent the points, helpful for you to DIY delicate bracelets and necklaces, jewelry making for women, for your loved people, to express your love in an interesting and mysterious way
- Charming gifts: write down the meaningful words on the back of the Morse code jewelry making card, connect corresponding beads according to the Morse code indication, send the jewelries with hidden meaning to your lover, families and good friends, to show your sincere love, also let them enjoy the fun of finding out the code meaning
- Extensive usage: you can use the pretty black and silver spacer beads to make necklaces, bracelets, anklets and other jewelries, on the theme of friendship, couple, sisterhood, lover and family, they can also be applied to make stylish decors on your hats, T-shirts, bags, dresses and more, adding more beauty on you
- Smooth and durable materials: these round spacer beads and tube cuboid spacer beads are made of quality CCB material, with smooth and lustrous surface, compact in size and light in weight, comfortable and beautiful to wear, they are also sturdy and durable, not easy to break or fade; The Morse code cards are made of paper with appropriate thickness, the cord is made of polyester and wax, reliable quality for long-term use
Rank #3
- Kit Contents: Includes all necessary components for assembly, offering hands-on experience with electronic components and soldering
- Learning Tool: Practice Morse code communication while developing essential soldering skills through practical assembly
- Project Components: Features a custom PCB board, electronic parts, and protective enclosure for a complete build experience
- Skill Development: Build confidence in component identification, circuit assembly, and basic electronics principles
- Educational Value: Learn about electronic communication methods while gaining practical experience in circuit construction
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

