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 to split the work on an antenna switch, rotator and PTT project

ci_cover.jpg

I'm planning a shack automation setup and want to sort out which jobs belong on an Arduino-class microcontroller and which on a Raspberry Pi. The wish list is a remote antenna switch (about six ports, 12 V relays), rotator position readout and control, PTT sequencing for an amplifier, and some logging and web control from elsewhere in the house.

My current thinking is a Pi running Hamlib (rigctld and rotctld) plus logging software, with an Arduino handling relays, sensing and PTT timing. The Pi would talk to the Arduino over USB serial with a simple line-based protocol. The appeal is that anything timing-sensitive or safety-related stays on a device that boots in milliseconds and doesn't need an operating system.

Questions I'd like opinions on:

1. Is it sensible to keep PTT and relay interlocks entirely on the microcontroller, so a hung Pi can't leave the transmitter keyed or switch an antenna under power?

2. What's the best way to deal with RF in the shack? Long relay and sensor leads near an HF antenna feel like trouble, and I'd like to plan filtering and grounding before building rather than after.

3. Are there good reasons to use a Pico or an ESP32 instead of a classic 5 V Arduino board for this?

  • Replies 2
  • Views 91
  • Created
  • Last Reply

Top Posters In This Topic

Featured Replies

Splitting the work that way is a sound approach. The usual rule of thumb is that anything with a hard timing or safety requirement shouldn't depend on a general-purpose OS. A Pi running Linux can stall on SD card I/O, throttle on undervoltage, or simply crash. If PTT, the amplifier sequence and the antenna switch interlock live on the microcontroller, the worst case is that the Pi stops sending commands. The microcontroller can then drop to a safe state: unkey, and leave the relays where they are.

Build that into the firmware. Have the Pi send a heartbeat every second or so, and if the Arduino stops seeing it, release PTT and ignore further switching requests until the link returns. Also make the Arduino refuse to change antenna relays while it senses PTT active. Hot-switching damages relay contacts and can stress the rig's final stage if the load suddenly changes. A sense line from the rig's PTT output, through an optocoupler or a transistor stage, is cheap insurance. A short delay between unkeying and switching helps too.

On the electrical side, don't drive relay coils from any GPIO pin directly. Use a transistor or driver IC with a flyback diode across each coil. Remember that Raspberry Pi GPIO is 3.3 V and not 5 V tolerant, so if you ever connect the two boards directly rather than over USB, you need level shifting. USB serial sidesteps that and also gives you galvanic separation from the Pi's own supply issues if you power the relay side separately.

On RF: assume it will get into everything, and design for it from the start. The most common symptoms are a microcontroller that resets or misreads inputs only on certain bands, or relays that chatter while transmitting. Some practical measures:

Put the controller in a metal or well-shielded enclosure where you can, and bring every wire in through a bypass capacitor (for example 100 nF in parallel with something smaller) to the enclosure or ground. Ferrite chokes on the USB cable and on the control leads to the relay box are also worth fitting early, since they're cheap and easy to add. For long runs to the antenna switch, shielded multi-conductor cable with the shield bonded at the enclosure end is better than loose hookup wire. Keep analog sensor lines, such as a rotator potentiometer voltage, short, and add an RC filter before the ADC input plus some software averaging.

Watch for ground loops as well. If the Pi's audio interface for digital modes is wired to the rig and the Pi is also bonded to other equipment, you can get hum and noise. An audio isolation transformer on the audio lines, or a USB sound interface with isolation, often fixes it.

As for board choice, a classic 5 V Uno or Nano style board is simple and tolerant of sloppy wiring, and the large library ecosystem is handy. A Pico or ESP32 gives you more speed, more I/O and, on the ESP32, Wi-Fi, but they run at 3.3 V and need more care with level shifting. Wi-Fi radios inside an RF-noisy shack that you're also trying to keep quiet is a trade-off in its own right. For this project, a wired microcontroller plus a Pi on Ethernet is probably the less troublesome combination.

One more Pi detail: use a good power supply and consider a read-only root filesystem or an overlay setup, since a shack that loses mains power without warning is hard on SD cards.

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.