The Morse Code Translator/Sender
How It Works Page


The information on this page will show you how we connected a telegraph sounder (circa 1920) to a computer and use it to "play" Morse Code in our classroom.


Project Description

We acquired the sounder during a cleanup of our physics lab. The sounder has such a unique sound, we wanted to hear it play real Morse Code. The sound is also familiar to anyone who watches old western television shows or movies.

It was decided that the sounder would be connected to a computer and "play" Morse Code sent to it by a user who enters text into a form on a web page. As we don't want to have to listen to the sounder when just anyone decides to play it, we require a password for that portion of the operation. With or without a password, the web site will translate the text entered into Morse Code.

The Working Details

The user enters text to be translated and a password into a form on the main page and clicks on the "Transmit" button.

The data in the form is sent to program, written in PERL, on the webserver.

The PERL program translates the text into Morse Code and outputs a web page to the user showing the translate. The program also send the text to be translated to a file on a hard drive. The hard drive is not on the server but on a compter about 60 feet. There is a folder set for sharing on that computer and that folder is "mapped" as an extra drive on the webserver.

On this second computer there is a program, written in QuickBasic, that looks at the contents of the file that the PERL program writes to. When it is not empty, it reads the data, rewrites the file as empty, and then translates the text into Morse Code. It then sends the dots and dashes as output to pin 2 on the parallel port of the computer.

Pin 2 on the parallel port is connected to a power transistor which uses the 5 volts from the port to switch 12 volts, from the computer's power supply, on and off. That 12 volts energizes the coil on a relay which, in turn, switches the current on and off to the telegraph sounder.

The timer of the dots and dashes is controlled by the QuickBasic program. A dot is set to .1 second. A dash is 3 times a dot. The space between letters is 3 times a dot and the space between words is 7 times a dot.

For a complete explaination of how to send and receive data through the computer's parallel port using QuickBasic, see my Ellapsed Timer Project on my Robots and Other Gizmos Page.



This is a recording of the sounder.

Click to Play
This is a schematic diagram of the circuit.

Click on the image to enlarge it.
This photo shows the sounder as is hangs on a wall.
The relay and terminal strip were mounted to the existing base.

Click on the image to enlarge it.
This side view shows the sounder more cleary.

Click on the image to enlarge it.
This is the back of the computer that controls the sounder.

Click on the image to enlarge it.
This is the QuickBasic program used to control the sounder.

Get the program as a .BAS file
Get the program as a .TXT file
Get the program as a .EXE file
This is the PHP program used to output the code on this site.

Get the PHP program as a .txt file


Go to our Main Robotics Page