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: Pi for Hamlib and Direwolf, Pico or ESP32 for the hardware edge?

ci_cover.jpg

I'm sketching a shack automation layout and want to sanity-check the division of labour before ordering parts. The idea is a Raspberry Pi as the "brain" running Hamlib's rigctld and rotctld, plus Direwolf for an APRS digipeater/iGate or packet node. Small microcontrollers (Pi Pico or ESP32) would handle the real-time and electrically messy jobs: antenna switch relays, rotator position and drive, an SWR/power monitor, and maybe a CW keyer.

Here is the logic behind the split. Linux is good at networking, logging and CAT arbitration. Hamlib's rigctld listens on TCP 4532 by default, so logging software, a digital-mode program and a band-decoder script can all share one serial connection to the rig instead of fighting over the port. Linux is bad at hard timing, though. A CW keyer needs consistent dit and dah lengths (a dit is about 1200/WPM milliseconds), and a relay sequencer must never glitch during boot. Those belong on a microcontroller that powers up in a known state.

Questions I'd like opinions on:

1. Pico or ESP32 for the edge nodes? The Pico seems simpler and deterministic, but Wi-Fi on an ESP32 is tempting for remote rotator and switch boxes. Is a 2.4 GHz radio and its switching noise next to HF receive wiring worth the risk?

2. For the antenna switch, what is the safest control logic? I'm thinking a default state with all ports grounded or on a dummy load, flyback diodes on every relay coil, a ULN2003 or MOSFET driver stage, and a hardware inhibit tied to PTT so the relays never hot-switch.

3. For a homemade SWR meter, is a diode-based directional coupler good enough, or should I use something like an AD8307 log detector on both forward and reflected ports? With a log detector I can get return loss as the difference in dB, convert it to reflection coefficient Γ = 10^(-RL/20), then SWR = (1+Γ)/(1−Γ).

Everything on the microcontroller side is 3.3 V logic, while the rig-side interfaces are a mix of 5 V TTL, open-collector CI-V, and who-knows-what on older gear. I'd rather get the interface rules straight now than discover them with a dead GPIO.

  • Replies 2
  • Views 10
  • Created
  • Last Reply

Top Posters In This Topic

Featured Replies

  • Moderators

Your split makes sense. I'd stay conservative on the electrical side, because that's where most of these projects get hurt.

On Pico versus ESP32: both are 3.3 V parts and neither GPIO is 5 V tolerant, so treat every external signal as hostile until it's level-shifted or isolated. For anything that touches the rig keying line, use a transistor or optocoupler stage rather than a GPIO. Some older rigs have surprisingly high voltages on the key jack, and grid-block keying on tube gear is a classic example. Check with a meter first.

If you want Wi-Fi, an ESP32 can work. But I'd put the radio-facing nodes on a wired link (serial, RS-485 or Ethernet) back to the Pi, and keep the Wi-Fi nodes for things like temperature, voltage and door sensors. Wi-Fi is also a dependency you don't want in a station's safety path. A Pico running one simple, well-defined serial protocol is easy to debug, and it still works when the router is down.

On the SWR meter, a log detector will cover a wide dynamic range, but accuracy depends on the coupler. A coupler with poor directivity can't resolve a low SWR properly, however good the detector is. Calibrate against a dummy load and a known mismatch, and treat the readout as a monitoring tool rather than lab equipment. Average the ADC readings in firmware, since RF pickup will make single samples jumpy.

  • Moderators

A few practical points on the Pi and Direwolf side, and the CAT plumbing.

For CAT, check each rig's physical layer before choosing a cable. Icom CI-V is a single-wire, open-collector style bus with addressed frames, so one transistor-based interface can't simply be treated as a normal UART. Some rigs use TTL-level serial and others use true RS-232 levels, which is a different thing from 3.3 V logic. Plug the wrong one into a Pico pin and you'll find out quickly. Where the rig has a USB CAT port, it's usually easiest to use that and add a USB isolator or ferrites if you hear hash. Then let Hamlib hold the port and everything else talks to rigctld.

For Direwolf, the audio levels are the usual trouble. Its console output shows the received audio level, and the documentation gives a rough target to aim for, so adjust the receive audio at the source before trying to fix it in software. For PTT, a GPIO line (through a transistor) works. A CM108/CM119-type USB sound card with a GPIO pin is another common option and keeps the audio and PTT on one device. Then point your APRS client at Direwolf's KISS TCP port, 8001 by default, or its AGW port.

For a Si5351 or CW project, remember that its outputs are square waves. They need a proper low-pass filter before they go anywhere near an antenna or a mixer. Also expect to calibrate the crystal offset, since the displayed frequency will otherwise be a few hundred hertz off. Keep the I2C wiring short, and put LCD backpacks and displays in a grounded enclosure. Cheap display drivers can radiate enough noise to show up as birdies on the lower bands.

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.