Skip to content
View in the app

A better way to browse. Learn more.

Ham Radio Base

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Ham Radio Base — Education, Resources, Projects and Community
☀ Solar
SFI 99
SN 26
A 6
K 0 Quiet
X-Ray B2.3
Wind 384.8 km/s
Aurora 1
Updated 13:30 UTC HamQSL · N0NBH
Day 80/40m Good 30/20m Good 17/15m Fair 12/10m Poor
Night 80/40m Good 30/20m Good 17/15m Fair 12/10m Poor

Callsign Lookup
_
Vanity Call Signs Available
Enter filters above and click Search.
ⓘ Callsign lookups are in real time via the FCC database. Vanity callsign availability is refreshed daily at 6:00 AM CST. The vanity search may be unavailable for a few minutes during this update.
Live DX spots
Live DX Spots — 70cm via PSKReporter · scroll or pinch to zoom
Band
Mode
Time
Loading map data…
MHz DX Spotter Info
Recent spots —
Select a band above to load spots
Ready — select a band to fetch live spots

Keeping RF out of ESP32 and Pico shack controllers: CAT, PTT, antenna switch and rotator interfaces

ci_cover.jpg

I'd like to compare notes on a design problem that comes up in almost every shack automation build. The code works fine on the bench, then the project misbehaves once the rig is on the air. Typical symptoms are a USB serial port that drops mid-transmission, a rotator reading that jumps, a relay that chatters, or a microcontroller that resets on SSB peaks but not on FT8 at low power.

Take a simple system. An ESP32 or Pi Pico switches a 4-way antenna relay box, reads rotator position from a potentiometer, and talks to the rig by CAT. A Raspberry Pi runs Hamlib's rigctld so logging software can reach the radio over TCP, usually port 4532. Even this basic setup has several weak points.

First is the CAT interface. Rigs differ a lot here. Icom CI-V is a single-wire, open-collector style bus with a configurable address. Many Yaesu radios use TTL-level serial. Some Kenwood models present true RS-232 levels on a DB9, which needs a MAX3232-type converter and must never go straight to a 3.3 V GPIO. Both the ESP32 and the Pico are 3.3 V devices and are not 5 V tolerant, so check the rig's manual for levels before wiring anything. A USB CAT cable is often the easiest route, but it also gives RF a long cable to travel on.

Second is PTT and keying. Driving them straight from a GPIO is tempting, but a transistor or optocoupler stage gives you isolation and protects the pin. Add a small RC filter and keep the wiring short. Most people also want a hardware or software timeout so a crashed controller can't leave the transmitter keyed.

Third is the analog side. The Pico's ADC is 12-bit and noisy unless the supply and reference are well filtered. The ESP32's ADC is nonlinear and needs calibration, and ADC2 can't be used while Wi-Fi is active. For a rotator potentiometer, a 0.1 µF cap at the pin, a series resistor, and software averaging or median filtering make a big difference.

My question for the group is where you draw the line between fixing this with hardware and fixing it in firmware. Is it enough to put ferrites and a metal enclosure around the controller, or do you go further with optical isolation on every external line? And how do you handle fail-safe states, such as what the antenna switch does when the controller resets?

  • Replies 2
  • Views 32
  • Created
  • Last Reply

Top Posters In This Topic

Featured Replies

  • Moderators

I'd treat it as a hardware problem first, because firmware can't fix a processor that's being fed RF. A very common failure path is common-mode current on the USB cable. The coax shield, station ground and cable shield all form loops, and the cable becomes part of the antenna system. Clamp-on ferrites help, but the most effective approach is usually a few turns of the USB cable through a mix 31 or similar HF-suitable core, close to the controller and again near the rig. Put the common-mode choke on the cable, not just a single snap-on bead.

For CAT lines I'd add the usual protection at the connector: a 100 pF to 1 nF capacitor to ground on each signal line and a series resistor of a few hundred ohms where the protocol tolerates it. Don't add capacitance blindly on CI-V, because the bus is open-collector and extra capacitance slows the edges at higher baud rates. If a Pi is running rigctld, keep the Pi and the microcontroller on separate power or filtered supplies. Let them talk over Ethernet or Wi-Fi rather than a long serial run, so the RF-exposed cable is only the short one to the radio.

One more point about rigctld: use the right Hamlib model number for the rig (rigctl -l lists them) and match the serial speed and stop bits to the rig's menu setting. A surprising number of CAT problems turn out to be baud-rate or handshake mismatches rather than RF. Rule those out before reaching for more ferrites.

  • Administrators

On the antenna switch and rotator side, I'd design around what happens when things go wrong. For relays, use a driver such as a ULN2003 or logic-level MOSFETs, with a flyback diode across each coil unless the driver array already includes one. Give the relay supply its own regulator, or at least a bulk capacitor near the coils. A relay pulling current can sag a shared 5 V rail enough to trip the brown-out detector on an ESP32, and that looks exactly like RF-induced resets.

Decide the default state in hardware terms. If the controller loses power, the relays should drop to a known antenna, ideally a safe one such as a dummy load or the antenna you use most. That means using normally-closed contacts, or latching relays with a defined power-up routine, rather than hoping the firmware gets there. Also consider an interlock that reads the PTT line and refuses to switch while the rig is transmitting. Hot-switching a coax relay under power shortens its life and can stress the PA if the SWR spikes mid-switch.

For the rotator, keep the pot reading and the motor drive logically separate. Add soft limits in software so the controller never commands motion past the end stops. A watchdog timer helps too: if no valid position update arrives for a few seconds while the motor is on, stop the motor. A median of several ADC samples, taken at a fixed rate, usually settles the jumpy readings. If the numbers still wander only during transmit, go back to filtering and shielding on the sense wire, because that points to RF pickup rather than ADC noise.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Affiliate Disclosure: As an Amazon Associate, Ham Radio Base earns from qualifying purchases. Some links throughout this website may be affiliate links. If you purchase a product through one of these links, we may earn a commission at no additional cost to you. Your support helps us continue creating free articles, tutorials, reviews, and resources for the amateur radio community. N0TLB © Ham Radio Base - Powered by the Ham CQ DX Community. All rights reserved.

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.