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 90
SN 22
A 3
K 1 Quiet
X-Ray B1.4
Wind 332.7 km/s
Aurora 2
Updated 06:00 UTC HamQSL · N0NBH
Day 80/40m Fair 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: antenna switch, rotator and CAT on one box

ci_cover.jpg

Many shack automation builds follow the same pattern. An ESP32 or Pi Pico drives a few relays for an antenna switch, reads a rotator potentiometer, and talks CAT to the rig, often with a small LCD or OLED on the front. On the bench it works. Then you key up on 40 m into a not-quite-perfect antenna and the display garbles, the relays chatter, or the controller resets.

This thread is for comparing notes on how to build these controllers so they survive real RF. Here is a starting list, and corrections are welcome.

Logic levels come first. Pico GPIO is 3.3 V and not 5 V tolerant. ESP32 GPIO is also 3.3 V. Rig CAT interfaces vary: some are TTL-level serial, some are true RS-232 (which can swing to roughly +/-5 to 12 V and will damage a bare GPIO), and Icom CI-V is a single-wire shared bus. Check your rig's manual for the actual electrical interface, and use a proper level shifter or a MAX3232-type transceiver where needed. For CI-V, a transistor or a small open-collector arrangement on the bus line is the usual approach, with TX and RX tied together in a way the bus can tolerate.

Relays should get a separate driver stage and a proper flyback path. A ULN2003 or discrete MOSFETs with a diode across each coil is fine. Power the coils from their own supply rail and decouple it well, because relay switching noise on the same rail as an ADC reference makes rotator readings jumpy. Also decide what state the relays take at power-up. GPIOs on many microcontrollers float or briefly take odd states during reset, so add pull-down resistors on the driver inputs. On the ESP32, be careful with strapping pins such as GPIO0, 2, 12 and 15, since external circuitry on those can change boot behavior.

For antenna switching, add an interlock so the controller never hot-switches under power. If the rig supports it, use the PTT or TX-inhibit line so the controller only changes relays while the rig is in receive. Even a simple rule helps: refuse a switch command while PTT is active, and wait a few milliseconds after the line drops before moving the relays. Latching relays save power and keep the last state through a reset, but then the firmware has to know what that state actually is.

Rotator position sensing is where noise shows up most. The ESP32's internal ADC is not very linear and picks up noise, so an external I2C ADC like an ADS1115 is a common upgrade. Whichever ADC you use, average several samples, put an RC filter on the pot wiper, and add a deadband in software so the controller doesn't hunt around the target bearing. Treat limit handling and a motion timeout as safety features: if the bearing hasn't changed within some time while the motor is driven, stop the motor and flag a fault.

On the RF side, the usual fixes still apply. Put the board in a metal enclosure bonded to station ground, bypass every line that leaves the box with small capacitors, and use ferrite chokes or a few turns through a core on USB, serial, relay and sensor cables. A common-mode choke on the USB lead to the PC or Pi is cheap. Keep controller cables physically away from the feedline and from the antenna-end of the run where possible. Run a watchdog timer so a lockup recovers on its own, but make sure the recovery state is safe: motors off, TX inhibited, antenna switch in a known position.

One related note for anyone adding a Si5351 for a signal source or VFO: its output is a square wave with harmonics, so a low-pass filter is needed before it goes anywhere near an antenna or receiver. Keep its I2C wiring short too.

Where does your setup misbehave under RF, and what fixed it? Particularly interested in whether people prefer one board that does everything or separate small controllers for each function.

  • Replies 2
  • Views 11
  • Created
  • Last Reply

Top Posters In This Topic

Featured Replies

  • Moderators

On the one-box versus several-boxes question, separate small controllers have some practical advantages. A rotator controller that fails shouldn't take your antenna switch with it. Failures also stay easier to diagnose. If they share a network, a simple protocol such as MQTT or HTTP lets a Pi aggregate them, and each node can still work standalone from its own buttons.

For rig control, it helps to let one program own the serial port. On a Raspberry Pi that is often Hamlib's rigctld, with logging, digital-mode software and your own scripts all talking to it over TCP rather than fighting for the port. Then the ESP32 doesn't need to speak CAT at all unless you want a front-panel band display. It can ask the Pi for frequency and select the antenna accordingly.

On relay interlocks, I'd also keep a hardware path where possible. If the PTT line physically gates the relay supply or a driver enable, a firmware bug can't hot-switch the coax relay.

  • Moderators

One thing to add on the ESP32: Wi-Fi transmit bursts cause brief current spikes, and with a marginal 3.3 V regulator or weak decoupling that can look like an RF problem when it isn't. Before you blame the transmitter, check whether the glitches also happen with the rig off and Wi-Fi active. Reproducing the fault with and without RF tells you which fix to chase, a bulk capacitor or better regulator versus ferrites and shielding.

For the Pico, the I2C and SPI lines to displays are common RF pickup points, especially with long ribbon cables to an LCD on the front panel. Keep them short, add series resistors of around 22 to 100 ohms on the lines that tolerate it, and consider a slower bus speed. Backlight and contrast circuits on cheap LCD modules can also be noisy, so a separate filtered supply to the display is worth trying.

For Direwolf or APRS projects on a Pi, the same grounding problem appears on the audio side. Audio interface ground loops and RF on the cable show up as decode errors. An isolation transformer on the audio lines and a ferrite on the USB sound card cable help before you start changing software settings.

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.