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 90
SN 22
A 3
K 1 Quiet
X-Ray B1.3
Wind 338.5 km/s
Aurora 2
Updated 06:30 UTC HamQSL · N0NBH
Day 80/40m Fair 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

Arduino or Raspberry Pi for shack automation? Splitting antenna switching, PTT and rotator control

ci_cover.jpg

I'm planning a shack automation setup and want to sort out which jobs belong on an Arduino-class microcontroller and which on a Raspberry Pi. The target features are:

1. Remote antenna selection (a multi-position coax switch driven by relays).
2. PTT and keying interfaces for digital modes.
3. Rotator control, with Hamlib's rotctld on the software side.
4. Logging of SWR, temperature and supply voltage.
5. Remote access over the LAN.

My starting assumption is that the Pi handles the software-heavy work (WSJT-X, Fldigi, Direwolf, rigctld, a web dashboard) and a small microcontroller handles anything that must be deterministic or safe if Linux hangs: relay sequencing, PTT timeout, and reading sensors. The two would talk over USB serial or MQTT.

Questions I'd like opinions on:

Is it sensible to keep PTT hardware on the microcontroller, with the Pi only sending a request? Or is that over-engineering for a station that mostly runs digital modes?

How do you deal with RF getting back into the control electronics on HF, especially with a station ground that isn't perfect? Ferrites, optoisolators and shielded enclosures all seem to be in play, but I don't know which matter most.

What failure modes should I design against from the start? The ones I've thought of are a hung Pi keying the transmitter, a relay switching while RF is present, and SD card corruption after a power dip.

  • Replies 1
  • Views 75
  • Created
  • Last Reply

Top Posters In This Topic

Featured Replies

Splitting the work that way is a common pattern and it makes sense. A microcontroller boots in milliseconds, has no filesystem to corrupt, and a simple state machine on it is easy to reason about. A Pi is a general-purpose computer, so it's a poor place for anything where a stall could leave the transmitter keyed.

For PTT, put a hardware timeout on the microcontroller side, independent of what the Pi says. If the Pi sends 'PTT on' and then crashes, the microcontroller should drop PTT after a set limit, or when the heartbeat messages stop. A heartbeat every few hundred milliseconds while keyed works well: no heartbeat, no transmit. That covers the hung-Pi case in a way software on the Pi can't.

For antenna switching, add an interlock so relays only change state while PTT is off. The microcontroller can refuse a switch command during transmit. Hot-switching coax relays shortens contact life and can cause transients, and some relays aren't rated for the power or frequency you're using. Check the datasheet for the band and power level you actually run, not just the coil voltage.

On the Pi's GPIO, remember it's 3.3 V logic and not 5 V tolerant. If the relay board or the microcontroller is a 5 V part, use a level shifter or a transistor/optocoupler stage, and don't assume a relay module's input is Pi-safe. Relay coils also need flyback diodes unless the driver board already has them.

On RF getting into the electronics, I'd rank the measures roughly like this: cable management first, then filtering, then enclosures.

Control cables running through the shack act as antennas, so common-mode current on them is the usual culprit. Clamp-on or toroidal ferrites on USB, relay and sensor leads help, and a common-mode choke on the coax feedline near the station is worth having anyway. Keep low-level wiring away from the feedline and the antenna tuner, and where possible use twisted pair for relay and sensor runs. A bypass capacitor (say 0.01 µF to 0.1 µF, plus a small ceramic for higher frequencies) at the point where a line enters an enclosure can help, but ferrites and capacitors work best as a combination, not as a single fix.

For audio on digital modes, a USB sound interface with transformer isolation on the audio lines and an optocoupler or similar isolation on PTT breaks ground loops. Hum and noise from a shared ground are a common cause of poor decodes and of RF-induced glitches.

Power supplies deserve attention too. Cheap buck converters stepping 13.8 V down to 5 V can radiate switching noise that shows up as birdies or a raised noise floor on HF. If you see unexplained noise on a band, try powering the Pi from a different supply, or add filtering, and see whether it changes.

For the SD card, a quality card helps, but a read-only root filesystem with logs written to RAM or a USB drive is a better way to survive power dips. If you log SWR and voltage over time, write those somewhere that doesn't wear or corrupt the boot media, or have the microcontroller buffer them. Whatever you choose, test the failure cases deliberately: unplug the Pi mid-transmit into a dummy load and confirm PTT drops.

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.