Morse Code Touch Keyer/Autocoder




Introduction: Morse Code Touch Keyer/Autocoder

I actually built this project some time ago but thought somebody might be able to use the idea.I am a ham radio guy and got into it a little late in life when I retired and had the time.I have my general license now and use phone (voice) most of the time but wanted to learn CW (Morse code) and make contacts that way as well.I soon discovered, though, that the old mind and body just wasn’t up to sending CW with a straight key or even paddles.Not only does the brain not work as quick as it used to, because of age and medications, my hands are a bit shakey.I then discovered there was more than one way to skin a cat or send him dits and dahs, if you prefer.

This contraption uses a touch circuit for manually sending CW, letter by letter and also employs a Basic Stamp microcontroller from Parallax that controls the timing of the touch circuit and sends pre-programmed strings of CW characters using a 3 x 4 number keypad.It will send up to 30 programmed strings by using the Star and Pound buttons to shift the output.

Now, this project, while not beyond the reach of most people does require some background knowledge and abilities.However, I was able to make it work and I am certainly not the brightest crayon in the box, have no formal training, and like I said, I am old!!You will need to have a basic knowledge of electronics and be able to do some layout and soldering – not complicated as there are few components, but it is a little tedious due to all the wires from the keypad.And, you will also need to be able to work with the Basic Stamp series of microcontrollers.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Parts List

A couple of enclosures

A Basic Stamp 2 (or better) microcontroller with programming board

P3 Touch Keyer Kit from CW Touch Keyer

12 button numeric keypad with common terminal

DPDT 5 volt relay

Diode, 10K resistors (to buffer I/O pins on Stamp)

IC sockets for relay and Stamp

3 – 3.5 mm stereo audio jacks

4 – 3.5 mm stereo audio plugs

2 – 2.1 mm DC power jacks

2 – 2.1 mm DC power plugs

Step 2: Overview

I am perfectly aware that this looks a little convoluted with two boxes and three sets of wires, but bear with me as there is a method to my madness.The main thing is ergonomics.The large box containing the Stamp, relay and keypad is a bit too tall to rest your hand when using the touch keyer.  Its also pretty much full of wires!  In addition, the small box has a removable battery door for the 9 volt battery that powers the whole deal.So…. since the power was in the keyer box I had to get power to the Stamp, and therefore had to have a power cable and a set of wires from the keyer circuit to the large box containing the Stamp and keypad.The output to the transmitter is simply a 3.5 mm audio plug that is shorted by the relay via Pin 15 of the Stamp which is the only output pin, all other pins are inputs.

Step 3: The Basic Stamp Microcontroller

When I first built this I used a BS2 which worked fine, except I found that I couldn’t program all the required stuff and 30 separate messages since the BS2 is limited to ~500 instructions.If you want more than about 20 pre-programmed strings or very long ones, use the BS2SX version of the Stamp which allows you to use ~4000 instructions.If you have never ‘Stamped’ before you will have to familiarize yourself with using the I/O pins and coding in PBASIC, the Stamp’s language.For hardware, in addition to a Stamp, you will need one of several types of programming boards and a serial or USB cable.For software, download the most recent version of the Basic Stamp Editor from Parallax's website.Don’t be intimidated too much by all this as PBASIC is one of the easiest programming languages and the Editor is very user-friendly.

Step 4: The P3 Touch Keyer Kit

This is a very easy kit and if you have done much soldiering, you should knock it out in 10 minutes after the part identification phase.The connections to the PCB are pretty straightforward as well.Power in from the 9 volt battery via a switch, inputs from the two keys which can be anything metal such as homebrew paddles or pennies like I used.To mount the pennies, I drilled a hole in the center of the penny and stuck a piece of 22 ga. solid hookup wire through, soldered it and then ground it smooth with a Dremel.This way the hole through the enclosure can be directly underneath the penny.Since this thing works by your body capacitance, it is important to keep the wires connecting the pennies (or whatever) as short as possible.The outputs consist of the dit, dah and ground.I wired these to a 3.5 mm stereo audio jack in the front of the enclosure as well as the power (from switch) to a 2.1 mm DC power jack.

Step 5: The Big Box

For the main circuit board I used a piece of stripboard which works well to connect the keypad to the pins on the Stamp. Inputs from keypad are to PINS 0 to 11 and inputs from the touch keyer are to PINS 13 and 14.  The ground from the keyer goes to the ground rail.PIN 12 is unused but should be buffered to ground anyway.  Output to relay is from PIN 15.Connect the power (+ and – 9 volts) in to a couple of tracks, the DIT input to PIN 13 and the DAH input to PIN 14.Note that these inputs are normally HIGH so connect 10K resistors to the +9V rail and the BS2 pins to buffer the inputs for each.Use small gauge (24 or 26) stranded wire to connect the keypad to the PCB.I used 22 gauge which made it kinda difficult to bend the mass of wires into the box.Connect the common on the keypad to the +9 volt rail on the PCB and then all the keys to the stripboard (see my wiring diagram showing the BS2 I/O pins and inputs from keypad.) The horizontal lines are jumpers (for #,9,6,3) to the opposite side of the BS2.Your wiring diagram may be different, of course, and make sure you save it somewhere for future reference.Inputs from the keypad are normally LOW so connect 10K resistors to the Ground rail and each INPUT PIN to buffer these inputs.

PIN 15 goes directly to the coil on the 5 volt relay (I know this is wrong and you should use a transistor to drive the relay according to BS guidance, but with a 5 volt relay it works fine.) The other pole of the coil is -9V, of course and don’t forget the anti-reversing diode across the coil.I used a DPDT but a SPST would work too.I used a DPDT because I added a small piezo beeper (to give me some feedback on my keying and to be used for practice) and two of the NO contacts fire the beeper.The other two run to the jack that goes to the transmitter key.OK, that’s all there is to the main board so on to the program.

Step 6: The Program

Now,take it easy on me as I am sure there are more elegant ways to do the code but I am lucky I got it to work at all so I’m happy!!!  The very last file is a PDF containing the entire code with gaps (Vs) where I took out my personal stuff and to make it shorter, but first, lets look at it section by section:

As you can see it is one big ‘Do Loop’ with subroutines for each letter and number which are called to make strings or words.Pauses (in milliseconds) are added between characters and words.

The code can be broken down into 5 parts: the ‘shift’ function using the Star and Pound keys, the touch key (manual sending),the pre-programmed strings of characters, the ‘database’ of numbers, letters and punctuation/special characters and the DIT and DAH timing portion. Please note this is the actual order in the program.I’m sure there are other ways to make it work but I know this does.

Step 7: The Shift Function

A number button pushed alone sends a message or character and the star and pound buttons are used to ‘shift’ the output.For example, if the number one button is pushed by itself ‘DE’ (this is) and my callsign is sent.When the star button is pushed and held and the number one button is pushed, the number '1' is sent.And when the pound button is pushed and held and the number 1 button is pushed the prosign 'AR' is sent.

Here is the Star ‘shift’ part:

Step 8: The Touch Key Code

Here is the touch key/manual bit:

Step 9: Letters and Numbers

And here is a sample of the letters and numbers ‘databases’:

Step 10: CQ CQ CQ

A sample of one of the pre-programmed strings.  You will personalize this part especially with whatever you want to automate.The Number 2 button calls CQ – calling CQ thrice and my callsign twice:

Step 11: DAH and DIT Timing

And, finally, the Dah and Dits:

Here is the DIT/DAH timing section.This makes it easy to change the timing for the whole program.I put this at the very end right before the LOOP instruction probably for a good reason that escapes me now.

Step 12: The Bottom Line

The cost of this project is around $100 or so, depending on what enclosures you use.The BS2SX costs close to $60 and the P3 kit costs $22 and the remainder of the parts just a few dollars.But for me it was well worth the cost and time to build, not to mention, it was a fun project.Just to have all the numbers programmed and a key press away was worth it.I have trouble with numbers and it’s a surprise to newbies in CW how often you have to send numbers during a QSO.For someone who is a little slow, like me, it also really makes a difference in having a few canned phrases such as your name, location, your rig, and antenna to throw into the conversation.It sort of gives you a chance to get a breathe and think.  If you build this project, I hope it goes well and you have fun. 73s!

Be the First to Share


    • LED Strip Speed Challenge

      LED Strip Speed Challenge
    • Sculpting Challenge

      Sculpting Challenge
    • Clocks Contest

      Clocks Contest

    5 Discussions


    4 years ago

    Hi, thanks for sharing this. With the code, what happens if you touch both right and left paddles at the same time?


    Reply 4 years ago

    Hello, jgeepers. Well, to be honest, I have never tried that, but I suspect that you would never be able to do this exactly simultaneously and the first penny touched would send and then the other.


    Reply 4 years ago

    Okay thanks. I'm thinking about buying an Iamibic key like a Bencher but I don't want to spend $150+. Then I saw your build. I especially like this option that you noted

    I'm realizing the cost isn't all tied up in the key. There's also the electronic keyer. I've built a practice oscillator from this design and I'm very happy with the sound. It's very clean.

    I was able to hook up the practice oscillator to a basic stamp that I have, BUT I'm realizing if I want to merge the iambic key, my practice oscillator AND the basic stamp, I'm going to need the right code. Making the code simply produce "dit" and "dah" is no problem. I'm just wondering how the heck to produce the right sound if both keys are held down at the same time. I'm not super proficient at writing code!

    Back to the drawing board...or I can simply give in a spend a couple hundred bucks and buy it all and start practicing morse code instead of spinning my wheels! lol!