Intro: Blinking Morse Code
This is a project that was created during an Instructables Build Night with RaspberryPi and Adafruit.
This project uses Python, RaspberryPi, an LED, and the Adafruit Pi Cobbler Kit.
The Morse code used attempts to blink "HELLO WORLD" from a connected LED. This uses timing that is a variation of Farnsworth Morse code. Normally, Farnsworth Morse code would have the same speed and duration of standard Morse code but the spacing between dots and dashes, characters, and words would be extended. In this variation, everything is extended and uses 1 second increments all around.
Dots last for one second, dashes last for three seconds, spaces between dots and dashes take one second, spaces between characters take three seconds, and spaces between words take seven seconds.
This is not a very effective tool for learning Morse code, but it is a fun project to get into.
If you would like to create your own blinking Morse code message, feel free to mimic what we did in hello.py using standard Morse code.
Created at a Build Night at Knox Makers.
Step 1: What You Will Need
Step 2: Solder Your Adafruit Pi Cobbler Kit
You will need to solder your breakout kit if you purchased an unassembled version.
You can see the tutorials on Adafruit's Learning System here:
This is a pretty cut and dry soldering project and although it can be time consuming for a new learner just learning to solder, it is basic and great practice.
Step 3: Prepare Your Pi
We recommend starting off with a New Out Of the Box Software (NOOBS) install and using Raspbian.
You can purchase MicroSD and MicroSD to SD converter cartridges with NOOBS already installed, or you can check out this resource to do it yourself:
Step 4: Download Blinking Morse
Earlier in this project we included hello.py.
This is what we will be using to control an LED wired to ground and what is labelled as pin #17 on the T Cobbler Breakout Kit from Adafruit.
Get hello.py onto your RaspberryPi, maybe into your home directory or a directory of your choosing.
We recommend first running the following terminal command once you are in the same directory as hello.py on your RaspberryPi:
sudo nano hello.py
This should let you view and edit the blinking Morse generator.
- If you are unfamiliar with Python, this might be a neat project to dig around in and look at how everything is working.
- If you are unfamiliar with Morse code, this might be a neat project to practice Python while editing in your own unique blinking Morse code message.
When you are doing looking around or editing, close out and save the changes.
Step 5: Connect LED to GND and #17
- Hook up your Adafruit T Cobbler Breakout Kit to your RaspberryPi.
- Now, hook up an LED to the pin labeled #17 and the GND pin closest to it.
Step 6: Run Blinking Morse
Whenever you are ready, enter the following command in a terminal:
sudo python hello.py
Step 7: Enjoy!
If everything went well, your LED will start blinking "HELLO WORLD" in very slow Morse code.
Fair warning, our script contains code that asks the RaspberryPi to run through the message fifty times before stopping.
If you need to cancel out of the script, just hit CTRL and C.
If you made this project, be sure to use the "I Made It!" feature here on Instructables!