Computer interface cable for Baofeng – First try

In this post, I will share some info about the tx/rx computer interface cable I made for my Baofeng radios that is compatible with the Direwolf software TNC and probably others.  Here’s a peak at the mess I have made (that actually works):

Baofeng connected through homebrewed interface to computer to enable APRS packet transmission and reception tuned to my testing frequency of 147.120MHz with the standard 144.390MHz APRS frequency.
This is crude but works and was built entirely with parts I had laying around tuned to my testing frequency of 147.120MHz.

But first, a little background…

Now that I’m receiving beacons in Direwolf and I’ve setup a Raspberry Pi to send and receive APRS, it is time to begin the holy grail of 2 way testing with two APRS nodes — one RPi and a laptop.  Then I will be able to experiment with more advanced messaging capabilities of APRS as well as a BBS system.  BPQ is looking like the top contender right now (Thank you Joe DeAngelo AG6QO for the suggestions and excellent packet BBS implementation log!)

The radios

My first radios where a pair of 2m VHF radios from a thrift shop.  I like those HTX-202 radios.  However, I believed that the VOX feature on newer radios would make it easy for me to send packet data as well as receive it so I bought a couple Baofeng radios.  I bought the super cheap UV-5R VHF/UHF (about $25) and the BTECH UV-5X3 VHF/1.2m/UHF (about $65).

So how did that work out for me?  I found early on that the VOX feature, does not seem to function well.  I can’t find much about others having the issue.  Am I the only one who is either confused or has two radios with a poorly functioning VOX?  I’ve tried setting VOX as low as 1 and as high as 9 (just for giggles).  I’ve tried both the UV-5R and the UV-5X3; both have the issue!  When I yell, close to the mic, the VOX detects audio and enters transmit mode.  Less than a yell and it stays in receive.  Worst of all, I haven’t found an output level from my packet software TNC (Direwolf) that will trigger transmit.  No dice!

So, that felt raw.  I bought those radios mainly for VOX but they wouldn’t work that way.  Consolation: I have two more radios (reasons stated above), I have two more frequencies 1.2m and 0.7m.  Overall, I’m happy with them.  I may have just expected a little too much for my money.

VOX isn’t reliable for transmitting packets

Moving forward, I know that the VOX solution was not the best solution to transmitting packets with a radio.  Just think about it: The radio VOX circuit must hear the audio of the packet to determine it needs to turn on, before it is transmitting.  That means that the start of the packet, no matter how fast the detection and switching, must miss somewhere between microseconds and milliseconds.  That would require more workarounds depending on the detection and switching time.

The best solution is to have the software TNC (or hardware if that’s what you’re using) actually activate the PTT circuit.  That will place the radio in transmit mode prior to transmitting the packet.  Perfect.

The homebrew interface

Eventually, (a month later…) I accepted this reality and committed myself to building an interface for my laptop.  This is different than the way I setup the Raspberry Pi since my laptop does not have easily accessible GPIO pins.  It turns out, it is only a little bit more challenging the the RPi interface — score!   I’ll share my RPi setup later.  However, for now, suffice it to say that the RPi setup is very well documented especially inside the Direwolf documentation.  Here is a bad pic, just for the curious:

Raspberry Pi in old plastic parts box with breadboarded PTT circuit for Baofeng radio
This is my Direwolf-Raspberry Pi setup acting as my home APRS station.

The biggest difference between the RPi and the laptop PC interface is the need to control the on/off state of a wire to turn on the PTT circuit when it is time for Direwof to transmit.  One common way to do this is by plugging in a USB<->Serial (RS-232) adapter and using one of the pins that are part of hardware handshaking in the RS-232 protocol like RTS (Request To Send).  If you have an old enough computer, it might just have one installed already.  This is a DB9 or DB25 connector that looks like this

USB to Serial DB9 RS-232 glued to a PTT circuit
USB to Serial DB9 RS-232 glued to a PTT circuit

I was able to cobble this interface together to connect my Baofeng radio to my PC soundcard’s mic and headphone jacks for transmitting and receiving APRS packets using a transistor, a capacitor, some wires, an old PC board, and an USB<->RS-232 serial adapter.  I was back on the trail of something good — transmitting digital packets!

As I refine it, I’ll provide more detail.  For now, I just wanted to share some of the things I learned along the way.

Lessons learned/Tips

  • If you plug the radio’s speaker output into the mic of your computer sound card and the mic input of the radio into your computer’s speaker y0u will activate PTT and the radio will go into transmit mode constantly.
    • The solution is to prevent DC current from flowing between the ground wire of the PC line out (headphones, etc.) and radio line in (mic).
    • Solve this by placing a capacitor in series with the ground between pc line out and radio mic.  You will probably see an initial PTT activation when you first plug it in due to the initial flow of current to charge the capacitor.  You should see the transmit turn off quickly (1-2 seconds).  If not you’ll have some troubleshooting to do 🙁
  • Test your transmissions on a VHF or UHF frequency that you have the privilege to transmit on and does not have activity on it.  Use the lowest power possible.
  • Use a NPN transistor with a 2-5k ohm resistor between the base and the RTS pin to trigger PTT.  I’ve seen 2N2222 recommended.  I didn’t have one handy and I grabbed one I did have.  It was this one
    • PTT Switching transistor (9287 N830) and capacitor (10uF electrolytic)
      This is a train wreck. But it does work.
  • The configuration for Direwolf that initiates PTT using the RTS pin of the USB serial port looks like this:

# If not using a VOX circuit, the transmitter Push to Talk (PTT)
# control is usually wired to a serial port with a suitable interface circuit.
# DON’T connect it directly!
# For the PTT command, specify the device and either RTS or DTR.
# RTS or DTR may be preceded by “-” to invert the signal.

PTT /dev/ttyUSB0 RTS

Finally, here is a crude schematic of my circuit when I wired it for my Raspberry Pi.  The one I’ve “crafted” for PC is identical except the RCA jacks are replaced with 1/8″ male stereo plugs and the “GPIO25” pin is replaced with RTS on a USB-Serial adapter.  YMMV

My circuit diagram/schematic depicting a very rough draft of a circuit to connect from a Baofeng mic/speaker connector to a PC Mic/Headphones port using RCA female jacks.
This is really crude. But, I’m sharing it just in case it helps someone figure something out for their setup.

Leave a Reply

Your email address will not be published. Required fields are marked *