Arduino or Raspberry Pi for shack automation? Where to draw the line between real-time I/O and the "smart" layer
- Replies 2
- Views 45
- Created
- Last Reply
Top Posters In This Topic
-
Brazil Ham 1 post
-
Sarah Moore28 1 post
A design question that comes up in a lot of ham radio builds: when you want to automate something in the shack (antenna switching, rotator control, PTT sequencing, band-decoder outputs, remote power control, a station status display), do you reach for an Arduino-class microcontroller, a Raspberry Pi, or both? The answer is usually "both, with a clear division of labor," but the reasons matter more than the slogan.
Here is one way to split it. The microcontroller handles anything that needs predictable timing or direct hardware contact: driving relays through transistor or driver-array stages, reading an analog forward/reflected power detector, stepping a motor, generating a clock with something like an Si5351, or sequencing PTT, amplifier keying and a sequencer delay. It boots in milliseconds, has no filesystem to corrupt, and fails in simple ways. The Pi (or any small Linux board) handles the things that benefit from an OS: running Hamlib's rigctld and rotctld, logging, a web interface, MQTT, WSJT-X or Direwolf, and scheduling. The two talk over USB serial, I2C or MQTT with a simple documented command set.
Some practical points worth discussing:
Logic levels. Raspberry Pi GPIO is 3.3 V and is not 5 V tolerant, while many classic Arduino boards run at 5 V. Connecting a 5 V output straight to a Pi input is a common way to damage a pin. Use a level shifter or a voltage divider on inputs, and remember Pi GPIO pins can only source or sink a small current, so never drive a relay coil directly from one.
Inductive loads. Relay coils need a flyback diode (or a driver IC with built-in clamps). Coax relays, antenna switches and rotator control lines can generate nasty transients, and a microcontroller reset at the wrong moment while a relay is hot-switching RF is a good way to hurt a PA.
RF in the shack. Keying a transmitter near a bare microcontroller board with long unshielded wires is a classic recipe for random resets, garbled serial data and phantom button presses. Typical mitigations are ferrite chokes on USB and I/O leads, bypass capacitors at the I/O pins, shielded enclosures, short wiring, decent grounding, and optocouplers or relays to isolate PTT and keying lines. It is better to test at full power on the bench with the actual antenna situation before you trust it.
Audio and ground loops. If the Pi is running digital modes through a USB sound interface, hum and noise can come from ground loops between the computer, rig and interface. Audio isolation transformers and an interface with galvanic isolation help. Treat CAT and audio as separate issues when troubleshooting.
Reliability of the Pi. SD cards can be damaged by power loss during writes. For an unattended station, consider a read-only or overlay root filesystem, a proper shutdown routine, a good power supply, and logs written elsewhere. For the critical safety logic (for example "never switch the antenna relay while keyed"), keep it in the microcontroller or in hardware interlocks, not in a script on a general-purpose OS.
What split of responsibilities has worked for you, and which tasks do you think should never live on the Linux side? I'm especially interested in how people handle safe default states when a controller loses power or crashes mid-operation.
Link to comment
https://www.hamradiobase.com/forums/topic/10688-arduino-or-raspberry-pi-for-shack-automation-where-to-draw-the-line-between-real-time-io-and-the-smart-layer/Share on other sites