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 33
A 3
K 1 Quiet
X-Ray B1.3
Wind 322.7 km/s
Aurora 2
Updated 12: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 split the work between them

blogs_cover.webp

I'd like to compare approaches for splitting shack automation between an Arduino-class microcontroller and a Raspberry Pi. Typical projects are antenna switching, band-decoder outputs, rotator control, remote power switching, PTT sequencing for digital modes, and station monitoring (SWR, temperature, voltage). People often try to do all of it on one board, and that's usually where the trouble starts.

The way I see it, the two boards are good at different things. A Pi (or similar Linux SBC) is good at anything involving networking, audio, and existing ham software: Hamlib's rigctld, Direwolf, WSJT-X, logging software, MQTT, a web dashboard. An Arduino or other microcontroller is good at deterministic I/O. It boots in milliseconds, has no filesystem to corrupt, reads analog inputs directly, and does the same thing every time it powers up. That matters when the job is "make sure the antenna relay is in a safe state before anything transmits."

A few specific questions to start with:

1. Do you let the Pi drive relays and PTT directly from GPIO, or put a microcontroller in between that enforces timing and safe defaults? Pi GPIO is 3.3 V and not 5 V tolerant, and a crashed Linux process can leave a pin in whatever state it last had.

2. How do you handle RF getting into the control electronics? Resets, I2C lockups, noisy ADC readings, and USB dropouts that only happen on transmit are common complaints, and they're often blamed on the board when the cause is common-mode current on the cabling.

3. For a remote or unattended setup, what's your watchdog strategy? A hardware watchdog on the Pi, a separate one on the microcontroller, or both?

I'm interested in how people draw the line, and in which interfaces you consider worth isolating (optocouplers, relays, or transformer isolation on audio).

  • Replies 1
  • Views 96
  • Created
  • Last Reply

Top Posters In This Topic

Featured Replies

A split that tends to work well is for the Pi to make decisions and the microcontroller to enforce them. The Pi runs the network-facing software and sends simple commands over USB serial, like ANT 3 or PTT 1. The Arduino owns the relays and the PTT line, and it refuses unsafe sequences no matter what the Pi asks for.

For example, on a request to change antennas, the microcontroller can drop PTT, wait a few tens of milliseconds, switch the relay, wait for contact settling, and only then allow PTT again. That avoids hot-switching even if the host software is sloppy. You can also add a heartbeat: if the Arduino doesn't hear from the Pi for N seconds, it drops PTT and returns to a defined default, such as a dummy load or a known antenna port. Without that, a hung Pi can leave a transmitter keyed, which is the failure you most want to design out.

Keep the serial protocol boring: line-based ASCII, an acknowledgement for every command, and a status command that reports the current state. It's easy to test from a terminal, and you can add a Hamlib or rotator-protocol shim on the Pi side later without touching the firmware.

On the electronics, relay coils need a transistor or driver IC and a flyback diode, or a ready-made driver board that has them. Don't drive coils from a microcontroller pin. If the relays run from a separate supply, tie the grounds deliberately and keep the coil current return path away from analog sensing grounds.

On RF, I'd treat it as a systems problem rather than a board problem. The usual path is common-mode current on the feedline, the USB cable, the DC lead, or the sensor wiring, which then ends up on the microcontroller's pins. Symptoms like resets on certain bands or only at higher power point that way. A different board won't necessarily fix it, but better cable handling often does.

Things worth trying, roughly in order of effort: improve the feedline choke and the station RF ground first, since that reduces what's available to get into everything else. Then put clip-on ferrites (of a mix suited to the band in question) on USB and control cables, and use a metal enclosure with filtered or bypassed lines at the point where they enter it. A small capacitor from a sensor line to ground at the board, plus a series resistor, helps analog inputs. Keep leads to the sensors short and twisted where possible. For I2C, short runs matter, and long runs outside the box are asking for lockups.

Isolation is worth it where the wiring leaves the box and heads toward the rig or the antenna system. An optocoupler or a relay contact for PTT keeps the rig's ground from being tied to your controller by accident. For audio between a Pi sound interface and a radio, a 1:1 audio isolation transformer is common, and many people use a USB sound interface with isolation built in.

On Pi reliability, plan for power loss. A decent power supply, a read-only or overlay root filesystem if the Pi will be running unattended, and the hardware watchdog enabled in the OS are all inexpensive. Logs and data can go to a separate partition or to a network location, so a bad power cycle doesn't corrupt the system you rely on.

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.