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? Where to draw the line between real-time I/O and the "smart" layer

ci_cover.jpg

A design question that comes up in a lot of ham radio builds: when you want to automate something in the shack (antenna switching, rotator control, PTT sequencing, band-decoder outputs, remote power control, a station status display), do you reach for an Arduino-class microcontroller, a Raspberry Pi, or both? The answer is usually "both, with a clear division of labor," but the reasons matter more than the slogan.

Here is one way to split it. The microcontroller handles anything that needs predictable timing or direct hardware contact: driving relays through transistor or driver-array stages, reading an analog forward/reflected power detector, stepping a motor, generating a clock with something like an Si5351, or sequencing PTT, amplifier keying and a sequencer delay. It boots in milliseconds, has no filesystem to corrupt, and fails in simple ways. The Pi (or any small Linux board) handles the things that benefit from an OS: running Hamlib's rigctld and rotctld, logging, a web interface, MQTT, WSJT-X or Direwolf, and scheduling. The two talk over USB serial, I2C or MQTT with a simple documented command set.

Some practical points worth discussing:

Logic levels. Raspberry Pi GPIO is 3.3 V and is not 5 V tolerant, while many classic Arduino boards run at 5 V. Connecting a 5 V output straight to a Pi input is a common way to damage a pin. Use a level shifter or a voltage divider on inputs, and remember Pi GPIO pins can only source or sink a small current, so never drive a relay coil directly from one.

Inductive loads. Relay coils need a flyback diode (or a driver IC with built-in clamps). Coax relays, antenna switches and rotator control lines can generate nasty transients, and a microcontroller reset at the wrong moment while a relay is hot-switching RF is a good way to hurt a PA.

RF in the shack. Keying a transmitter near a bare microcontroller board with long unshielded wires is a classic recipe for random resets, garbled serial data and phantom button presses. Typical mitigations are ferrite chokes on USB and I/O leads, bypass capacitors at the I/O pins, shielded enclosures, short wiring, decent grounding, and optocouplers or relays to isolate PTT and keying lines. It is better to test at full power on the bench with the actual antenna situation before you trust it.

Audio and ground loops. If the Pi is running digital modes through a USB sound interface, hum and noise can come from ground loops between the computer, rig and interface. Audio isolation transformers and an interface with galvanic isolation help. Treat CAT and audio as separate issues when troubleshooting.

Reliability of the Pi. SD cards can be damaged by power loss during writes. For an unattended station, consider a read-only or overlay root filesystem, a proper shutdown routine, a good power supply, and logs written elsewhere. For the critical safety logic (for example "never switch the antenna relay while keyed"), keep it in the microcontroller or in hardware interlocks, not in a script on a general-purpose OS.

What split of responsibilities has worked for you, and which tasks do you think should never live on the Linux side? I'm especially interested in how people handle safe default states when a controller loses power or crashes mid-operation.

  • Replies 2
  • Views 45
  • Created
  • Last Reply

Top Posters In This Topic

Featured Replies

One rule that keeps designs sane is to decide what the "fail-safe" state is for every output before writing any code. For PTT, it's receive. For an amplifier, it's standby or bypass. For an antenna switch, it's either a known safe antenna or a grounded position, depending on your lightning and station practice. Then pick hardware so that unpowered or reset equals that state: pull-down resistors on transistor bases, relays wired so the de-energized state is the safe one, and a watchdog on the microcontroller so a hung program doesn't leave something keyed.

It also helps to make the Arduino require a periodic heartbeat from the Pi. If the Pi sends something like a status or ping command every second and the microcontroller doesn't see it for a few seconds, it drops PTT and returns outputs to defaults. That way a Linux crash, a dead USB cable or a stuck script doesn't turn into a stuck transmitter.

For the actual protocols, it can be worth emulating something that existing software already understands. Hamlib supports a number of rotator controllers using the Yaesu GS-232 style command set, for instance, so a microcontroller that speaks it can slot into existing logging and tracking software without custom drivers. Check the specific Hamlib model and its documentation for exact command support, since details vary.

On the RF side, I'd add that the problem is often the cables rather than the boards. A one-meter USB lead or a long relay control cable acts as a decent antenna on HF, and the common-mode current rides straight into the microcontroller's I/O or the USB port. Clamp-on or toroid chokes at both ends, a metal enclosure bonded to the station ground, and filtering on each control line (a small series resistor plus a capacitor to ground, sized so it doesn't slow the signal you care about) go a long way.

For CI-V-style single-wire buses and similar rig interfaces, don't assume you can wire a 3.3 V or 5 V GPIO straight to the radio. Those buses are typically open-collector with specific voltage and pull-up arrangements, so check the rig's manual and use a proper interface circuit. For USB CAT on modern rigs, it's usually simpler and more RF-robust to let the Pi talk to the radio's own USB port and use the microcontroller only for the extra I/O.

Finally, if the Pi is on the same shelf as a high-power transmitter, consider testing with it running off a separate, well-filtered supply. Switching supplies, both the Pi's and the rig's, can be a noise source of their own, and it's easier to isolate that on the bench than after everything is mounted in a rack.

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.