There are various styles of automated Morse keys the bug being one of the simpler [1]. The real unit has a horizontal paddle type key which is pressed to the left or right [2]. Pressed one way the key produces a stream of dots, pressed the other way the key produces a single dash for each press. My circuit and code simulate this device.
Hardware description:The circuit consists of 2 switches and a piezo sounder element.
The switches are attached to 2 inputs with their internal pull up’s enabled.Pressing a switch takes the respective input to ground.
One end of the piezo sounder is connected to ground, the other to a PWM pin which provides its drive signal.
Software overview:The switches are debounced using a software routine I found in a pdf called Debouncing by Jack G Ganssle [3]. A timer interrupt polls the switches at regular intervals and the switch is considered debounced after it has registered as being in the down state for a set number of these intervals.
The main line code (loop{}) checks which button, if any, has been pressed. For the dot button dots are generated as long as the button is held down. For the dash button only one dash is generated for each button press.
The length and spacing of the dots and dash can be set between 3 speeds by taking pins A0, A1 or A2 to ground. The speeds are 5, 13 and 20 words per minute respectively. Detail of how the values for the code speed were calculated can be found in the references [4].
Quirks:For a dash to be generated you must first release the dot key before pressing the dash key otherwise you get nothing until you have released and re-pressed the key.
On the other-hand, pressing and releasing the dash key with the dot key down will produce a gap in the stream of dots; this may prove useful if you are sending a letter pair e.g. ss.
References (Checked 4/4/2020):[1]http://www.morsex.com/pubs/iambicmyth.pdf
[2]https://en.wikipedia.org/wiki/Vibroplex
Comments
Please log in or sign up to comment.