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

Pico or ESP32 for a shack automation hub? Keeping CAT, relays and rotator control stable around RF

ci_cover.jpg

I'm planning a small shack controller and want to sort out the architecture before I build anything. The wish list is CAT polling and logging, a remote antenna switch with 4 to 6 ports, a rotator controller using the existing potentiometer feedback, an SWR/power readout, and a Direwolf APRS box on a Pi that shares some of this data. I'd rather not build one monolithic board that needs reflashing every time I change one function.

My current thinking is a Raspberry Pi running Hamlib's rigctld and Direwolf, with one or two microcontrollers as dumb, reliable I/O nodes. That could be a Pico for relays and ADC, and maybe an ESP32 where Wi-Fi is useful. The Pi would talk to the nodes over USB serial or MQTT, and logging software would talk to rigctld over TCP, which listens on port 4532 by default.

These are the points I want to check:

First, logic levels. The Pico and the ESP32 are both 3.3 V devices and their GPIOs aren't 5 V tolerant. Some radios give TTL-level serial and some give RS-232 levels, and Icom's CI-V is a single-wire open-collector bus. So I'm treating each radio's CAT interface as its own level-shifting problem and checking the manual before wiring anything.

Second, RF getting into the electronics. Relay drivers, ribbon cables and the I2C bus to an LCD or a Si5351 can all pick up RF on HF at higher power. I'm planning a metal enclosure, ferrites on the cables, small bypass capacitors at connectors, flyback diodes on every relay coil, and a separate supply or at least a filtered branch for the 12 V relay rail.

Third, measurement. For the SWR meter I'd use a directional coupler with detector diodes and read forward and reflected voltage on the ADC. The Pico's ADC is 12-bit but noisy, and the ESP32's ADC is known to be nonlinear unless calibrated. Diode detectors are also nonlinear at low power. I expect to need a calibration table made with a dummy load and a known-good meter rather than relying on the formula alone.

Does this split sound sensible, or is it overkill? Where would you draw the line between what lives on the Pi and what lives on the microcontrollers?

  • Replies 2
  • Views 12
  • Created
  • Last Reply

Top Posters In This Topic

Featured Replies

  • Moderators

The split makes sense, and I'd push it a bit further: let the microcontrollers own anything with a safety or timing consequence, and let the Pi own anything that is convenience. The antenna switch is the obvious case. If the Pi is rebooting or SSH is hung, the switch node should hold its last state or fall back to a safe default, such as a dummy load or a known antenna. It should never float to some random relay combination at power-up. Make sure the GPIO pins that drive the relay drivers have defined pull-down or pull-up resistors, because pins are in an undefined state during boot.

On the SWR meter, remember that the reflection coefficient is Vr/Vf only if your detectors are reading voltage linearly. Diode detectors don't do that at low levels, so calibrate at several power levels. SWR is then (1+ρ)/(1−ρ). Also add a transmit-detect condition so the display ignores readings below a threshold. Otherwise noise on an idle band can produce a nonsense SWR figure. Finally, if you read the ADC during transmit, add some averaging and a small RC filter at the pin, but keep the time constant short enough to follow CW and SSB peaks if you want a useful peak reading.

  • Moderators

One thing to look at before choosing the ESP32 for the rotator or the switch is how you will use Wi-Fi. On the ESP32, ADC2 can't be used while Wi-Fi is active, so put analog inputs such as the rotator pot feedback on ADC1 pins. For the rotator, also design for the wrap-around region. Most pot-based rotators have a dead spot or an overlap near the end of travel, so the firmware needs a clear policy for what "north" means near the stops, plus a timeout that cuts the motor relay if the reading doesn't change after a command. That protects against a failed pot or a jammed rotator more than any amount of clever PID would.

For the Pi side, Direwolf is a good fit and you can expose KISS over TCP (port 8001 by default) or AGW (8000) to client software. Keep its audio path separate from your control wiring, though. If you share a USB hub or a ground between the sound interface, the rig and the microcontrollers, a ground loop can show up as hum or noise in the audio. An isolated USB audio interface or transformer coupling on the audio lines is usually cheaper than chasing the noise later.

If you add a Si5351 later for a VFO, beacon or test signal, remember its outputs are square waves. They need a low-pass filter before they go anywhere near an antenna or a receiver, and the I2C wires should be kept short and away from the PA.

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.