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 318.7 km/s
Aurora 2
Updated 11: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? Where to split the work (antenna switch, rotator, PTT, CAT)

ci_cover.jpg

I'm planning a few shack automation projects and want to sort out which jobs belong on a microcontroller and which belong on a single-board computer. The list so far: a remote antenna switch with band-decoder input, a rotator controller, a PTT/sequencing box for an amplifier and preamp, and some logging and CAT control tied together with Hamlib.

My working assumption is that anything with hard timing or direct hardware switching (relay sequencing, reading a band-data voltage, stepper or DC motor control) goes on an Arduino-class board, and anything involving networking, a UI, or running existing software (rigctld, fldigi, Direwolf, a web dashboard) goes on a Raspberry Pi. The two would talk over USB serial or a simple network protocol.

Before I commit, a few things I'd like opinions on:

1. Is that split sensible, or is it needless complexity compared with a Pi alone using GPIO and a relay HAT?

2. How are people handling RF immunity? Anything near an HF transmitter at legal power can make a bare microcontroller board behave strangely, and USB cables make good antennas.

3. For PTT and amplifier keying, what's the preferred interface between 3.3 V or 5 V logic and the radio's PTT line: an optocoupler, a transistor, or a small reed relay?

I'm not after a full design, just the pitfalls that are easy to miss.

  • Replies 1
  • Views 116
  • Created
  • Last Reply

Top Posters In This Topic

Featured Replies

The split is reasonable, and the main reason is failure behavior. A Linux board can hang, take a while to boot, or corrupt an SD card after a power cut. An Arduino running a small sketch starts in milliseconds and does one thing. For anything that can damage equipment, such as sequencing a T/R relay, a preamp and an amplifier, put the sequencing logic and a safe default state in the microcontroller. If the Pi crashes, the outputs should fall back to receive, not stay keyed.

On logic levels: Raspberry Pi GPIO is 3.3 V and is not 5 V tolerant, while a classic Uno-type board runs at 5 V. If you connect them directly with serial, use a level shifter or a resistor divider on the line going toward the Pi. USB serial avoids that problem, though it brings its own RF issues.

For PTT, an optocoupler or a small transistor stage are both fine when the radio's PTT line is a simple open-collector, ground-to-transmit input. Check the actual voltage and current on that line first. Some radios have a pull-up of several volts and expect only a few milliamps. A transistor with a base resistor, driven from the microcontroller, is simple and fast. An optocoupler adds galvanic isolation, which helps avoid ground loops with a sound card interface. If you use a relay, put a flyback diode across the coil and don't power it from the logic supply rail if you can avoid it.

For the RF side, put the electronics in a metal enclosure, bypass every line that leaves the box with a small capacitor to the enclosure, and use ferrite on the cables. Keep the cable runs short and tidy, and don't run a USB cable alongside the feedline.

One more layer worth considering: let the Pi be the integration point, but don't make it the only path. Hamlib's rigctld is useful here. It exposes the radio over TCP, so logging software, digital-mode programs and your own scripts can share one CAT connection instead of fighting over the serial port. Your automation scripts can then query frequency or mode from rigctld and tell the Arduino which antenna port to select, rather than the Arduino needing its own CAT parser.

For the band decoder, there are two approaches. If the radio provides BCD or analog band data, read it directly on the microcontroller. If it doesn't, derive the band from the CAT frequency on the Pi and send a short command such as a band number to the Arduino. The second is easier to change, but it depends on the Pi being alive, so consider having the Arduino hold the last good state, or default to a safe antenna, if commands stop arriving. A watchdog timeout in the sketch handles this without much code.

Two practical points on the Pi. If it will run unattended, use a read-only root filesystem or an overlay setup, or boot from better storage, because abrupt power loss is the usual way these systems fail. Also, switching-supply noise can show up as birdies on HF, particularly on a cheap USB wall adapter. If you hear hash on the receiver, try a different supply, add ferrites on both the DC and USB cables, and move the Pi away from the receive antenna's coax before you blame the Arduino.

Finally, if you want WiFi on the microcontroller side, an ESP32 could replace the Arduino for some of this, but it adds a strong 2.4 GHz transmitter to your shack and needs the same care with shielding and power as anything else. For a simple wired relay box, plain serial is often enough.

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.