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

Shack automation split: what belongs on the Pi, what on a Pico or ESP32, and how to keep RF out of it

ci_cover.jpg

Let's discuss architecture for a shack automation setup, because many projects in this area go wrong in the same few places. The goal is a Raspberry Pi plus one or more microcontrollers handling CAT rig control, an antenna switch, a rotator controller, an SWR/power readout, and maybe a Direwolf APRS station. The question is which jobs go on which board.

One common split is to let the Pi do the software-heavy work and let microcontrollers do anything that needs hard timing or direct hardware I/O. On the Pi side, Hamlib's rigctld is a convenient CAT broker. It talks to the radio once, then exposes a TCP interface (default port 4532) so logging software, a web page, and a small ESP32 display client can all ask for frequency and mode without fighting over the serial port. Direwolf also fits here. It needs an audio interface, a PTT method (GPIO, a CM108-style USB audio GPIO pin, or serial RTS/DTR), and it exposes KISS over TCP (8001) and AGW (8000) for APRS clients.

On the microcontroller side, a Pico or ESP32 suits things like relay drivers for an antenna switch, a CW keyer, a rotator's pulse or analog interface, and an Si5351 VFO or signal source. These benefit from simple, predictable firmware rather than a full OS that can hang or corrupt an SD card.

Here are some specific points I'd like to compare notes on:

1. Logic levels and CAT interfaces. The Pico and ESP32 are 3.3 V devices and their GPIOs are not 5 V tolerant. Many rigs and accessory ports use different signalling. Icom CI-V is a single-wire, open-collector style bus with addressed devices. Kenwood-style CAT uses ASCII commands terminated with a semicolon, such as FA; to query VFO A. Some Yaesu rigs use TTL-level serial on a mini-DIN, and others present USB serial. Check the radio's manual for the actual electrical levels before wiring a board straight to the port. A transistor or proper level shifter is cheap insurance, and a MAX3232-type chip is the usual fix if a port is genuinely RS-232.

2. RF getting into the controller. High-impedance inputs, I2C lines, and long USB or serial cables make excellent antennas. Typical symptoms are an LCD that shows garbage during transmit, a keyer that sends random dits, or an ADC reading that jumps with power level. Standard measures include a metal enclosure bonded to the station ground, ferrite chokes on every cable leaving the box, bypass capacitors close to the module's supply pins, short I2C runs with sensible pull-ups, and series resistors on lines going off-board. Ferrite choice matters: mix 31 is common for HF common-mode chokes, and a few turns through the core beat one pass.

3. Antenna switch safety. Software shouldn't be the only thing standing between your transmitter and an open or wrong antenna port. Decide what the switch does at power-up and on a firmware crash, for example defaulting to a known-good antenna or grounding unused ports. Add a PTT-sense interlock so the controller refuses to change relays while transmitting. Don't forget flyback diodes on relay coils and separate supply decoupling so relay current doesn't brown out the microcontroller.

4. SWR and power metering. A bridge or directional coupler followed by diode detectors is simple, but diodes are nonlinear at low levels and need calibration across the power range. A log detector such as an AD8307 gives wider dynamic range. Remember SWR is derived from reflection coefficient: ρ = √(Pr/Pf), and SWR = (1+ρ)/(1−ρ). On SSB the reading follows voice peaks, so sample quickly and hold the peak or just meter on a carrier.

5. Si5351 as a source. It's I2C at address 0x60 and its outputs are square waves, so a low-pass filter is needed for any transmit use. Calibrating the correction against the reference crystal (25 or 27 MHz, depending on the module) is worthwhile because frequency error scales with the output frequency.

What split of Pi versus microcontroller have you found most robust, and where do you draw the line on putting safety logic in firmware versus hardware?

  • Replies 2
  • Views 19
  • Created
  • Last Reply

Top Posters In This Topic

Featured Replies

  • Administrators

I'd lean toward keeping anything safety-related in hardware where you can. A relay antenna switch can have a simple hardware rule: if the PTT line is active, the relay drivers are blocked, regardless of what the firmware asks for. A diode and a transistor, or a small logic gate, can do that and it doesn't care if the Pico locks up.

Pico versus ESP32 mostly comes down to whether you need Wi-Fi. The Pico's PIO is useful for odd timing jobs, like generating clean keying waveforms or reading a pulse-based rotator feedback. The ESP32 is attractive for a web UI, but its Wi-Fi radio makes supply decoupling and layout matter more, especially if the same board also reads a sensitive ADC for forward and reflected power. If it only needs to serve a status page, it can live in a separate box with a network link and be kept away from the metering electronics.

On the ADC point, the ESP32's built-in ADC is known to be nonlinear and noisy, so for SWR work I'd use an external ADC like an ADS1115 over a short I2C run, or at least average a lot of samples and calibrate against a known dummy load and power meter.

  • Administrators

The rigctld approach is worth stressing, because it avoids the most annoying shack problem, which is several programs wanting the same serial port. Let the Pi own the radio connection and have everything else be a network client. A small display or band-decoder microcontroller can poll the frequency with a basic TCP request instead of speaking CAT itself, which also removes level-shifting and the RF-on-serial-line issue from that device.

For the band decoder, a Pi reading frequency and then driving an antenna switch over a few opto-isolated GPIO lines or a relay board is reasonable. Isolation does help if the switch is near the transmit antenna feedline. Just make sure the relay board's supply is sensible, because cheap boards sometimes have drivers that behave oddly at 3.3 V logic.

For the Direwolf side, watch audio levels first. Direwolf reports the audio level it sees, and an overdriven input hurts decoding as much as a weak one. For a tracker you'd pick a different path: a Pico or ESP32 with a GPS and an AFSK modulator or a dedicated module, with a low-pass filter on the output and firmware that obeys local beaconing etiquette and rate limits. Running a full Pi plus Direwolf in a battery-powered tracker is possible, but power draw and boot time usually argue for a microcontroller unless you need receive decoding too.

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.