Arduino 004: Morse Code Beacon

This will help you:

Create a light that delivers a message in Morse code when a button is held down

This activity is taken from a scavenger hunt I completed once at Olin. Someone had removed a light switch cover and installed an Arduino running a similar program behind it. When you used the light switch in the right way, the program would be triggered to flash out the message required for the next step.

If you feel like going further, you can instead have it flash out a message typed into the serial monitor.

Time: 1 hour / Level: B1

You should already:

You Will Need:

  • A computer

  • An Arduino

  • An A-to-B USB cable

  • A half-size breadboard

  • Pushbutton switch

  • 10k ohm potentiometer (optional for speed adjustment)

  • 2x 10k Ohm resistors

  • Piezo buzzer OR:

  • 1 LED

  • 100-220 Ohm resistor (see this guide on resistors for LEDs)

Get the code and resources for this activity by clicking below. It will allow you to download the files from a Google Drive folder. Unzip the folder and save it in a sensible location.

Step 1: Morse Switch

Assemble the circuit as pictured in morse_blinker.png or morse_buzzer.png. Open morse_switch.ino and read the code to understand what is going on. Connect your Arduino and run the script. Try changing the message, and turning the potentiometer to adjust the playback speed.

morse_blinker.png
morse_buzzer.png

Step 2: Serial-to-Morse

Open morse_serial.ino and read the code to try to understand what's going on. You can read about reading from the serial monitor here. Try typing different messages and playing them back.

Step 3: Finishing Off

Take a video of your circuit in use, showing off a quick demo of the functionality. Share it via the submission button below to get it featured on the Circuit Board!

Return any parts to the supply area, and please sort things by the correct value so the next person can find what they need. Thanks!