WHAT WILL YOU MAKE?
WHAT WILL YOU NEED?
- Raspberry Pi Zero W
- Arcade button switch
- Piezo buzzer
- Soldering iron and solder
- Heat-shrink tubing
- JST connector leads, 12" female 2-pin (2)
- MicroSD card reader
- Hot glue
Load the Pi
The simplest way to get the telegraph code set up on your Pi is to use the pre-packed disk image. Download and unzip the disk image. The disk image includes the Raspbian operating system, so it will take a few minutes to download. (For advanced options, or to install the telegraph client manually, check the instructions in the GitHub repository).
If you don’t already have a tool for burning disk images, Etcher is a good option. Insert a blank microSD card into your card reader. Launch Etcher, click “Select Image,” and select the Internet Telegraph disk image (internet-telegraph.img). Click “Select Drive” and select your microSD card (be careful with this one — you don’t want to write the image to your hard drive!). Click “Flash” and wait for Etcher to do its work. Eject the SD card and pull it out of your card reader, then put it back in. It should mount as a disk that’s accessible through your file manager.
Configure Your Telegraph
Set the wireless network info
The telegraph can be run over Ethernet (using a micro USB to Ethernet adapter such as Adafruit #2992), or connected to a wireless network. To connect it to a wireless network, open /etc/wpa_supplicant/wpa_supplicant.conf from the SD card, and update the network info at the bottom of the file with your network’s SSID and Wi-Fi password.
Set telegraph channel and server
Open config.json in the root directory of your SD card. There are two configuration options you can set: The “channel” determines who else you’ll be communicating with. To send private Morse messages with your friends or relations, set this to an obscure series of words or string of characters that only you and your buddies know. The default channel is the “lobby.” Anyone with a telegraph who doesn’t change their channel will be in the lobby.
By default, telegraph messages go through our server at morse.autodidacts.io. You can also grab the server code from GitHub and set up your own server either on the web or on your local network. If you’re running your own server, change the “server” value from morse.autodidacts.io to the URL or IP address of your server.
Once you’ve saved the updated config, eject your SD card and pop it into the Pi Zero.
Wire It Up!
The first step for connecting things to your Pi Zero is to solder on the GPIO pin header. Put the header in from the top, then flip the Pi over and solder a pin in at each end to hold the header in place. Solder the rest of the pins, taking care to avoid bridging the gaps between pins with any errant solder blobs. Check out Adafruit for a more detailed tutorial.
Slip a couple of sections of heat-shrink tubing over the leads of one of the JST connectors, and then solder the leads onto the terminals of the arcade button. It doesn’t matter which wire goes to which terminal on the button. When you’re done, slide the heat-shrink tubing over the joint and shrink it on with your soldering iron.
Solder the other JST lead onto the buzzer. This one is polarity-specific: Make sure you connect the black or dashed negative wire onto the longer pin.
Assemble the Telegraph
Get Outside the Box: We’ve used an iPhone box for the enclosure. This is a convenient approach, but it’s only one of many options for housing your telegraph. You could use clear acrylic, 3D print your enclosure, or even install the telegraph in a cottage cheese tub, like many of our early electronics experiments. Let your creativity, available materials, and aesthetic preferences lead the way.
Plug the buzzer lead into GPIO pin 19 and ground, making sure the negative side is toward the edge of the Pi, and glue the buzzer down with a dot of hot glue to prevent it from knocking around in the box like a poltergeist.
Cut a hole in the lid of the box, thread the arcade button’s wire through the hole, and screw on the fastener from below. Plug the button’s lead into GPIO pins 26 and ground. This one can be oriented either way.
Plug in the USB power and wait about 30 seconds for the Pi to boot up. When the Pi is booted up and connected to the Morse server, it will beep out “ready” in Morse code ( .-. . .- -.. -.–).
To test your connection, push the button on your telegraph. If you hear a beep, your telegraph is talking to the server. All systems go!
May the Morse be With You!
The standard Morse alphabet includes letters, numbers, and a variety of punctuation symbols. For a more complete set, as well as some tips on learning Morse, print out a copy of InternetTelegraph/Docs/translate-morse.pdf from the GitHub repo. You’ll want to have a notebook handy for transcribing incoming messages.
Morse is made up of dots, dashes, and spaces (gaps). Each of these has a specific length in relation to the other symbols. Keeping these lengths in mind will help you send well-formed messages that are easy to decode, at whatever speed you’re punching them out. A dash is three times as long as a dot. Gaps between symbols within a letter are as long as one dot. Gaps between letters are three dots long, and gaps between words are seven times as long as a dot.
Once you (and any other telegraph operators on your channel) are ready to go, it’s time to send a message!
We suggest something short and sweet, like “hi.” In Morse, that’s four dots, a space, and then two dots: dit-dit-dit-dit dit-dit. (As it happens, “hi” was also the output sample that came just before the first ever use of “hello world” in a 1972 programming tutorial by Brian Kernighan. We’re sticking with historical precedent here.)
Try going very slowly at first, and sending simple messages. You might want to jot down the Morse as it comes in, and then decode it after the transmission. The same works for sending: write out the Morse first, and then key it into the telegraph.
After you’ve built your IoT telegraph, you’ll be ready to send top-secret messages via Morse code. Try decoding and sending this one!
.– .. – …. / –. .-. . .- – / .–. — .– . .-. / -.-. — — . … / –. .-. . .- – / .-. . … .–. — -. … .. -… .. .-.. .. – -.– / – / – — / -.- . . .–. / — .- -.- .. -. –. -.-.–
Your safety is your own responsibility, including proper use of equipment and safety gear, and determining whether you have adequate skill and experience. Power tools, electricity, and other resources used for these projects are dangerous, unless used properly and with adequate precautions, including safety gear and adult supervision. Some illustrative photos do not depict safety precautions or equipment, in order to show the project steps more clearly. Use of the instructions and suggestions found in Maker Camp is at your own risk. Make Community, LLC, disclaims all responsibility for any resulting damage, injury, or expense.
Kits and Books From Maker Shed
Make: produces a variety of great products and helpful project tutorials to enhance your making experience.