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.3
Wind 338.5 km/s
Aurora 2
Updated 06: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 do you draw the line between them?

ci_cover.jpg

I'm sketching a control system for a small HF/VHF station and trying to decide what belongs on an Arduino-class microcontroller and what belongs on a Raspberry Pi. The wish list so far:

1) A remote antenna switch with 6 to 8 ports, using coax relays at the tower base or a junction box.
2) Band-data-driven switching, so the rig's band output or CAT frequency selects the right antenna and band-pass filter.
3) Rotator control with azimuth feedback.
4) Logging of SWR, forward power, supply voltage and temperature.
5) A web page or app for remote operation over the home network.

My first instinct is to put everything on a Pi, since it already has networking, Hamlib, Python and a filesystem. But a general-purpose Linux board feels like the wrong thing to trust with relay states when the transmitter is keyed. An Arduino-style board boots in milliseconds and does one job, but it has no useful network stack on its own and is awkward for logging.

Questions for the group:

Which functions should be hard real-time and live on the microcontroller (PTT sequencing, relay interlocks, watchdog)? Which are fine on the Pi (UI, logging, rigctld)? And how do you link them: USB serial, I2C, RS-485 or something else? The cable run to the antenna switch could be 20 to 30 m, and I'm wary of putting RF-prone I2C on that length.

I'm also curious about the practical hazards: 3.3 V GPIO on the Pi versus 5 V logic on many Arduino boards, relay coil kickback, and keeping digital noise off the receive side on HF.

  • Replies 2
  • Views 87
  • Created
  • Last Reply

Top Posters In This Topic

Featured Replies

A split architecture is usually the safest answer: the microcontroller owns anything that can damage equipment, and the Pi is the convenient front end. If the Pi crashes, reboots or loses the network, the station should stay in a safe, defined state.

In practice that means the Arduino (or similar) handles relay drive, PTT sequencing, band-to-antenna lookup tables, and any interlock such as 'don't switch this relay while PTT is active'. It should also boot into a known default, such as a safe antenna or a dummy load, with a hardware or software watchdog. The Pi sends high-level commands like 'select antenna 3' and the microcontroller decides whether that's allowed right now. The Pi should never drive a coax relay directly from GPIO.

For the link, USB serial is the simplest option for a short run, and it also gives some galvanic separation if you use an isolated USB hub or adapter. For a 20 to 30 m run to a tower-base box, I'd avoid I2C and use RS-485 with proper differential transceivers, or put a small microcontroller at the remote end and keep only a serial link between the two. Keep the protocol simple and add a heartbeat so the remote end knows when the master has gone away.

On voltage levels: Pi GPIO is 3.3 V and not 5 V tolerant, so use a level shifter or an opto-isolated interface wherever a 5 V board is involved. Relay boards need care too. Check whether the input is active-low, and whether the optocoupler's supply is shared with the coil supply (which defeats the isolation). Flyback diodes are mandatory when you drive bare relays with transistors.

For rig integration, run Hamlib's rigctld on the Pi for CAT, and use the rig's band-data lines for fast switching if it has them. Icom CI-V is a single-wire open-collector bus and Yaesu band data is a voltage or BCD output on some models, so check your rig's manual before wiring anything. Never assume a CAT port is RS-232 levels or TTL.

Agreeing with the split, and adding a few points on RF and failure modes, since those usually cause the most trouble in a shack.

Any digital board near an HF receiver can become a noise source. Switching regulators, USB cables and the Pi's high-speed clocks can all radiate or conduct hash. The usual remedies are a metal enclosure, ferrite chokes (a mix 31 or 43 type is common for HF) on USB, DC and control cables, bypass capacitors at the cable entry points, and keeping the Pi physically away from the receive antenna feed. A linear or well-filtered 12 V supply for the control box helps too. It's also worth testing at the receiver with the Pi running and then switched off, so you can see whether it's raising the noise floor on a quiet band.

The opposite problem is just as real: RF getting into your controller during transmit. If the Arduino resets or relays chatter when you key up on a particular band, suspect common-mode current on the control cables. Fixes are chokes, shorter unshielded leads, a decent RF ground, and series resistors plus small capacitors on input pins. Test with the amplifier and every band before trusting the system.

For the outdoor run, think about lightning and static. Isolate the control lines (opto-isolators, RS-485 with surge protection, or a fibre link if you want to go further), and make sure the remote relay box returns to a safe state when power is lost. Latching relays are convenient but remember what position they'll be in after an outage. Non-latching relays give you a defined default.

A Pi's SD card can also be corrupted by sudden power loss. If it's running headless and might lose power, consider a read-only root filesystem or at least a clean-shutdown arrangement with a small UPS or supercapacitor board. Keep the logging data on a separate partition or external storage.

One alternative to consider: an ESP32 can combine the microcontroller and network roles for the remote box, with Wi-Fi or Ethernet and decent GPIO. The tradeoff is that Wi-Fi radios inside an RF-sensitive enclosure can complicate the noise picture, and you still need the same hardware interlocks. I'd keep the safety logic out of any code path that depends on the network being up.

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.