We’ve featured quite a few of [mitxela]’s projects here in the past, and many of them have the propensity to be labelled “smallest”. His Morse Code USB Keyboard Mk II adds to that list. It’s a Saturday afternoon project, with a few parts slapped onto a piece of perf-board, that allows using a Morse key as a USB keyboard. This project isn’t new or fresh, but we stumbled across it while trying to figure out a use for a Morse key lying in the author’s bin of parts. You can practise transmitting, by reading text and typing it out on the key, and then look it up on your computer to see if you made any mistakes. Or you can practise receiving, by asking a friend to punch it out for you. Either way, it’s a great way to hone your skills and prepare for your radio operators license exam.
The project is a follow up to his earlier one where he hooked up the Morse key via a RS-232 — USB converter directly to a computer and let the code do all the work. That turned out to be a very resource hungry, impractical project and made him do it right the next time around. The hardware is dead simple. An ATtiny85, a piezo buzzer, some decoupling capacitors, and a few resistors and zeners to allow a safe USB interface. The design accommodates a straight key, but there is one spare pin left over in the ATtiny to allow for iambic or sideswiper keys too. There is no speed adjustment, which is hardcoded at the moment. That isn’t very user friendly, and [mitxela] suggests adding a speed potentiometer to that last remaining pin on the ATtiny. This would prevent use of iambic/sideswiper keys. Or, you could use the RST pin on the ATtiny as a (weak) IO. The RST pin can read analog values between 5V and 2.5V, and will reset when voltage falls below 2.2V. Or just use another microcontroller as a last resort.
For the USB interface, [mitxela] is using the V-USB library after wasting some time trying to reinvent the wheel. And since this is designed to work as a HID, there are no drivers required – plug it in, and the OS detects it as a keyboard. He’s borrowed code from the EasyLogger project to use the internal oscillator and help free up the IO pins. And to detect the characters being typed, his code uses a long string of compare statements instead of a dictionary lookup. Writing that code was tedious, but it makes the identification quicker, since most characters can be identified in less that five comparisons (one dit = E, two dits = I, three dits = S and so on). This “tree” makes it easier to figure it out.
If you’d like to look up some of his other “tiny” projects, check out The smallest MIDI synthesizer, Smallest MIDI synth, again! and the ATtiny MIDI plug synth.
This is very cool. I wonder if speed could be a power-on calibration, like it’s disables until you send a few dots and dashes (SOS?) to measure your timing then it begins conversion
I’ve seen morse trees before, they make no logical sense – seems like more to memorise than just the patterns alone
You’re right that memorization is the best route for humans… the tree is for the benefit of the processor .
Interesting project. I still wanna learn Morse code, even if it’s falling out of use.
The best advise I have heard for learning Morse is to have the characters sent fast (20 WPM) with a ‘think about it’ delay that spaces the throughput to 3-5 WPM.
This helps you to memorize the characters more as a musical rythym.
Yes. There are apps for that. I use “Morse Machine” on Android.
That is commonly referred to as “Farnsworth Timing”
It has seen a large resurgence of use in the amateur radio community since the requirement for knowing Morse Code was removed from the licensing. I know that sounds counter-intuitive, but I suspect it has to do with people learning/using it because they want to rather than because they have to.
That’s right. I know I’ve been trying to improve my CW copying ability, and I started out in 1982 in ham radio doing Morse exclusively.
In India, you can get a basic License without knowing Morse, but with a transmit power limit. To get the advanced License, you need to do morse at around 10 to 15 WPM, IIRC.
If you understand how trees work rather than memorising it you can try building it yourself. Not as efficient but might come in handy one day.
Might be useful as an input tool for someone with very limited use of their limbs.
I did something like this a few years back. But I dead bugged the decoder chip from a keyboard pcb and put a spring under one end and a cardboard hinge on the other. One of the pins acted as a contract to some tinfoil.
How did you get the tinfoil to subscribe the contract?
SCNR :-)
Damn new phone. I can’t stand touch screens. Next phone will be just calls and texts.
Yeah, simple mechanical user interface, more erginomic mic and speaker locations, and have it tied to the wall so you can’t lose it in the couch!
You should hack it to add a decent keyboard – like the one showed here. :-)
None of the radio operator’s exams cover Morse code anymore. Implying that they do may dissuade potential HAMs from getting into amateur radio.
It is possible to use only one pin to read both keys from an iambic keyer using resistors and configuring the pin as an analog input. It is possible also to detect a very long press, like 5 seconds, as a trigger to a function that changes the speed using the dit-dash keys as plus and minus controls, typing in the speed value as ascii characters..
This project is great, and might be implemented to act as a PS/2 keyboard controller also, thus allowing to use the PS/2 input that is free on many desktop computers yet today.
An analog ladder will work quite well for Iambic/side swipe keys. And the long key press for a special function. In the current code, he’s using it to generate a back space.
I’d love to see this become a commercial product with some marvelously helpful changes.
1. Instead of a straight key, put the entire device in a small tube with a momentary switch on the end as the key. That’d make it easily held and operated.
2. Instead of powering it from USB, power it from a single AAA battery inside that tube. That eliminates the need for a USB cable for power.
3. Make it emulate a Bluetooth keyboard rather than a USB one. Again, no need for a cable and an important plus, that’d let it work with smartphones and tablets that aren’t designed to be used with a USB keyboard.
The result would be a text-entry device for mobile devices that’d be easy to use in situations where a conventional keyboard and a touchscreen one are impractical. It’s also be marvelous for those with physical disabilities who’re familiar with a Morse UI.
And sell it commercially! Hacking without follow-on production accomplishes little.
WELL DONE. Applause for a great hack, and for a nice “fist” on the straight key. 73
It would be nice if it also allowed for paddle input. I would assume you would need to add an LO for CW WPM
Very good use for a cheap digispark board ( http://s.click.aliexpress.com/e/ZJyn2je ), specially the ones that have the USB thumb form factor
Well, apparently I was wrong. At this point it basically is spam; tone it down.
Where can I buy one of these?