Automatic Fox Hunt Morse Code Identifier.
By Steven Stuart, W8AN
Dec 14, 2017
COMPONENTS USED
Arduino Nano microcontroller (MCU).
A few discrete components to pass audio and to control the
radio transmitter switch.
OVERVIEW
This
program sends a Morse code message at a specified
interval to output
pins on the Arduino Nano MCU. Output is either switched Morse code sent
as a
user would manually operate a code key, or as an audio signal. The
switched signal could be used to key a transmitter carrier for true
continuous wave (CW) such as is used on an HF transmitter. The audio
coded signal can be sent to the microphone input of the transmitter
such as an VHF FM unit. Here we will be keying a hand-held VHF
transmitter with a transistor and injecting Morse code audio into the
microphone jack.
The program is written in Visuino. Visuino provides an environment
where you connect programming components together with virtual "wires"
to define your program flow. Visuino then generates Arduino code that
can be compiled and uploaded to the Arduino board using the Arduino
IDE. No hand written code is necessary.
DESCRIPTION OF OPERATION
This is an image of
the Visuino component diagram of the Morse Code Identifier. This is the
program that makes the Identifier work. Below I will describe
the
components and their function. Keep in mind while viewing the program
flow that the component functions all happen at the same
time.

First off, let's put a message into the MorseTextValue
component. Morse code is manually entered into the component.
It is
a text string of ones and zeros. Use 1 for tone, 0 for silence. The
letter
'A' (di-dah) would be encoded as 101110. A dot (1), an inter-character
space (0), then a dash (111). For best results, use an inter-character
space (0) at the end of each character, use two zeros between
characters, and use four zeros for an
inter-word space. So 'HI WORLD' which sounds like this:
di-di-di-dit
di-dit
di-dah-dah
dah-dah-dah
di-dah-dit
di-dah-di-dit
dah-di-dit
would be encoded in this way:
H
I
W
O
R
L
D
* * * * * *
* --- --- --- --- --- * ---
* * --- * * --- * *
10101010001010000010111011100011101110111000101110100010111010100011101010
Note that only the number string is used in the MorseTextValue
component. The following value contains the message: K8TIH / FOX

The CodeSpeed
component is a pulse generator. It is working as a software astable
multivibrator. Setting the property Frequency
to 12 (12
Hz) means that we will be scanning through 12 MorseTextValue
characters per second. So every 1/12th second, the MorseTextValue
component is clocked, sending its message to the components TextLength and SubText. TextLength
always outputs the length of the coded string of ones and zeros. We use
this information to know when to key the transmitter. You will notice a
0 at the beginning and a couple of zeros at the end of the message.
This silent time will give us a moment for the transmitter to key-up
and to key-down before and after the code is sent. Add more zeros for
more time.
Properties of the CodeSpeed
component
The CodeSpeed
pulse generator also inputs to the Counter.
The Counter
gives us a way to single out just one bit of the message string and to
restart the message. The Counter
outputs the current number of pulses that have occurred since the last Counter reset. This
number is fed into the CompareValue1
component. This component compares the current message character
position with the length of the message. The CompareValue1 Value
property is overridden by the Value input wire from the Counter. The
red pin icon indicates that a sink-pin input has been enabled for this
property.
As seen in the CompareValue1
component properties, if the Counter
value is smaller than the TextLength,
then the Out signal is true. This signal is connected to pin D12 of the
MCU. The
same signal is inverted and conneted to pin D13 so the opposite
polarity is available for the key-up circuit, if needed. The Arduino
Nano has an on-board LED connected to pin D13. The LED will light when
the key-up signal is present.
Properties of the CompareValue1
component
To actually send the code, we need to isolate each bit of the Morse
code message at each CodeSpeed
clock pulse. We do this with the SubText
component. This component has the MorseTextValue
message at one input, and the Counter's
current pulse count at another input. As seen in the SubText
properties, we are looking at only 1 character, which is set
in the Length
property, at the position received at the Position input. The
Position property is overridden by the Position
input from the Counter.
Properties of the SubText
component 
The output of the SubText
component will be a single character, a "0" or
a "1", determined by the Counter's
Position input connection. This character is
then converted to a number at the TextToInteger
component. The number is then compared with the value 0 in the CompareValue2
component and its output is sent to pin D8 of the MCU. Pin D8 is a
digital Morse code signal that could key a CW transmitter if desired.
Properties of the CompareValue2
component
The Morse code coming out of the CompareValue2
component is also input to the PlayFrequency
Tone component. The properties of the PlayFrequency
component are set to an audio frequency of 1000Hz. The tone is sent to
pin D4 of the MCU. You can hook a speaker to this pin to hear the Morse
code.
Properties of the PlayFrequency
component 
All of the above description takes the system through the MorseTextValue
message the first time. After it is sent, the Counter continues to
count but no more message is read because the Counter
value goes above the length of the MorseTextValue
length. So we use the XmitInterval
component to introduce a delayed reset. XmitInterval
is another pulse generator. We have set a value of
0.0166...Hz, (1/60 Hz) which is 60 seconds. Every 60 seconds a pulse is
sent to the Counter
Reset input to set it back to 0 and start the process again.
Properties of the XmitInterval
component 
Schematic

Visuino Integrated
Development Environment

Arduino Nano


Morse IDer program code is available at github.com/w8an/ArduinoMorseIDer
Video of the device in operation youtu.be/8184Dpgswc8
The Arduino integrated development environment (IDE) is available at arduino.cc
Visuino IDE may be downloaded from visuino.com
International Morse Code Hand Sending 1966 US Army Training Film