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.4
Wind 332.7 km/s
Aurora 2
Updated 06:00 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 CAT control sensibly

blogs_cover.webp

I'd like to get opinions on how to divide up a shack automation project between an Arduino-style microcontroller and a Raspberry Pi. The wish list is a remote antenna switch with band-based selection, a sequenced PTT line for a preamp and amplifier, rig control through Hamlib, and basic logging of SWR and supply voltage. All of it would sit a few feet from HF transmitters, so RF immunity matters as much as the code.

The obvious split is to let the Pi handle the network, the UI and software such as rigctld or WSJT-X, while a microcontroller handles anything with a hard timing or safety requirement. The questions I'd like to hear views on are these. Where exactly should that line fall? Should the Pi ever drive relays directly through GPIO? And what are the usual causes of a project that works on the bench and then misbehaves as soon as you key up on 40 m or 20 m?

Please keep in mind that GPIO on a Pi is 3.3 V and not 5 V tolerant, that a Pi boots into Linux with pins in a default state before your software takes over, and that a Pi running a full OS can't guarantee millisecond-level timing. It would be helpful to hear how others handle these constraints, whether with level shifting, a dedicated I/O board, or a serial link to a microcontroller.

  • Replies 1
  • Views 76
  • Created
  • Last Reply

Top Posters In This Topic

Featured Replies

Your split is the standard one, and I'd draw the line at consequences. If a missed deadline or a crash could hot-switch a relay, key an amplifier into the wrong antenna, or leave PTT stuck on, put that logic on a microcontroller with a hardware watchdog. The Pi sends commands such as "select antenna 3" or "request TX" over USB serial or I2C, and the microcontroller decides whether and when to act. A crashed or rebooting Pi then can't leave the station in a dangerous state.

Sequencing is the clearest example. A proper T/R sequence is: switch coax relays, then enable the preamp bypass or amplifier, then allow RF. Releasing runs in reverse, with a small delay between steps. That's easy to get right in a microcontroller loop with timers, and it's unreliable under Linux scheduling. Add a TX timeout in firmware too, so a stuck PTT command from software drops out after a set time.

On direct GPIO, I'd avoid it for anything beyond logic-level signals. Use a transistor or driver array such as a ULN2003 for relay coils, add flyback diodes if the driver doesn't include them, and consider opto-isolation or a separate relay supply so coil switching doesn't inject noise into the logic rail. Fit pull-down or pull-up resistors so the outputs are in a safe state during boot, when the pins are not yet configured.

For the bench-versus-RF problem, the usual suspects are common-mode currents on cables, not the code. Every USB cable, sensor lead and relay control line is a potential antenna. Put clamp-on or toroid ferrites on the USB cable at both ends, keep control wiring short, use bypass capacitors close to the input pins of the microcontroller, and use a metal enclosure bonded to a sensible ground if the box is near the antenna feed or the amplifier. If a reading jumps or a board resets only when you transmit, that points to RF getting into the wiring. Check that before rewriting the firmware.

Power supplies are the other big one. Cheap buck converters stepping 13.8 V down to 5 V can radiate hash across the HF bands, which shows up as birdies or a raised noise floor on the receiver. Keep them away from the receive antenna feed, add input and output filtering, and test with the rig on the bands you actually use. It's also worth giving the Pi a stable supply, since undervoltage and abrupt power loss are common reasons for SD card corruption. A read-only root filesystem or a boot drive suited to the workload helps if the box is meant to run unattended.

For rig control, Hamlib's rigctld on the Pi works well with logging and digital-mode software, but check the rig's interface levels first. Some radios use TTL-level serial, some use RS-232 voltages, and Icom CI-V is a single-wire bus, so a wrong adapter can cause either no communication or damage. If the station will be operated remotely or unattended, also check your licence authority's rules on control operators and remote operation, since they vary by country.

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.