Blinking Morse Code
by smalltortoise in Circuits > Raspberry Pi
14069 Views, 4 Favorites, 0 Comments
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.
Downloads
What You Will Need
You will need:
- RaspberryPi
- USB keyboard
- Power supply
- MicroSD card
- Monitor
- Common LED
- Breadboard
- Adafruit Pi T Cobbler Breakout Kit
- Soldering iron
- Soldering station
- Solder
Downloads
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:
https://learn.adafruit.com/adafruit-pi-cobbler-kit...
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.
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:
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.
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.
Run Blinking Morse
Whenever you are ready, enter the following command in a terminal:
sudo python hello.py
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!