Sunday, August 14, 2016

Cheap and easy to build digital modes USB interface for Ham Radio.

The DuinoVOX  Arduino powered digital modes USB interface for ham radio.



   I wanted a better computer to radio interface than what I was using,  straight connection from the computers audio jacks.    Being unemployed for awhile, I couldn't afford $100 to buy a Signalink commercial interface, so I built my own.  Also, I wanted to use an Arduino in a ham radio project.  It came out so well,  that I've decided to publish it here.   If you build it and like it, please let me know.
 Below is the schematic.   I did a youtube video on the project,  watchable at this link.

https://www.youtube.com/watch?v=FHshPd52l-w




Circuit Description:
 
   The USB sound dongle can be purchased on Amazon.com for less than $10.  Search for "USB sound adapter" and you'll find dozens of them.   Look for one with a split plastic case so you can take it apart.  You'll need to tap +5V and ground at the USB connector, the outside pins of the 4 pin connector.
   You can used 1/8" jacks to plug in to it, or desolder the existing jacks and tap audio right off the PCB with thin coax or other shielded cable.
   The audio coming from the USB sound device is low voltage.  1.7 volts P-to-P max volume.  Since the Arduino will only sense positive voltage,  that's 900mv at best.   Depending on the point in time that you sample the signal, you can catch it anywhere from zero on up to .9 V within the waveform.  Not great.
   So,  Q1 is a simple amplifier that takes the input signal up to the full 5V on peaks.
   The amplified signal passes through D1 and charges C4.   D1 prevents the cap from discharging back through the transistor, so you get an accumulated voltage up to around 4.4V DC during a full volume signal.  This gives an excellent range on the input to the Arduino, and allows for sensitivity adjustment to be done in software.
  R6 bleeds the capacitor down when the audio stops.
  Q2 takes the PTT signal from the Arduino and grounds the radios PTT line to key it into transmit.

BUILD NOTES:

C1 and C2,  I used non polarized caps since I had them on hand, but regular electrolytics will work fine.  If you're concerned about isolation, you could use two 600:600 Ohm transformers instead.
C4 is not critical.  If you don't have a .22,  put two .1 in parallel
R7 and R8 don't have to be 10K, can be anything from 10K up, don't have to match either.
C3 can be anything from 1uf up to 10uf

One important tip on using this interface.  On your computer, you'll want to set the playback volume for the interface sound card to maximum,  then use the drive control knob to set the audio level to your rig.  This gives the vox circuit plenty of audio to work with.

The Arduino source code is pasted below.  You should be able to copy paste it right into the Arduino IDE.   If you have trouble,  let me know and I'll email the file to you.   Thanks and 73.

If you build this and love it,  and you'd like to leave me a tip,  my email registered with paypal is loughkb@yahoo.com



/*
   DuinoVOX. Ver.3.1.1  Arduino based PTT control for radio interfaces. 
   Written Aug. 2016 by Kevin Loughin.  Originally for use
   in a clone of the Tigertronics Signalink design idea.
   
 */

//  Naming the pins I'm using for clarity.
const int audioInPin = A1;  // Audio sense
const int tailsetInPin = A3;  // delay time adjustment POT
const int sensitivity = A5; // threshold set POT
const int PTToutPin = 13; // output to keying transistor

//  declaring variables that we'll use
int delayvalue = 0; // amount of time in hundreths of a second before dropping PTT
int threshold = 0; // audio trigger level initial value
int ptt = 0;  // variable for holding current PTT delay countdown
int audio = 0;  // variable that will hold audio sense
int PTT_ON; // Flag to indicate current PTT status

void setup() {
// Turn off PTT right away so we're not keying on startup

pinMode (PTToutPin, OUTPUT);
digitalWrite(PTToutPin, LOW);
PTT_ON = 0; 
}

void loop() 
{
    // Here we go. First read the pots and set variables

delayvalue = analogRead(tailsetInPin) / 5; // yields 0 to 204
delayvalue = delayvalue + 2; // adjusted to no less than 2, 1 after first pass through loop
threshold = analogRead(sensitivity) * .8; // yields 0 to 819
threshold = threshold + 70; // adjusted 70 to 889

    // Check for audio. Set delay if present
audio = analogRead(audioInPin);
if ( audio > threshold ) // if audio in exceeds sesitivity threshold.
{
 ptt = delayvalue; // set ptt to current delay in hundredths of a second
}

// PTT control check
if ( ptt > 0 ) // if PTT is positive (loop is counting down)
{
 if ( PTT_ON == 0 ) // check that we havn't already turned it on
 {
   digitalWrite(PTToutPin, HIGH); // turn on PTT if it's off
   PTT_ON = 1; // so we don't waste time writing on next pass
 }

ptt = ptt - 1; // count down in hundredths of a second
  }
else // the counter reached zero.
{
 if ( PTT_ON == 1 )  // check if we already turned it off
 {
            digitalWrite(PTToutPin, LOW); // turn off PTT
         PTT_ON = 0; // Remeber that we've turned it off
 } 
}
delay(10);  // wait 10ms before looping again.  loop 100 times/second
  
}

16 comments:

  1. Hey, can you post some more specifics on the capacitors you used? I'm a software engineer, not a EE. I've dabbled enough with the EE side to know there are Elecrtolytic caps and ceramic caps and a bunch of other options. I have a large stockpile of ceramic caps, but no electrolytic caps of the right value.
    Many thanks, KC1BOS

    ReplyDelete
    Replies
    1. Well most of them are not too critical. C3 can really be anything from 1uf up to 10uf. C1 and C2 the same, they just have to pass audio. You can probably salvage some from any old dead piece of electronics.
      If your ceramics have any labeled .22, that would be fine for C4. You could also put two .1's in parallel and that would work.
      C5 is there to filter any RF that might leak in through the PTT line, you probably have a .001 in your pile.

      Delete
  2. I am really looking forward to trying this project. This will be my first attempt at anything like this. I should be able to source most of the components from my garage ;-) Thank you.

    ReplyDelete
  3. I just finished building and testing the 'DuinoVOX today. I have to admit I was hesitant to begin with. I have built a couple other microcontroller based TNC's without much success (i could get them to transmit but getting reliable packet rx decoding was not so reliable). But the 'DuinoVOX just works! After a minimal setup process and tweaking the delay and sensitivity values, I'm happy to say it's working great. I didn't have enough pots laying around to have adjustment knobs for sensitivity and delay so I omitted them and hard coded the values in after a little bit of experimentation to find what worked best for me. I mainly plan to use it for AX.25 VHF 1200 baud packet at the moment, but I can always reprogram it if I need to change something. Thanks so much for sharing your design; it's great!
    73,
    de KM4MLS
    Brian from GA

    ReplyDelete
  4. Hi Kevin, In search of an diy project I googled your blog. Very interesting to read and see! In the near future I will build the DuinoVOX to enter the domain of digital signals again. Thanks for your hard- and software ideas.
    73's, Pep, de PA2PEP

    ReplyDelete
  5. Hi, Thanks for the link. got it and will start soon I got all the components. Best rds, Emil

    ReplyDelete
  6. I am new to electronics so I ask this question as a newbie. What is the purpose of the capacitors on the audio in and audio out? I thought capacitors blocked AC and would prevent the audio from passing? Also I am having a difficult time finding NPO capacitors that in the range you specified on another post.

    ReplyDelete
    Replies
    1. They allow the AC audio signal through and block the DC components of the signal.

      Delete
  7. Hey, can you post some more specifics on the capacitors you used? I'm a software engineer, not a EE.
    thanks you for sharing
    gclub casino
    gclub
    golden slot mobile
    gclub Casino online

    ReplyDelete
  8. I wanted a better computer to radio interface than what I was using, straight connection from the computers audio jacks. Being unemployed for ...
    สูตรบาคาร่า

    ReplyDelete
  9. Hi Kevin, would 10v caps be suitable or do I need a specific value? Can you postme arduino code please. Love the idea of this as a home build, thank you so much.

    ReplyDelete
  10. Interesting project which I will probably build just for the fun of it. I notice your very nice labels on the unit you feature, How did you do them? Thanks, PJH, N7PXY

    ReplyDelete
  11. Hi Dear,

    i Like Your Blog Very Much..I see Daily Your Blog ,is A Very Useful For me.

    Buy cheap computer & laptopaccessories online. We have the best cheap computer accessories with the best quality at cheapjim.com.

    Visit Now - https://cheapjim.com/1272-computer-accessories

    Cheap Computer Accessories

    ReplyDelete
  12. Hi Kevin - Thanks for the post and video.

    I've built and debugged the basics of the PTT circuit, which looks OK (once I ironed out my own mistakes). However, I have two questions:
    1. do you connect the radio ground (from either the mic jack or accy port) to the circuit ground, or try to keep those separate?
    2. Do you have any tips for testing the audio in/out functions, i.e. should the levels be the same coming from/to another audio device?

    ReplyDelete
  13. Can you modify this for FSK to key the radio?

    ReplyDelete