Build a Simple Serial Port Interface
What is a serial port interface?
In simple terms, a serial port interface translates signals from a computer serial port to be used to place a transceiver into transmit or send CW (morse code) characters. A computer serial port usually has 9 pins, although some older PC’s may have 25 pin serial ports fitted. Both types carry out the same function, the only difference being the size and the pin connections. As it’s name suggests, a serial port sends data serially, in other words, each piece of data is sent one after the other.
Each piece of data is sent as a “1” or “0”, this corresponds to a positive (1) or negative (0) voltage. This voltage is normally around 12v, that is +12v and -12v relative to the pc ground, although it perfectly acceptable to be anywhere between 3v and 25v. What we need is a method of turning the stream of high and low voltages into a format that is useable by the transceiver. As nearly all transceivers employ a system of connecting the PTT/CW key to ground to turn on the transmitter, we can see this is the opposite to the data sent from the PC. We don’t want to be pushing, potentially, 25v or -25v the wrong way into the radio either! Also, to further complicate matters, there may be a low voltage (5v) on the radio PTT/CW key connection.
Unless we need to process the serial port data, for example, full radio status and control, all we need to do is use the serial data to effectively turn a switch on and off. When the “switch” is on it connects the transceivers PTT/CW key to ground causing the radio to transmit.
Design a simple interface
So how to accomplish this seemingly simple task?
Easy! Let’s use a low voltage relay. Errrm, NO! Why not? For several reasons, firstly, the PC serial port probably won’t be able to supply enough current to operate the relay. Then there is the wide range of possible voltages that the port may use. Another good reason is that the relay will be noisy. What about the relay opening and closing at high speed, will the contacts “bounce”? probably. A big issue could be the reverse voltage spike when the relay is de-energised, of course a diode can take of that, but what if the diode breaks down?
OK, so that’s the relay idea thrown out of the window…
The transistor! Well, yes maybe, it’s fast, silent, some can handle large voltage and current swings. Should be simple to design and implement. But wait. Ideally we need to keep the radio ground isolated from the PC ground. Hmmm, to get isolation from each other this could take some serious design time, but we’re getting there…
Enter stage left, the opto isolator, sometimes called an opto coupler.
What’s this magical component of which you speak? The opto isolator is an IC that contains an LED, usually an infra-red, and a phototransistor. We know a LED works by producing light when a voltage is passed through it. The phototransistor works similar to a normal transistor, except that instead of requiring a base voltage/current to turn it on, it’s activated by light. Therefore, when the LED lights, the phototransitor turns on, and vice-versa.
Because of the methods used in maufacturing the opto isolators, there is full isolation between the LED on the input side and the phototransistor on the output side. So the opto isolator can tranform the serial 1’s and 0’s into off’s and on’s and more importantly, isolate the serial port voltage from the transceiver.
Building the interface
The opto isolator I’m using in this project is the 4N35. It’s a 6 pin DIL standard IC package requiring the addition of only a single resistor and diode to build the circuit. As can be seen in the schematic, pin 1 is connected to the DTR pin of the PC serial port via a 1.2K resistor. The resistor is simply used to limit the current flowing through the LED inside the IC. Pin 2 is connected to the serial port ground. A 1N4148 diode is connected in reverse across these pins to prevent damage to the IC by the negative voltage produced on the serial port when in the “0” state.
On the output side of the IC, pin 5 goes to the transceivers PTT and/or CW key input, while pin 4 goes to the transceivers PTT/CW ground connection. Note the PTT and/or CW key grounds may not be the chassis ground.
As the opto isolator IC is quite small, it is possible to mount the IC, resistor and diode within the hood of a 9 pin serial port plug. In the picture I used hot glue to hold the IC in position and soldered the resistor and diode in position. I made a small mistake while soldering the wire that goes to the transceiver from the IC. If you look carefully, you will notice that I soldered the PTT ground to pin 6. I wasn’t thinking about the fact that the IC is upside down and therefore pin 4 is the other end of the package, circled in yellow. I corrected the wiring after I had taken the photo and it all works as it should.
I’ve tested this using CW and it is quite capable of sending the characters at a speed of 100 words per minute without errors. At such a high speed, the CW sounds like a rough single tone. A second radio and PC decoded the CW sent at this high speed perfectly.