Antenna switch controller with OTRSP

From M0AGX projects
(Redirected from OTRSP Antenna Switch)
Jump to navigation Jump to search


The kit consists of controller PCB and two end panels. Enclosure, cables and relay board are not included.

Kit overview

What else is needed?

Besides the kit, to build a working system you will also need:

  • Enclosure
  • Coax relay board
  • Cables depending on your installation
  • Power supply

How does it look assembled?

Here are examples of the back and front (in a different, plastic enclosure).

Back panel

Front in plastic enclosure


The kit fits a standard aluminium enclosure from Aliexpress (you can also search Aliexpress for "38*88*110mm").



  • Switching up to 7 relays (switches the negative terminal, coils must have a positive common, relay supply is protected by a polymer fuse)
  • PC control over USB (OTRSP, command line, GUI)
  • Manual control from the front panel
  • Band input
    • Icom (band voltage)
    • Icom (CI-V, not fully tested)
    • Yaesu (4-bit output)
    • Yaesu FT-817/857/897 (BAND DATA output)
  • PTT interlock (prevents switching while transmitting)
  • Python GUI application for manual control from the PC


Schematic is available here [1]

Front panel

The front panel has a single digit display and 3 buttons. The buttons are left, right and auto. Pressing left/right buttons changes the antenna. Pressing the auto button enables automatic mode (ie. band is taken from the transceiver, if configured).

In auto mode the decimal dot stays on. During transmit (if the PTT signal is wired to the transceiver) the decimal dot blinks.

Basic setup

The device USB connection looks like a regular serial (COM) port. On Windows you may need to install the serial port driver.

A terminal application is needed to configure the device. I recommend ExtraPuTTY on Windows and picocom on Linux & Mac. Serial connection speed does not matter.

After opening the port type


(the letters will not be displayed) and press enter. A message similar to the one below should be displayed: antenna switch 0.3

Available commands:
ant      - Select antenna manually (argument: antenna number 1-8)
auto     - Select antenna automatically (requires TRX to be set)
boot     - Enter bootloader to update firmware
defaults - Reset all settings to defaults and reboot
debugciv - Print CI-V data
echo     - Set terminal echo
get      - Print all settings
help     - Print help
inputs   - Show transceiver band inputs and voltages
restart  - Restarts the device
save     - Save settings to flash
set      - Set a setting eg. set <parameter> <value>

Available settings:
BAND160  - Antenna for 160m band  (min 1, max 8)
BAND80   - Antenna for 80m band   (min 1, max 8)
BAND60   - Antenna for 60m band   (min 1, max 8)
BAND40   - Antenna for 40m band   (min 1, max 8)
BAND30   - Antenna for 30m band   (min 1, max 8)
BAND20   - Antenna for 20m band   (min 1, max 8)
BAND17   - Antenna for 17m band   (min 1, max 8)
BAND15   - Antenna for 15m band   (min 1, max 8)
BAND12   - Antenna for 12m band   (min 1, max 8)
BAND10   - Antenna for 10m band   (min 1, max 8)
BAND6    - Antenna for 6m band    (min 1, max 8)
BRIGHT   - LED brightness         (min 0, max 2)
CIVBAUD  - Icom CI-V baud         (min 0, max 65535)
ECHO     - Terminal echo (set to 0 for OTRSP) (0/1)
TRX      - Transceiver type (0 - none, 1 - Yaesu, 2 - Icom BAND, 3 - Icom CI-V) (min 0, max 3)
VDIVBAND - Divider value for Icom band voltage input x100 (min 0, max 65535)
VDIVSUP  - Divider value for input supply voltage input x100 (min 0, max 65535)

Terminal echo

By default you will not see the letters that you type in the terminal. This is commonly called an echo. To make configuration easier and see the letters you can issue:

echo 1

This will take effect only until the next power cycle. OTRSP applications can fail when the echo is turned on so use it only during configuration.


Setting an antenna manually

To manually set the antenna to 2 type

ant 2

and press enter. The device will respond with

OK Antenna 2 selected, mode manual

This can be useful to check the relays.

Changing and saving settings


  • antenna 1 supports 80 meters and 40 meters
  • antenna 2 supports 20 meters

To configure such a scenario type the following:

set band80 1
set band40 1
set band20 2

Transceiver connection

Back panel

Transceiver can be connected to the TRX 8p8c ("RJ-45") socket at the back. On the transceiver side the socket is often called "accessory" or "ACC".

Common connections

  • 12V - connect if you want to power the antenna switch from the transceiver. This will make the antenna switch turn on and off when the transceiver is turned on and off.
  • GND - common ground always needed
  • PTT - grounding this signal prevents antenna switching. Icom manuals name this signal SEND. Switching relays with RF applied will lead to arcing and damage the contacts, so it is inhibited by the antenna switch (dot on the LED display blinks when this signal is low). This connection is not strictly necessary, but highly recommended.


There are two ways to get band information from Icom transceivers. Band voltage is the simpler one and is more limited. Not all bands can be detected using this method.

Band voltage

Simply connect ICOM BAND signal of the switch to the BAND signal of the transceiver. No special configuration of the transceiver is needed. Configure the antenna switch:

set trx 2

You can check the wiring and voltages by issuing the following command:


The reported Icom voltage should change when changing the bands. See: [2].


Requires firmware 0.3 or later. CI-V is a more advanced connection. It can work in concert with a separate USB to CI-V interface (all devices are connected to the same wire). On Icom transceivers it is usually labeled as REMOTE. Connect this signal to the B4 (CI-V) pin of the antenna switch.

The following settings have to be set in the transceiver:

  • CI-V Baud Rate - for example 9600 or 19200
  • CI-V Transceive - ON

Antenna switch configuration:

set trx 3
set civbaud 9600

Baud value has to be the same as in the transceiver.

To verify wiring or assist in debugging you can use the following command:


This will print out CI-V traffic. If something does not work as expected you can e-mail me logs from the terminal. To disable this output (it will interfere with regular OTRSP) issue:




Firmware update

New firmware can be downloaded here [3]

Starting the bootloader

Bootloader is a piece of firmware that is always present in the device and is responsible for receiving new application firmware. It can be started in two ways:

  • Press and hold the left button and apply power
  • Type boot in the serial terminal

A lowercase "u" on the display indicates that the bootloader is running and expecting new firmware. There is a 3 minute timeout so if you type "boot" accidentally the device will reset itself and start regular firmware (especially useful when operating fully remotely).

Linux and Mac

Install the lrzsz package (depends on your distro). After starting the bootloader execute in a terminal:

sx firmware_filename.bin > /dev/ttyACM0 < /dev/ttyACM0

This assumes that the device enumerated as /dev/ttyACM0.


Any terminal application with Xmodem can do the job. I recommend ExtraPuTTY After starting the bootloader pick:

  1. File transfer
  2. Xmodem
  3. Send

Pick the file and wait for the update. An error message about lost connection after the upload is normal.

Extra relay function

One output can be optionally configured to act independently from the others used for antenna relay control. This is called the "extra relay". This feature requires firmware 0.14 or later.


To use output "ANT6" as the extra relay execute the following in the terminal:

set extra_rly 6

Adding a button

Extra relay can be switched on and off via an extra switch wired to X6. Touch the USB connector body before soldering to avoid ESD. This header is wired directly to the MCU and is susceptible to ESD.

Button wiring