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 shack automation between Pi, Pico and ESP32: what belongs where?

ci_cover.jpg

A lot of shack-automation projects start as one small gadget and grow into a pile of boards: a CAT interface, a remote antenna switch, a rotator controller, an SWR/power meter, a CW keyer, an APRS tracker or digipeater running Direwolf, and maybe an Si5351 for a VFO or test oscillator. The first design question is usually which board should do which job, and whether one board should do all of them.

Here is a rough framework to argue with.

Linux SBC (Raspberry Pi): good for anything that needs a network stack, a filesystem, USB audio or a lot of software. Direwolf, Hamlib's rigctld, logging software, a web dashboard and an MQTT broker all fit here. It is a poor choice for hard timing (CW keying, PTT sequencing) and for directly driving relays or sensors, because GPIO is 3.3 V with little protection and a Linux userspace process can be delayed by the scheduler.

Pi Pico (RP2040): deterministic timing, cheap, and PIO is useful for odd protocols. It suits a CW keyer, a PTT sequencer, a rotator motor controller or a stepper driver. WiFi is only available on the W variants, and the 12-bit ADC is noisy enough that I would not use it as-is for anything that needs real accuracy.

ESP32: WiFi and Bluetooth built in, so it suits remote nodes such as an antenna switch at the tower base, temperature and voltage monitoring, or a web UI for a rotator. The on-chip ADC is nonlinear and noisy, and ADC2 conflicts with WiFi on the original ESP32. For SWR, power or rotator-position readings, an external ADC such as an ADS1115 is often the cleaner answer.

Some specific points where these projects tend to go wrong:

  • RF in the shack. Microcontrollers sitting next to a transmitter will see RF on every long wire. Ferrites on USB and control cables, bypass caps at the connector, a metal enclosure bonded to station ground, and a series resistor plus small cap on each long input line all matter more than the choice of board.
  • Relay drivers. Use a transistor or driver IC with a flyback diode across each coil. Do not switch coax relays or rotator motors directly from a GPIO, and keep relay supply wiring away from sensor lines.
  • Si5351. The outputs are square waves, so there are harmonics. If the output is going anywhere near a receiver or transmitter stage you need a proper low-pass filter. It is a 3.3 V I2C part, so level shifting matters if the host board is 5 V (a classic Arduino). Frequency accuracy depends on the reference crystal, so calibrate it against a known reference.
  • PTT for Direwolf. Direwolf can key through GPIO, a serial port's RTS or DTR line, a CM108-style USB sound card GPIO, or Hamlib. Keying through an optoisolated or transistor stage keeps the radio's PTT line from touching the Pi directly.
  • CAT. Many rigs expose a USB serial port, others need a level converter (TTL or RS-232 levels, depending on the model). Running rigctld from Hamlib on the Pi lets multiple programs share one rig without fighting over the serial port.

Questions for the group: do you prefer one central Pi with small microcontroller nodes talking over serial, MQTT or USB, or are independent nodes better so a Pi reboot never leaves a relay stuck? And how are people handling fail-safe states, such as what the antenna switch, PTT line and rotator do if the controller crashes?

  • Replies 2
  • Views 30
  • Created
  • Last Reply

Top Posters In This Topic

Featured Replies

  • Moderators

I would lean toward independent nodes with the Pi as an optional supervisor. The rule I would apply is that anything that can damage equipment or cause a bad transmission must fail safe without the Pi being alive. PTT, amplifier bias and antenna selection are the obvious ones.

In practice that means a Pico or similar handles the time-critical and safety-critical logic: PTT sequencing with delays between relay and amp keying, a watchdog timer, and a default state at power-up. Choose relay logic so that the de-energised state is the safe one. For an antenna switch that might be a dummy load or a known-good antenna, and for PTT it is receive. The Pi then sends high-level commands such as 'select antenna 3' over USB serial, and the node can refuse commands that would be unsafe, for example switching a coax relay while the PTT line is active (hot switching).

The same applies to a rotator controller. Put limit handling and motor timeouts in the microcontroller. If the Pi is the only thing that knows where the stop is, a hung script can drive the rotator into the stop. A simple rule such as 'stop if the potentiometer reading hasn't changed in N seconds while the motor is on' protects the motor and cables.

For the link between the two, a plain line-based ASCII protocol over USB serial is easy to debug from a terminal, and you can add a checksum later. MQTT over WiFi is convenient for ESP32 nodes, but for anything that touches PTT, I would keep it on a wired link.

  • Administrators

On the analog side, the SWR meter and rotator position sensing are where the ADC choice shows up. For SWR, the usual designs use a directional coupler feeding either diode detectors or a log detector like the AD8307, and the microcontroller reads forward and reflected voltages. Two things are easy to overlook. First, calibrate across the bands you care about, because coupler response and detector behavior vary with frequency and power. Second, take readings only while there is enough forward power. At near-zero power the reflected/forward ratio is meaningless and the display will jump around.

For noise, average multiple samples, keep the analog ground return separate from the relay and motor current path, and put an RC filter at the ADC input. A 16-bit I2C ADC like the ADS1115 is slow but quiet, and that is usually fine for a rotator pot or a slowly changing power reading. For a fast SWR sweep it may be too slow, and a Pico's internal ADC with good filtering, or a faster external ADC, makes more sense.

For a rotator pot, a stable reference voltage matters more than resolution. If the reference is the 3.3 V rail shared with WiFi bursts on an ESP32, the reading will wander with load. Powering the pot from the ADC's own reference or a clean regulated supply, then calibrating end stops in software, gets better results than adding bits.

Finally, on soldering: for fine-pitch parts like SMD ADCs, flux matters more than the iron. A decent flux pen, a small chisel tip, and cleaning the board afterwards will save a lot of intermittent problems that look like software bugs.

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.