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

Splitting a shack automation build between a Pi and microcontrollers: where does each job belong?

ci_cover.jpg

A common pattern in ham shack automation is one Raspberry Pi doing everything: Direwolf, rigctld, a web dashboard, rotator control, and antenna switching over GPIO. It works on the bench, but it can get fragile once real RF is in the room. Here is a way to divide the work, and I'd like to hear where others draw the line.

Jobs that suit a Pi (Linux, audio, networking): Direwolf as a software TNC (sound card or USB audio in and out, PTT via GPIO, a CM108-style GPIO, or a serial RTS line), Hamlib's rigctld (TCP, port 4532 by default) so logging and digital-mode software can share one CAT connection, and logging, MQTT, or a web UI. Direwolf will also feed an APRS-IS iGate or a KISS TCP port for other software. The weak points are SD card corruption on hard power loss and a lot of broadband hash from cheap USB supplies, so a decent supply and a read-only or well-backed-up filesystem are worth the effort.

Jobs that suit a Pico or ESP32 (timing-critical, always-on, simple I/O): an iambic CW keyer, antenna switch relay drivers, a rotator controller (reading a potentiometer and driving relays or a motor driver), an SWR/power meter front end, and Si5351 clock generation. Boot time is instant and a hung Linux system doesn't take the keyer down with it. The Pico RP2040 is 3.3 V and its GPIOs are not 5 V tolerant; the ESP32 is also 3.3 V. A lot of older rigs, keyers, and rotator interfaces speak 5 V TTL or true RS-232 levels, so check each line. RS-232 needs a MAX3232-type converter, not a direct connection. Icom CI-V is a single-wire, open-collector style bus that needs a proper transistor or buffer interface.

A few details that tend to cause trouble:

1. The ESP32's ADC2 channels can't be used while Wi-Fi is active, so put analog sensors (SWR detector, rotator pot) on ADC1 pins. The ESP32 ADC is also nonlinear, so calibrate or use an external ADC such as an ADS1115.

2. The Si5351 outputs square waves, so you need a low-pass filter for the band you're using before it goes near a receiver or a transmitter stage. Check the board's I2C level and supply voltage as well. Some breakout boards include level shifting and others expect 3.3 V logic. Frequency accuracy depends on the reference crystal, so calibrate against a known source and store the correction.

3. Keep relay coils off the logic supply where you can. Use a ULN2003 or MOSFET driver with flyback diodes, and consider latching relays for an antenna switch so the selected port survives a reset. Add an interlock so the switch won't change while PTT is active.

4. Control lines that run out to the antenna switch, rotator, or tower act as antennas for RF. Bypass capacitors at the connector, series resistors, ferrites, and shielded cable all help. If a microcontroller resets or a display garbles only when you transmit on a particular band, suspect RF on the I/O or supply wiring before blaming the firmware.

5. Don't wire a GPIO straight to a rig's key jack. Use an optocoupler or small transistor stage. Some older rigs have significant open-circuit key-line voltage, and an isolated stage protects both sides.

How do you decide what goes on the Pi and what stays on a dedicated microcontroller? And is anyone running everything through a single MQTT or serial bus, or keeping each device standalone?

  • Replies 2
  • Views 29
  • Created
  • Last Reply

Top Posters In This Topic

Featured Replies

  • Moderators

The dividing line I'd suggest is whether the function has to keep working when the network or Linux is down. A CW keyer, PTT sequencing, and antenna selection fall in that category. The Pi can request "select antenna 3" over serial or MQTT, but the microcontroller should own the relays and the safety rules, such as refusing to switch during transmit and returning to a safe default on startup.

Regarding CAT, I'd run a single rigctld instance and point everything else at it rather than letting several programs fight over the serial port. If a program doesn't speak Hamlib directly, it can often use the rigctld network interface or a virtual serial bridge. Poll the rig at a sensible rate, because aggressive polling from several clients can make some radios unresponsive or eat into the CAT bandwidth.

For the soldering side, a lot of intermittent shack problems are cold joints on connectors and headers. Use plenty of flux, let the joint reach temperature before feeding solder, and inspect for a concave fillet. Leaded versus lead-free is a personal and regulatory choice, but ventilation matters either way.

  • Moderators

I'd push back a bit on using a microcontroller for everything. For an APRS tracker, an ESP32 or Pico with a GPS module and a small AFSK modulator and radio module is a legitimate design, since the job is small, but for a fixed digipeater or iGate, Direwolf on a Pi is easier to tune and monitor. It handles multiple decoders, logs packets, and lets you adjust audio levels while you watch decode counts. The key is getting the audio levels right on both receive and transmit. Overdriven TX audio is one of the classic APRS problems, and a modest deviation setting on the radio keeps you from splattering the packet.

On the RF side, an SWR meter built from a directional coupler and an AD8307 log detector gives a good dynamic range, but it needs calibration against a known load and a reference meter. Don't trust the displayed numbers just because the code produces a plausible-looking ratio. Diode detectors are nonlinear at low power, so apply a calibration table rather than a single scale factor.

And for LCDs: an I2C backpack on a 16x2 or 20x4 character display is simple, but the long cables and RF in the shack can make them flicker. Keep the I2C runs short, add pull-ups of an appropriate value, and keep the wiring away from the feedline. If the display has to sit far from the controller, consider RS-485 or a differential link to the head unit rather than long raw I2C.

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.