Morse Code Keyer2017-07-11
I created a device to assist in morse code transmission, commonly called a keyer. It has nearly all the features you'd expect from a keyer, and can be built for less than $40 including project box (but not including the key or the radio of course). The source code is open and the schematics are available later in this article. All I ask is you let me know if you build one too!
All settings and memory are stored in EEPROM, so they persist even after powering down the keyer.
Controls and ports
First of all, here is a labelled picture of the front and side:
- Power switch: Turns the keyer on and off.
- Power LED: Lights up when the keyer is powered on.
- Sidetone switch: When on, sounds are played on an internal speaker. This is known as a sidetone, and is useful if your radio doesn't have a sidetone itself, for code practice (without a radio plugged in), and for configuring the keyer.
- Control LED: Blinks when transmitting, and during other functions (see below).
- Mem 1-3: These push-buttons control the memory functions described below.
- Settings: This push-button has several functions that control how the keyer is configured (see below).
And a labelled picture of the back:
- To Key: Stereo 1/8" audio cable port. You can plug either a dual-paddle key for iambic mode (recommended) or a straight key (limited functionality, see below).
- To Radio: Mono 1/8" audio cable port that goes to the radio's input "key" port. The radio doesn't need to support iambic keying (that is taken care of by the keyer). If the radio has its own keyer, make sure it is disabled.
A standard dual-paddle morse code key should be used. To conserve desk space, I chose a project box that my MFJ-564 key can sit comfortably upon:
When the keyer is powered on, it will play the letter R (for "ready") over the sidetone speaker (this will not be transmitted).
If you wish to restore the keyer to its factory defaults, turn off the unit, hold down the Mem 1 and Settings buttons, and then turn the unit on (while continuing to hold these 2 buttons). The keyer will wipe all its settings/memory and play a 3-tone sound to indicate a factory reset has occurred.
In the default mode, the keyer works as a normal iambic keyer. Holding the left paddle emits a series of dits, holding the right paddle emits a series of dahs, and holding both emits alternating dits and dahs.
- Change speed: Briefly press and release the Settings button. Ensure the sidetone speaker toggle is on. The keyer will be constantly emiting dits (these are not transmitted). Holding the left paddle will speed up the dits, and holding the right paddle will slow them down. Press the Settings button again when you are satisfied with the speed.
- Change sidetone frequency: Hold the Settings button until the Control LED turns on (1 second). Release the Settings button. Ensure the sidetone speaker toggle is on. The keyer will be constantly emitting dits (these are not transmitted). Holding the left paddle will reduce the sidetone frequency (pitch), and holding the right will increase it. Press the Settings button again when you are satisfied.
- Change keyer mode: The keyer can function in multiple modes. To change the mode, hold the Settings button, and while held press one of the memory buttons:
- Iambic: (Mem 1) The keyer will function as a normal iambic keyer as described above. Once set, an I is played on the sidetone speaker.
- Straight: (Mem 2) The keyer will function as a simple pass-through for a straight key. Once set, an S is played on the sidetone speaker. If you use a straight key, memory replay will work, but memory recording will not. Also, most setting changes won't be possible.
- Vibroplex: (Mem 3) The keyer mimics a vibroplex key. Once set, a V is played on the sidetone speaker. Holding the left key plays a series of dits, but the right key functions as a straight key so you must form the dahs yourself.
The keyer has 3 memories. This is mainly limited by the number of push-buttons you install. If you want more memories, it should be pretty simple to modify the code.
- Set a memory, Hold one of the memory buttons until the Control LED lights up (1 second). Release the memory button. The control LED will remain lit. Ensure the sidetone speaker toggle is on. Send your message with your iambic key as if you were transmitting (it will not key your radio). The Control LED will be inverted (lit when not beeping) to remind you that you are recording. When you are finished, press the same memory button again. It will play a 3-tone sound confirming that your message was saved, and will blink the Control LED 1, 2, or 3 times to indicate which memory slot was written to.
- Replay a memory: Press the memory button quickly, making sure not to hold the button down for longer than 1 second. The key will replay your message over the sidetone speaker, and also key the radio with the message (if connected). Trying to replay an empty memory will play a 2-tone "empty" sound over the sidetone speaker. If you wish to stop a replay mid-transmission, simply tap either paddle of the key and the replay will stop immediately.
There is a length limit on the memories, although it is reasonably large. The limit is 600 units, where a unit is either a dit, a dah, or a space between letters. The space between letters is rounded to the nearest dit-length, and is capped at 254 dit-lengths.
The keyer is built around a Teensy 3.1/3.2 (I used a 3.1 but they are compatible).
Here is the schematic (I tried to draw it approximately how my device was laid out):
- Pins 14 and 15 are connected directly to your key. I used a stereo 1/8" audio port so I could swap keys easily. By default, grounding pin 15 triggers dits, and grounding pin 14 triggers dahs.
- Pin 16 controls the mosfet which actually keys your radio. If you're just building it for code practice you can of course leave pin 16 disconnected. This port can be mono or stereo (if stereo, just leave the ring disconnected or grounded).
- None of the pin choices are critical. If you change them make sure to change the corresponding
defines in the source code. The only constraint is that the pin connected to the sidetone speaker must be PWM compatible (I used pin 22).
- R1 and R2 are current limiters for the power and control LEDs. I used green and red LEDs, with 51Ω and 100Ω values respectively. Remember that green LEDs have a higher voltage drop than reds.
- R3 is 100Ω and is connected to a 100μF capacitor which is connected to the sidetone speaker. Change the value of this resistor to prevent overdriving the speaker and to select the desired volume.
- R4 is there to ground out any residual gate voltage on a 2n7000 mosfet. I used 1KΩ but this can comfortably be 10K, or higher. The 2n7000 is rated for 60V of isolation which should be plenty for modern radios (tested with Yaesu FT-897D).
- The teensy has built-in pull-up resistors for the push-button pins so no need to worry about those.
- I accidentally used a default-closed push-button for the memory 2 button. Rather than swap it out, I decided to just fix it in software. You'll likely have to change a
definein the source code (search for
- The source code is licensed under the 2-Clause BSD license so you can basically do whatever you like with it.
- Use the "teensyduino" plugin for the arduino IDE to program it, as described on the teensy website. While programming, the battery power should be off since it will be powered by USB.
- The code uses a basic write-leveling algorithm so that it isn't constantly writing to the same locations in the EEPROM. This should preserve the EEPROM for the lifetime of the keyer (and then some).
Ian Smith (VA7IAN) built the following unit with an extra memory button and a USB port so it can be powered/programmed without having to disassemble it!
Please let me know if you build one yourself!
73 DE VE3HOY