Recently, for no particular reason whatsoever, I decided to learn Morse Code. Within a couple of weeks, I could type at a decent speed, but I never liked the virtual feeling of clicking a mouse or tapping a screen, because of the lack of force feedback. I started watching videos of people using real transmitters used on ships during the age of Morse code, and was transfixed, especially after visiting the Natural History Museum and seeing a real, vintage Morse code transmitter.
Morse code is simply a series of short beeps and long beeps, and the transmitter is a paddle that the operator presses down to complete a circuit that sends said beep across a wire for someone else to recieve.
Diagram credit to viyath.com
I wanted to focus on the actual mechanical transmitter first rather than the software; getting the hardware configured to my liking was crucial to me - I only started this project because I didn't like the feel of just tapping on a screen to send morse messages.
To emulate the vintage feel of the transmitters I was going for, I used this diagram as a baseline:
It is difficult to 3d model without an orthographic side profile, so I used DeepAI to regenerate the image from the side, with a non-perspective view:
I used the Bezier and spline tools to trace the rocker arm out in CAD, so that it could be extruded:
Then, I used the extrude tool to cut away holes that would be necessary to make this operable, such as a pivot point for the arm. I could have drilled
these away, but 3d printing holes and connectors in the design leads to good habits for
tougher materials down the line, like CNC machining.
I used a spline tool for the gentle curves of the rocker arm, then cut out circles using the extrude tool for the connecting pins and pivots, then inscribed VIYATH.COM and cut out a 1mm groove in its shape to add a bit more character.
The central hole is elongated to allow the arm to tilt - if the hole were the same size as the rod, it would be stuck and unable to rotate.
These blocks hold the rocker arm up. The sides are 2mm wider than the width of the rocket arm to allow a washer to slide in between the rocker arm and the pivots, so that there is no side-to-side play. The holes are 6mm wide to fit a 6mm bolt as the pivot.
These blocks are known as terminal blocks, and they hold the stationery electrical contact, while also providing the 'stop' that limits the range of motion of the paddle to only a few degrees, preventing the spring from making the rocker arm shoot off every time you let go of it.
In all, the 3d printed parts looked like this, when placed in roughly the areas they will be in when fully assembled.
The plan was to insert an M5 bolt through the rocker arm's pivot hole and the holding blocks. Three holding blocks would be placed in a configuration where each one has a bolt protruding from its middle. When pressed, the bolt from the rocker arm would contact one of the bolts from the holding blocks, completing a circuit and sending a signal.
The other holding block would also have a bolt, but this time its purpose would be to constrain a spring that would constantly push the rocker arm up. Yet another bolt would be on the final holding block, with a nut that would control the distance the rocker arm would have to travel before hitting the contact - all of this will make sense soon.
For the device that would convert the short circuit to a readable signal for a computer, I settled on using an Arduino Nano from Aliexpress, which only costs 74p.
After 3d printing, attaching the spring, and screwing in the required bolts and washers, we had a working hardware model.
At this point, I realised it was pretty much impossible to use this on a
smooth table, since the smooth wood would just slide away every time you
tried to click it. To fix this, I cut out pieces of rubber from an old table tennis paddle and superglued them to the bottom of the transmitter for grip.
We now had a working, clickable Morse code transmitter, with every function
adjustable, including spring pressure, range of motion, and the contact
point. At this point, I still hadn't emulated the knob of old transmitters from
WW1. For the knob, I found a small grip from an old chest of drawers, unscrewed it, then drilled a hole in the rocker arm to attach it. Finally, to make everything look more professional, I spray-painted the wood black:
The Arduino, like all USB devices, can send Serial Data. This data can not directly affect the computer, but it can be used to trigger other functions. To test this out, I connected two wires to the Arduino, one into the GND (Ground) pin, and the other into the D3 pin, to give adequate space between them so that they would never touch.
When these wires were touched, the voltage across them would drop to almost 0. By setting up a simple threshold system, such as running a function when the potential difference across GND and D3 is less than 0.01V, we can now 'detect' when the wires are in contact. This function can then send a serial message on the USB port, for instance by sending the message "CONNECTED" when the contacts are closed, and then "DISCONNECTED" when the contacts are opened again.
While this may look complicated, the code is incredibly easy to follow. The touch pin refers to which pin in the board we should look for a voltage drop between ground for.
The LED_PIN is the onboard light that should flash when the contacts are held, mostly just for development and debugging purposes.
The DEBOUNCE_MS is more interesting - when any switch or contact closes, it will always bounce, even by just a little bit. During my first test runs, if I clicked the paddle down once, I would get 6 messages instead of just 1. This turned out to be because no matter how gently I clicked the paddle, on a microscopic level, it would bounce up and down. The Arduino was sensitive enough to detect all these mini bounces and record them as signals.
This DEBOUNCE_MS is a delay in milliseconds to essentially ignore what the contacts are doing after the initial contact for a set amount of time. In the code above, after a signal is recorded, the Arduino ignores whatever the pin is doing for the next 5 milliseconds to avoid the bouncing readings.
A separate program, in my case Python, can read the serial data outputted from the Arduino and run its own function. This time, since Python is run on the computer itself, it can control the computer, such as virtually holding the left mouse button every time it reads "CONNECTED" on the serial monitor, and releasing it when it reads "DISCONNECTED."
After I got the programs to work by touching the wires together, I needed to have the wires touch when the rocker arm was pressed down. I initially wanted to solder wires to washers, but this led to poor connections and inconsistent signals.
Instead, I removed the plastic case of the jumper lead, and squished it between two nuts on each bolt, tightening them against each other for an excellent electrical and mechanical connection.
The finished product looks like this-
-and works perfectly, with no input lag and the vintage tactile feel that I had initially set out to emulate:
Overall, this project was a massive success. The only things I would improve if I were to do this again would be 3d printing the base instead of using a block of wood, to allow all the circuitry and wiring to be hidden inside the base instead of exposed. I would also invest in a more expensive Arduino that has a chip with enough permissions to bypass the Python Script entirely, so that the Morse Code transmitter could be used on any device without the need to install Python.