Keeping RF out of ESP32 and Pico shack controllers: CAT, PTT, antenna switch and rotator interfaces
- Replies 2
- Views 32
- Created
- Last Reply
Top Posters In This Topic
-
Admin_Terry 1 post
-
Mod_Mike 1 post
A better way to browse. Learn more.
A full-screen app on your home screen with push notifications, badges and more.
I'd like to compare notes on a design problem that comes up in almost every shack automation build. The code works fine on the bench, then the project misbehaves once the rig is on the air. Typical symptoms are a USB serial port that drops mid-transmission, a rotator reading that jumps, a relay that chatters, or a microcontroller that resets on SSB peaks but not on FT8 at low power.
Take a simple system. An ESP32 or Pi Pico switches a 4-way antenna relay box, reads rotator position from a potentiometer, and talks to the rig by CAT. A Raspberry Pi runs Hamlib's rigctld so logging software can reach the radio over TCP, usually port 4532. Even this basic setup has several weak points.
First is the CAT interface. Rigs differ a lot here. Icom CI-V is a single-wire, open-collector style bus with a configurable address. Many Yaesu radios use TTL-level serial. Some Kenwood models present true RS-232 levels on a DB9, which needs a MAX3232-type converter and must never go straight to a 3.3 V GPIO. Both the ESP32 and the Pico are 3.3 V devices and are not 5 V tolerant, so check the rig's manual for levels before wiring anything. A USB CAT cable is often the easiest route, but it also gives RF a long cable to travel on.
Second is PTT and keying. Driving them straight from a GPIO is tempting, but a transistor or optocoupler stage gives you isolation and protects the pin. Add a small RC filter and keep the wiring short. Most people also want a hardware or software timeout so a crashed controller can't leave the transmitter keyed.
Third is the analog side. The Pico's ADC is 12-bit and noisy unless the supply and reference are well filtered. The ESP32's ADC is nonlinear and needs calibration, and ADC2 can't be used while Wi-Fi is active. For a rotator potentiometer, a 0.1 µF cap at the pin, a series resistor, and software averaging or median filtering make a big difference.
My question for the group is where you draw the line between fixing this with hardware and fixing it in firmware. Is it enough to put ferrites and a metal enclosure around the controller, or do you go further with optical isolation on every external line? And how do you handle fail-safe states, such as what the antenna switch does when the controller resets?
Link to comment
https://www.hamradiobase.com/forums/topic/11351-keeping-rf-out-of-esp32-and-pico-shack-controllers-cat-ptt-antenna-switch-and-rotator-interfaces/Share on other sites