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 split the work between them

ci_cover.jpg

A lot of shack automation projects start with the question "Arduino or Pi?" It is usually better to ask which parts of the job each one is good at. A typical project might include an antenna switch, a band-decoder, a rotator controller, PTT sequencing for an amplifier and preamp, a remote power/SWR readout, and some logging or digital-mode software. Those tasks have very different requirements.

The rough split I'd start from: put anything with hard timing or safety consequences on a microcontroller, and put anything that needs a network stack, a filesystem, or desktop-class software on the Pi. PTT sequencing, relay drivers, reading a forward/reflected power detector, and watching a rotator potentiometer are all natural Arduino-class jobs. Running WSJT-X, Direwolf, a Hamlib rigctld server, a web dashboard, or a logging database is Pi territory. Linux is not a real-time OS, so a Pi toggling GPIO pins to key an amplifier is relying on the scheduler behaving, which is a poor basis for sequencing hardware that can be damaged by hot-switching.

A few practical points that come up repeatedly:

Logic levels. Raspberry Pi GPIO is 3.3 V and is not 5 V tolerant. A classic Uno-style board runs at 5 V. If the two talk over serial or I2C, use a level shifter or make sure both sides are at the same voltage. Also check what your radio's CAT or data port actually uses. Some are TTL-level, some are RS-232 levels, and some, like single-wire bus interfaces, are open-collector style. Don't wire one straight to a GPIO pin without confirming the electrical spec in the manual.

Driving relays and PTT. Don't drive a relay coil from a pin. Use a transistor or MOSFET driver (or a driver board) with a flyback diode across the coil, and consider an optocoupler or a small relay for the PTT line so that the radio's keying circuit is isolated from the controller. Also check the relay's RF rating at your frequencies. A relay that is fine for switching a 12 V accessory may have poor isolation or a bad impedance bump at VHF/UHF.

RF in the controller. Both boards can be upset by RF, and both can generate noise. Switch-mode USB supplies and Pi clock harmonics can show up as birdies or a raised noise floor on HF. Common fixes are a linear or well-filtered supply, ferrites on USB and power leads, a metal enclosure, and keeping the controller away from the antenna feedline and tuner. Sensor leads that run out to the antenna area should get filtering (small capacitors, series resistors or ferrites) at the controller input. Don't connect long outdoor lines directly to a GPIO pin; use surge protection and some form of isolation.

Reliability. A Pi running from an SD card can have trouble if power is cut at the wrong moment. For a controller that lives in a remote shack, a read-only root filesystem, a proper shutdown path or UPS, and a hardware or software watchdog are worth the effort. On the microcontroller side, a watchdog timer plus a sane default state on boot (all relays off, PTT released) matters more than clever features.

How are people dividing responsibilities between the two? Is there a point where you'd skip the Arduino entirely and use a microcontroller board with built-in Wi-Fi, or where you'd skip the Pi and run everything from a PC already in the shack?

  • Replies 2
  • Views 41
  • Created
  • Last Reply

Top Posters In This Topic

Featured Replies

One common architecture is to let the microcontroller own the hardware and treat the Pi as a client. The Arduino (or similar) handles relays, ADC reads and PTT timing, and exposes a simple serial protocol: set antenna 3, read forward power, report status. The Pi just sends those commands. If the Pi crashes or reboots, the microcontroller keeps its last safe state or falls back to a default, and the amplifier can't be left keyed because of a hung process.

For the serial link, keep the protocol boring and human-readable at first, for example line-based text commands with a checksum or at least an acknowledgment. It makes debugging with a terminal much easier. You can also add a timeout so that a PTT-on command has to be refreshed every few hundred milliseconds. If the refresh stops, the microcontroller drops PTT on its own. That one design choice protects hardware better than any amount of careful software on the Pi.

For rig control, Hamlib's rigctld is usually the cleaner path than writing your own CAT code. Let the Pi talk to the radio through Hamlib, and use the microcontroller only for the accessories around it.

I'd push back a little on always adding a second board. If the project is just a band-dependent antenna switch plus a few status LEDs, a single 3.3 V microcontroller with Wi-Fi, such as an ESP32-class board, can do the relay control, a small web page and MQTT messages, without the overhead of running a full Linux system. It also boots in a second or two and has no SD card to corrupt. The tradeoffs are that you have to be more careful about RF pickup on the Wi-Fi antenna and the board itself, and the 3.3 V logic means more attention to drivers and level shifting.

The Pi earns its place when you need real software: decoding digital modes, running an APRS TNC with Direwolf, hosting a logbook, or acting as a gateway to Home Assistant or similar. For pure switching and sensing, it is often more than the job needs, and more noise sources in the shack than necessary.

Whichever way you go, test with the transmitter running into a dummy load first, at different power levels and on the bands you use, and watch for resets, flickering relays, or garbled serial data. Problems that only show up when you key at 100 W are much easier to deal with before the box is mounted behind the desk.

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.