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 0 Quiet
X-Ray B1.3
Wind 336.5 km/s
Aurora 2
Updated 07:00 UTC HamQSL · N0NBH
Day 80/40m Good 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 draw the line between microcontroller and Linux

ci_cover.jpg

Many shack automation projects start with the same question: should this be an Arduino-class microcontroller or a Raspberry Pi? Typical jobs are antenna switching, band-decoder outputs, rotator control, PTT sequencing, SWR and power logging, remote power switching, and digital-mode interfaces. The answer is rarely one or the other. A split that often works is to put anything time-critical or safety-related on a microcontroller and anything involving networking, logging, or a UI on the Pi.

Here is how I would break it down. A microcontroller is good for reading a band-data line or BCD input from the radio and switching relays, for TX/RX sequencing, and for reading ADC values from a directional coupler. It boots in milliseconds, has no filesystem to corrupt, and does the same thing every time. A Pi is better for running Hamlib's rigctld, logging software, a web dashboard, MQTT, or a digital-mode stack, where you want a full OS and a network connection.

Some practical points deserve attention before choosing parts. Raspberry Pi GPIO is 3.3 V and is not 5 V tolerant, so a 5 V logic output from a rig or an older Arduino board can damage a pin. GPIO pins should never drive a relay coil or a rig's PTT line directly. Use a transistor, MOSFET, or optocoupler, and put a flyback diode across any relay coil. And in an RF environment, layout and filtering matter as much as the code: ferrites on cables, bypass capacitors at connectors, short leads, and a metal enclosure where practical.

What would you want to hear from people who have already automated parts of their stations? Specifically: where do you draw the line between the microcontroller and the Pi, and what failure modes should be handled in hardware rather than software?

  • Replies 1
  • Views 96
  • Created
  • Last Reply

Top Posters In This Topic

Featured Replies

A good rule is that anything that could damage equipment if the software hangs should have a hardware fallback. Take an amplifier and preamp sequencing example. If a Pi or Arduino sets the relays in the wrong order, or freezes with PTT asserted, you can end up hot-switching a relay or transmitting into an unselected antenna. A hardware timeout, a watchdog, or an interlock that only allows the PA to key when the antenna relay's feedback contact confirms its position gives you protection that does not depend on code behaving.

For the Pi, the usual sticking points are the SD card and the power supply. A shack can lose power or a supply can sag, and a Pi can then corrupt its filesystem. Using a good-quality supply, a read-only root filesystem for appliance-style builds, or at least keeping logs on separate storage, helps a lot. A microcontroller in a closed loop with the relays does not have this issue, so the station still switches properly even if the Pi is rebooting.

On PTT specifically, a small optocoupler or a transistor stage into the rig's PTT line (checking the rig manual for the voltage and current on that pin) is safer than connecting a GPIO directly. It also isolates the control circuit from ground differences between the rig and the computer, which is a common cause of hum and odd behaviour.

One thing that often gets overlooked is RF getting into the control electronics. Symptoms include an Arduino resetting when you key up on 80 m, ADC readings that jump when the PA is on, or a USB serial port that drops out. Common fixes are ferrite chokes on the USB and sensor cables, 0.1 µF ceramic and small RF bypass capacitors close to the inputs on analog lines, and keeping the control box away from the feedline or antenna tuner. A metal enclosure with feedthrough capacitors or filtered connectors is better than a bare board with long wires hanging off it.

If you are building an SWR or power meter on an Arduino ADC, remember that the diode detector is nonlinear, especially at low levels, so it needs calibration against a known meter or dummy load rather than a simple formula. Averaging several samples helps against noise, and you should check the input never exceeds the ADC reference. The Pi has no built-in analog inputs, so you would need an external ADC anyway, which is another reason to let a microcontroller handle sensing and send the readings to the Pi over serial or I2C.

For CAT control, running Hamlib on the Pi and keeping the Arduino for the switching is a clean split. Level converters matter here too, since many older rigs use RS-232 or TTL-level CI-V style buses and a USB-serial adapter that does not match the voltage levels can cause both frustration and damage.

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.