Field Phone Morse Decoder

A field phone allows voice communication between your house and your barn or whatever. You can also use the key switches on the ring interface modules to send Morse back and forth. Why not add a Raspberry Pi to decode Morse code messages, and then control something with those messages?

For this demo, we used a field phone system from our sponsor SoftBaugh, who provided a unit for this and other upcoming field phone articles as well as PWIRE prototyping jumper wires to make the interface circuit. The interface circuit bridges a Raspberry Pi and the field phone’s ring interface circuit at the field phone host module. Check out the short video below, which shows this system in operation:

The interface circuit is a TLP172A optoisolator (practically any optoisolator will do), built up on a scrap of printed circuit board.

Morse Decoder Interface Circuit

The hand-wired interface above implements the circuit shown below:

interfacecircuit640x360This optoisolator not only makes sure that level-shifting isn’t a problem, it also helps to isolate the Raspberry Pi from any surges or ground variations from the field phone wiring.

The Raspberry Pi shown in this demo is an A+ model, although practically any of them will do. We’re powering this one from a USB connector on a host computer, but the Raspberry Pi itself is communicating by WiFi. One could easily add a hardwired Ethernet interface if desired and skip the WiFi portion also.

Connect the four terminals on the interface board to the Raspberry Pi and the field phone host module (FPHM) as shown below:

Field Phone Interface Circuit

In the left photo above, we see the connections for the field phone host module side. The white wire is the ground connection, and is connected to the left pin of the MPPT jumper. The orange wire is the key signal, and is connected to the left pin of the BZJOIN jumper. This provides keying from Line 1 on the field phone system. As mentioned on the circuit diagram, the right pin of this jumper would provide keying from Line 2.

In the right photo above, we see the connections for the Raspberry Pi side. The white wire is again ground, and is connected to pin 20 on the Raspberry Pi header. The blue wire is the signal wire, and is connected to pin 18 on the header. This corresponds to GPIO 24 on the Raspberry Pi.

The source code for this demo is taken from the open source project at:

https://www.raspberrypi.org/learning/morse-code-virtual-radio/

We modified the code slightly to make the timing a little faster (it is still slow, but hey, it works) and to add some special characters from the ITU tables. The actual files we use in this demo are available below:

http://oldschooltech.info/files/morse-code.py

http://oldschooltech.info/files/morse_lookup.py

Once the code is loaded (see the open source project link above), we can then SSH into the Raspberry Pi over the WiFi link and execute the script using the following command line:

sudo ./morse-code.py

Practice typing Morse so that the interface software can read it. Remember to pause briefly between characters. The source as we have configured it treats a dot as less than 0.2 seconds, a new character begins after a 0.75 second pause, and a new word begins after a 4.5 second pause (the software inserts a space after this time). Feel free to adjust these parameters, but keep in mind that the resolution and timing of the Raspberry Pi when operated this way isn’t as precise as you might wish it to be.

In a pinch or just as a proof of concept, you could also use a transistor to take the role of the optoisolator, but be aware that by doing so you lose the isolation that an optoisolator provides.

facebooktwittergoogle_plusredditpinterestlinkedintumblrmail

Leave a Reply

Be the First to Comment!

Notify of
avatar

wpDiscuz