Shack automation split: what belongs on the Pi, what on a Pico or ESP32, and how to keep RF out of it
- Replies 2
- Views 19
- Created
- Last Reply
Top Posters In This Topic
-
Admin_Terry 1 post
-
Admin_Lee 1 post
A better way to browse. Learn more.
A full-screen app on your home screen with push notifications, badges and more.
Let's discuss architecture for a shack automation setup, because many projects in this area go wrong in the same few places. The goal is a Raspberry Pi plus one or more microcontrollers handling CAT rig control, an antenna switch, a rotator controller, an SWR/power readout, and maybe a Direwolf APRS station. The question is which jobs go on which board.
One common split is to let the Pi do the software-heavy work and let microcontrollers do anything that needs hard timing or direct hardware I/O. On the Pi side, Hamlib's
rigctldis a convenient CAT broker. It talks to the radio once, then exposes a TCP interface (default port 4532) so logging software, a web page, and a small ESP32 display client can all ask for frequency and mode without fighting over the serial port. Direwolf also fits here. It needs an audio interface, a PTT method (GPIO, a CM108-style USB audio GPIO pin, or serial RTS/DTR), and it exposes KISS over TCP (8001) and AGW (8000) for APRS clients.On the microcontroller side, a Pico or ESP32 suits things like relay drivers for an antenna switch, a CW keyer, a rotator's pulse or analog interface, and an Si5351 VFO or signal source. These benefit from simple, predictable firmware rather than a full OS that can hang or corrupt an SD card.
Here are some specific points I'd like to compare notes on:
1. Logic levels and CAT interfaces. The Pico and ESP32 are 3.3 V devices and their GPIOs are not 5 V tolerant. Many rigs and accessory ports use different signalling. Icom CI-V is a single-wire, open-collector style bus with addressed devices. Kenwood-style CAT uses ASCII commands terminated with a semicolon, such as
FA;to query VFO A. Some Yaesu rigs use TTL-level serial on a mini-DIN, and others present USB serial. Check the radio's manual for the actual electrical levels before wiring a board straight to the port. A transistor or proper level shifter is cheap insurance, and a MAX3232-type chip is the usual fix if a port is genuinely RS-232.2. RF getting into the controller. High-impedance inputs, I2C lines, and long USB or serial cables make excellent antennas. Typical symptoms are an LCD that shows garbage during transmit, a keyer that sends random dits, or an ADC reading that jumps with power level. Standard measures include a metal enclosure bonded to the station ground, ferrite chokes on every cable leaving the box, bypass capacitors close to the module's supply pins, short I2C runs with sensible pull-ups, and series resistors on lines going off-board. Ferrite choice matters: mix 31 is common for HF common-mode chokes, and a few turns through the core beat one pass.
3. Antenna switch safety. Software shouldn't be the only thing standing between your transmitter and an open or wrong antenna port. Decide what the switch does at power-up and on a firmware crash, for example defaulting to a known-good antenna or grounding unused ports. Add a PTT-sense interlock so the controller refuses to change relays while transmitting. Don't forget flyback diodes on relay coils and separate supply decoupling so relay current doesn't brown out the microcontroller.
4. SWR and power metering. A bridge or directional coupler followed by diode detectors is simple, but diodes are nonlinear at low levels and need calibration across the power range. A log detector such as an AD8307 gives wider dynamic range. Remember SWR is derived from reflection coefficient: ρ = √(Pr/Pf), and SWR = (1+ρ)/(1−ρ). On SSB the reading follows voice peaks, so sample quickly and hold the peak or just meter on a carrier.
5. Si5351 as a source. It's I2C at address 0x60 and its outputs are square waves, so a low-pass filter is needed for any transmit use. Calibrating the correction against the reference crystal (25 or 27 MHz, depending on the module) is worthwhile because frequency error scales with the output frequency.
What split of Pi versus microcontroller have you found most robust, and where do you draw the line on putting safety logic in firmware versus hardware?
Link to comment
https://www.hamradiobase.com/forums/topic/11706-shack-automation-split-what-belongs-on-the-pi-what-on-a-pico-or-esp32-and-how-to-keep-rf-out-of-it/Share on other sites