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 a Raspberry Pi and microcontrollers: what goes where?

ci_cover.jpg

I'm planning a shack controller and want to settle the architecture before I solder anything. The wish list: CAT rig control, a rotator controller, a relay-based antenna switch, a simple SWR/power readout, a CW keyer, and a Direwolf APRS station for VHF. Possibly a Si5351 as a test signal source later.

My current idea is a Raspberry Pi running Hamlib (rigctld), Direwolf and logging software, with one or two microcontrollers (Pi Pico or ESP32) handling the hardware-facing jobs. The Pi would talk to them over USB serial or MQTT. I'd like opinions on a few points:

1. Is it sensible to keep anything timing-critical (CW keying, relay sequencing, PTT interlocks) off the Pi entirely?

2. For CAT, is it better to give the rig one owner, such as rigctld, and have everything else talk to that?

3. How do you keep RF out of the microcontrollers when running power on HF? Pico or ESP32, I'm thinking of a metal enclosure plus ferrites, but I'm not sure that's enough.

4. For the rotator and SWR meter, is the built-in ADC good enough, or should I use an external one?

Any gotchas on levels, grounding or Direwolf PTT are welcome too.

  • Replies 2
  • Views 27
  • Created
  • Last Reply

Top Posters In This Topic

Featured Replies

  • Moderators

Your split makes sense. The rule of thumb is that anything with hard timing or a safety consequence belongs on a microcontroller, and anything that needs a filesystem, network stack or heavy software belongs on the Pi. Linux isn't a real-time OS, so a loaded Pi can add jitter to GPIO toggling. That's tolerable for a PTT line but unpleasant for CW element timing. A keyer on a Pico or Arduino-class board avoids the problem. If you make it speak the WinKeyer protocol, most logging software can drive it without custom code.

On CAT, yes, give the rig one owner. Run rigctld on the Pi and point the logger, digital mode software and your own scripts at it over TCP. Otherwise you get two programs polling the same serial port and fighting over it. Also check the interface hardware before choosing a board. Some rigs have a USB port that shows up as a serial device and needs no extra circuitry. Others use TTL-level serial, and Icom's CI-V is a single-wire open-collector bus that needs a proper interface. Old Kenwood and Yaesu gear may use RS-232 voltage levels, which can damage a 3.3 V GPIO if you wire it directly. Check the level in the manual and use a level shifter or a MAX3232-type chip as appropriate. Remember the Pico and ESP32 are 3.3 V parts and their pins are not 5 V tolerant.

For Direwolf, the usual PTT options are a GPIO line, a serial port's RTS or DTR, or a spare GPIO on a CM108/CM119-based USB sound adapter. The USB adapter is often the cleanest because audio and PTT travel through one device. Whichever you choose, set the audio levels with Direwolf's reported input level rather than guessing. Overdriving the radio's data input is a classic cause of poor decodes.

  • Moderators

Adding to the above, on RFI I'd treat it as a system issue rather than a board-choice issue. A metal box and ferrites help, but the usual failure paths are the cables: USB, I2C runs to displays or sensors, and the leads to relays and rotator potentiometers. Each one can act as an antenna on HF. Common mitigations are a ferrite choke on each cable where it enters the enclosure, a small bypass capacitor and series resistor on sensor lines, short I2C runs with modest pull-up values, and a single well-considered ground point. If a unit misbehaves only while transmitting on a particular band, that points to RF ingress and not a software bug. Also note that the ESP32's Wi-Fi radio is a transmitter in its own right, so keep it away from sensitive receive antennas and consider whether you need it on at all for the module that sits next to the rig.

On ADCs, the ESP32's internal ADC is known to be nonlinear and noisy, especially near the ends of its range. That matters for a rotator, where the position is a potentiometer voltage and you want repeatable readings. The Pico's ADC is usable but has its own limits and noise. An external I2C converter like the ADS1115 is cheap and usually a better fit for both the rotator and SWR sense lines. For SWR, a directional coupler feeding a log detector such as the AD8307 gives a wide dynamic range. Either way you will need calibration against a known load and a reference meter, because diode detectors are not linear at low levels.

For the antenna switch, don't hot-switch under power. Build a sequence in firmware: PTT off, short delay, change relay, short delay, allow PTT again. Add a hardware or firmware lockout so a bad command can't key the rig while the relays are moving. If you use relays with DC on the coax, mind the DC path and the coil flyback diodes. Remember relay isolation drops as frequency rises, so a switch that works well on HF may leak noticeably on VHF.

If the Si5351 does get added, remember its outputs are square waves with strong harmonics. Put a low-pass filter on the output before connecting it to a receiver or any antenna system. Its accuracy is only as good as the reference crystal, so don't expect it to be a lab-grade standard.

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.