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 shack automation: ESP32/Pico nodes, CAT, antenna switches and SWR sensing

ci_cover.jpg

I'd like to compare notes on a design problem that comes up in a lot of ham microcontroller projects: you build a nice automation node on an ESP32 or Pi Pico, it works on the bench, and then it misbehaves once the rig is on the air. The node might handle an antenna switch, a SWR/power readout, band data from the radio, and maybe a rotator interface. Here is how I'd divide the problem, and I'd like to hear where others draw the lines.

First, the logic levels. Both the ESP32 and the RP2040 on the Pico are 3.3 V devices, and their GPIOs are not 5 V tolerant. Many rigs and accessories use 5 V TTL serial or open-collector buses, and older radios may use true RS-232 levels, which can damage a bare GPIO. For Icom CI-V, which is a single-wire bus, check the radio's actual voltage and use a proper open-collector interface instead of tying the pin straight to a GPIO. For RS-232 you need a MAX3232-style transceiver. For modern rigs with USB, it is often simplest to let a Raspberry Pi or PC talk to the radio over USB and expose it to the rest of the shack with Hamlib's rigctld, which listens on TCP port 4532 by default. The microcontroller then does the hardware work and the Pi does the protocol work.

Second, relays and antenna switches. Put a flyback diode across every relay coil, use a transistor or driver array instead of pulling coil current from a GPIO, and consider optocouplers or at least a separate supply if the switch is far away. Run the control lines as a multi-conductor cable with a ferrite choke at each end, and add a small RC or bypass capacitor (for example 100 nF with a 10 nF in parallel) near the connector. If the switch sits at the antenna, remember that coax feedline common-mode current can end up on your control cable, so a choke on the coax and the control cable is worth considering.

Third, SWR and power sensing. A directional coupler feeding a log detector such as an AD8307, or a diode detector with calibration, gives you forward and reflected voltages that an ADC can read. The weak points are usually not the maths but the layout: RF pickup on the ADC input, noisy reference voltage, and cheap ADC linearity. Filter the analog lines, average several samples, and only calculate SWR when forward power is above a minimum threshold. Otherwise noise produces meaningless numbers at idle. Calibrate against a known dummy load and a few known mismatches rather than trusting the datasheet curve.

Fourth, signal generation and decoding. If you use an Si5351 as a VFO or beacon source, its outputs are square waves rich in harmonics, so plan on a low-pass filter for the band you operate on before it goes anywhere near an antenna. For packet or APRS work with Direwolf on a Pi, the usual chain is soundcard audio in and out, plus a PTT method, either a GPIO line or a CM108-style USB audio adapter with a GPIO pin. Isolate audio with a 1:1 transformer where you can, because ground loops between the Pi supply, the radio and the PC show up as hum or decode errors.

The question I'd like input on: when you split a build between a microcontroller and a Pi, where do you put the boundary? I lean toward microcontrollers for anything timing-critical or safety-related (relay sequencing, PTT timeouts, rotator limit handling) and the Pi for logging, Hamlib, and network access. Does that match what you do, and what has worked best for keeping RF out of the digital side?

  • Replies 2
  • Views 37
  • Created
  • Last Reply

Top Posters In This Topic

Featured Replies

  • Administrators

That split makes sense to me, with one addition: give the microcontroller a watchdog and a safe default state. If the Pi crashes or the network drops, the node should drop PTT, return the antenna switch to a known position, and stop the rotator. A hardware PTT timeout is cheap insurance, whether it's the watchdog timer on the Pico or ESP32 or the transmit time-out timer in the radio.

On rotators, if the controller uses a potentiometer for position feedback, ADC noise can make the reading jump around. Averaging and a small deadband help a lot. It's also worth speaking a common protocol like the Yaesu GS-232 command set, because then rotctld (Hamlib uses port 4533 by default) and most logging or satellite tracking software can drive it without custom code.

  • Moderators

I'd emphasize the power supply as much as the cables. A cheap switching wall adapter can inject noise that gets blamed on the Pico or the sensor board. Try powering the node from a linear regulator or a well-filtered 12 V source, add bulk capacitance plus ceramic decoupling at each board, and keep the Si5351 and any RF detector on a quiet, locally filtered rail.

For the ESP32 specifically, Wi-Fi transmit bursts cause current spikes that can disturb nearby analog circuitry. If the SWR readout is jumpy, test with Wi-Fi off, or move the ADC job to an external converter such as an ADS1115 over I2C, and keep that I2C run short. If the sensor is at the antenna tuner, think about sending digital data over a shielded cable rather than a long analog line.

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.