Automating an external Antenna switch from smartsdr

  • 2
  • Question
  • Updated 2 years ago
Has anyone written an API to control an external antenna switch from smart SDR. It really would just need to switch a set of relays based on the radio frequency. The relays could then control the antenna switch.

much thanks

Photo of Steven Catani

Steven Catani

  • 23 Posts
  • 1 Reply Like

Posted 2 years ago

  • 2
Photo of Mark - WS7M

Mark - WS7M

  • 913 Posts
  • 317 Reply Likes
Hi Steve,

Yes I took an Ameritron HL4 I think is the number and modified the circuit board inside to make the fourth position an "automatic" position.  This means I only get 3 usable antennas out of the 4 but I was never going to have 4 anyway.

I then ran wires out of the box to a relay board I designed.  I wrote simple software to query the radio and make changes to both an amplifier I have and the antenna switch.

The modifications to the HL4 were very simple. Cut 1 trace, solder in some wires to go out to the relays.

For any switch that had RS-232 or other input the modification would be nil and just need software to read the radio frequency and send out the appropriate commands.

Mark = WS7M

Photo of Steven Catani

Steven Catani

  • 23 Posts
  • 1 Reply Like
Can you share the code for your program

much thanks,

Photo of Steve - KD8QWT

Steve - KD8QWT

  • 74 Posts
  • 14 Reply Likes
Unfortunately there is nothing in SSDR to allow for a custom UI component that could be used for an external antenna switch. 

I see 2 options.  You could write a simple PC application like Mark did to control the antenna switch.  The other option is to use an Arduino with an ethernet shield to control the relays.  Then use Enzo's libraries to write some custom logic to follow the Flex via the API and switch antennas based on the frequency of the slice that has TX enabled.

I saw this on your QRZ page.

"Currently there is a multi-wire dipole for 30, 20 and 15 meters that points ew, a dipole for 15-20 facing ns, a 40 meter cage, a 40 meter caged loop, and a multiwire dipole for 80m. There is also a 2m vertical dipole."

Since you have multiple antennas in the same band, it will be difficult to determine which antenna to use on say 20m using only one antenna port on the Flex.  You'd have to use both ports on the Flex wired to a switcher with 2 inputs and 2 sets of relays.  Wire the "30, 20, and 15" and 40m loop to one input of the switch and the rest to the other input.  Essentially it would be two separate switches.  Then have the Arduino watching for which slice has TX enabled and grab it's frequency.  Based on the frequency, switch both sides of the switch to antennas that can handle that frequency.  In SSDR you can then switch between the to two 20m dipoles for example by switching between the 2 ports on the Flex. 

73'  Steve
Photo of Dave - WB5NHL

Dave - WB5NHL

  • 261 Posts
  • 59 Reply Likes
Steve, checkout Enzo's Arduino libraries for Flex Radio. They work VERY well. It would be very easy to write a simple Arduino sketch to read freq/band and control antenna relays. Also, Enzo is very accessible and halpful via email.
Photo of K2CM


  • 265 Posts
  • 18 Reply Likes
I have an Arduino with an internet shield, controlling relays in a switchbox. It has a timeout feature to disconnect from the radio after 20 minutes with no PTT in the prior 20 minutes. You can switch as many antennae as you wish.
Photo of William Hein

William Hein

  • 93 Posts
  • 10 Reply Likes
The 4O3A Antenna Genius 8x2 antenna matrix has TCP/IP and FlexRadio API support built-in. Disclosure - I work for the US importer Force 12.
Photo of Steve K9ZW

Steve K9ZW, Elmer

  • 1198 Posts
  • 629 Reply Likes
Eagerly anticipating the upcoming USA deliveries of the 4o3a Antenna Genius 8x2 Switches, as planning initially one each at my two station QTHs.

Bill was kind enough to forward an advance copy of the manual which I've just printed out to review.

Had a 4o3a Station Genius SSC XL integration device setting next my desk, which I've held off implementing with the major v2.0 firmware due shortly.


Steve K9ZW
Photo of Phil m0vse

Phil m0vse

  • 204 Posts
  • 38 Reply Likes
If you are already running DDUtil then you could get one of these relay boards DDUtil can be configured to switch these relays on an almost infinite number of situations.
Photo of pa0bie


  • 152 Posts
  • 20 Reply Likes
The simplest solution is with a USB-8 relay card under DDUtil. I have made a LPT to 16 relay card interface wich also control to wich PA the PTT command is going.
Photo of Marc Lalonde

Marc Lalonde

  • 308 Posts
  • 80 Reply Likes
Hi   not the by API but Telnet to radio and GUI by webpage , was easy to mod to HF if need

i work this week on a updated 2.0 version