Interfacing the UV5R with a Raspberry PI 3 Echolink-Svxlink

Posted on May 7, 2017
Filed Under Amateur Radio | 22 Comments

Today’s post is about my successfully interfacing a UV5R Baofeng with a Raspberry PI 3 running Svxlink.  Primary use is for an Echolink node connecting to a local repeater.
( Updated Jan3, 2018 – Some reports that not all variants of the UV5R work as described below. I have used the UV5R+ and UV5RV2+ successfully. )

My primary goal was to NOT use VOX to trigger the push to talk but to use a COS or Carrier Operated Switch.

Svxlink is a powerful software program that can be used as a repeater controller, a simplex link. Supports networked multiple receivers and transmitters. It also has an Echolink module.

Echolink is a popular system that allows two or more nodes to connect over the internet.

I wont discuss the installation or setup of Svxlink as that is covered many times. Svxlink has built in support of the GPIO (General Purpose Input Output) pins  on a Raspberry PI.

During my research time and time again I found reference to a hardware modification for the UV5R where you solder a wire to pin 2 of the audio amplifier in the UV5R.

The final audio amplifier’s supply voltage is removed when no signal is present and supplied when signals are received. This mod which connects to that supply Vcc was fairly easy and can be found here.

However I noticed on the schematic of the UV5R that there is no dc blocking capacitor on output to the speaker and external speaker jack.  The output goes to about 3 volts when the amplifier is enabled. To zero when no signal is received. Why then do I need to open the case?

UV5R audio output section

It is not necessary. Note the connection from pin 1 to the external speaker jack. Seems like a poor design to me to keep the internal speaker inline? (I wont go into the point of C158 and R192 in series with ground connect at each end? The schematic *must* be wrong..    At least their is 3 volts on the external speaker output when a signal is present…I can work with that!!

Here is the interface I built which works fine.  It expects the PTT control signal from the GPIO pin to go high (3v) to trigger the ptt output which grounds the PTT line from the UV5R.  And the COS signal to go hi (3v) from the RX when a signal is received. The output will also go hi when is connected to one of the GPIO pins on the Raspberry PI.

I decided to use 2 1:1 isolation transformers for the audio to minimize hum. I also am using two pc817 opto isolators instead of relays for outputs for the COS signal and PTT.

There are three adjustments. RX audio level, TX audio level and the COS/COR threshold. I made that variable so it can be used on other systems if desired.

Audio / digital interface for echolink for UV5R and Raspberry PI

Here is the first version of the circuit.

Completed interface board.

The main take-away here is NO NEED to MODIFY the UV5R.

This circuit can also be used to interface with a PC serial port *however* you might want to add a diode on the PTT input to prevent rs-232 negative voltages. And you don’t have to use 3.3v unless you are interfacing with logic that requires 3.3v.

I hope this helps some struggling Amateur. Feel free to use/modify etc to suit your purposes.

All parts were ordered on Amazon and the total cost is about $10. Hard to tell as I purchased the parts in lots of 10 or more.


Print Friendly, PDF & Email
Share on Facebook


22 Responses to “Interfacing the UV5R with a Raspberry PI 3 Echolink-Svxlink”

  1. Joao Silva on December 30th, 2017 2:02 pm

    is there by any chance a schematic?
    best regards

  2. Joao Silva on December 30th, 2017 2:03 pm

    i mean like the one that is on your hand 😉 (board)

  3. BacardE on December 30th, 2017 4:01 pm

    The schematic is in the post.

  4. Joao Silva on February 4th, 2018 8:03 am

    I think I did not explain myself, I mean, if you have the PCB layout 🙂

  5. BacardE on February 4th, 2018 12:45 pm

    No pcb. Was just built on breadboard.

  6. Andrew Michael on April 2nd, 2018 7:44 am

    Can I ask what you used for the soundcard?

  7. BacardE on April 2nd, 2018 10:17 am

    Was a cheap chinese usb soundcard dongle. about 8 dollars. Made by UGREEN. Bought off amazon. Its description reads “UGREEN USB Audio Adapter External Stereo Sound Card With 3.5mm Headphone And Microphone Jack For Windows, Mac, Linux, PC, Laptops, Desktops, PS4 (Black) “

  8. Andrew Michael on April 8th, 2018 11:44 am

    Are the values for R2 and R4 correct? I would have thought you’d need about 100mA to trigger both the LED and opto-isolator?

  9. Joseph Massimino on May 28th, 2018 9:40 pm

    Can you make the image of the circuit and the writing next to it bigger, when I make the screen bigger on my end, it all get very blurry.

  10. BacardE on May 28th, 2018 10:35 pm

    If you click on the circuit schematic picture it should open a larger image.

  11. BacardE on May 28th, 2018 10:44 pm

    It is what I am using. Though I suspect for reliable operation 500 ohms might be better at 3.3v. I just visually reverified that the 1k value is what I am using.

  12. Rolf on September 13th, 2018 2:00 pm

    Do you have any PCB design file’s. That would be great and easier to see. Please add a pcb file, thnx.

  13. BacardE on September 14th, 2018 8:39 pm

    Let me say again that this project was simply built on a breadboard. No pcb layout is available. Sorry.

  14. Yohann Wilkerson on December 28th, 2018 5:11 pm

    Your audio circuits have blocking capacitors on both sides of the transformers; is that not redundant? I was thinking that any DC bias is removed on the input side, and only audio AC is presented on the output of the transformer. Therefore, no DC block should be necessary on the output side of the transformers. If the caps are more for filtering, I would think that this would provide the same frequency range on either side of a 1:1 winding, so still one is redundant.

    Am I missing something?

  15. Joe on January 2nd, 2019 12:18 pm

    I’m using a Baofeng UV-5R5 and when I measure between the Spk + and ground (tip and sleeve on the 2.5 mm connector) I don’t see the 3 volts when a signal is received. Any ideas?

  16. BacardE on January 3rd, 2019 8:08 am

    Well assuming the cable is good and you have RX audio at that point, the only conclusion I would draw is that the UV-5R5 has a different circuit for audio output. My initial search online for a schematic was not successful. I have used this on my UV5R+ and UV5RV2+ and one other variant.

  17. BacardE on January 3rd, 2019 8:12 am

    You are correct. But I have no idea to what others might be connecting the output side. A dc blocking capacitor is a cheap item. The values aren’t really critical for this purpose. In some cases the values would be more critical if you needed to pass the CTCSS tone etc.

  18. Yohann Wilkerson on January 13th, 2019 11:19 am

    Thank you for your response. I don’t find fault with your design, I only wanted to make sure my understanding was good. I actually like your design better than others which require modification of the radio, and I appreciate you posting it.

    Thanks again.

  19. Jharwin Barrozo on February 20th, 2019 1:27 am

    This is a great post, I will bookmark this one as I’m also running a UV-5R using CM108 on rpi svxlink so far it’s working really great no complain at all. But, for now, I don’t use the COS of the radio, I just set the configuration settings of svxlink.conf to detect rx using VOX method. I want to utilize the radio COS because I have read that’s more precise control of incoming signal than vox from svxlink itself.

    I found out that on my UV-5R pin 2 of the TDA chip, when it receives a signal it goes from 0 to 8.2v. This is same voltage VCC of the radio. I wonder why you have said, that on your radio – The output goes to about 3 volts when the amplifier is enabled.

  20. BacardE on February 25th, 2019 12:41 pm

    Well the audio output pin is what is going to about 3 v. I am sure it is about half of vcc for linear audio. I didmt that pin 2. It would be according to the schematic pin 3. Thank you for your kind comments.

  21. Josef Geiger on March 5th, 2020 3:41 am

    Can I take the 3.3 volts from the Raspberry (pin 1)?
    And are the leds low current?
    Thanks for your help.
    Josef from Austria

  22. BacardE on March 24th, 2020 7:08 pm

    You can take 3.3 volts from the Raspberry pi v3v or pin1. The leds are normal small leds. I would think they would draw < 10ma especially with a 1k resistor in series.. Hope it works for you. Mine has been running my echolink station over 2 years now.

Leave a Reply

  • Older Stuff