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 99
SN 26
A 6
K 0 Quiet
X-Ray B2.3
Wind 412.9 km/s
Aurora 1
Updated 14: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

Keeping RF out of ESP32 and Pico shack controllers: CAT, PTT, antenna switch and rotator interfaces

ci_cover.jpg

I'd like to collect practical notes on a problem that shows up in almost every shack automation project: the microcontroller works fine on the bench, then misbehaves once the rig is on the air. Typical symptoms are a Pico that resets on SSB peaks, an ESP32 that drops Wi-Fi on 40 m, a CAT link that fills with garbage during TX, or a relay board that clicks on its own.

Here is a rough sketch of the kind of system I mean. A Raspberry Pi runs Hamlib's rigctld and Direwolf for APRS or packet. An ESP32 or Pico handles the antenna switch relays and reads rotator position. A Si5351 provides a VFO or a test signal, and a small LCD or OLED shows status. Each of these parts has its own interface traps.

For CAT, the first question is always the voltage level. Many rigs use 5 V TTL-style serial, an Icom-style CI-V single-wire open-collector bus, or true RS-232 levels. An ESP32 and a Pico are 3.3 V devices. Don't assume the pins tolerate 5 V, and check the datasheet for the exact part. A proper level shifter or a transistor/resistor interface is cheap insurance. A USB CAT port is often the easiest route, but it brings its own ground loops and common-mode noise on the cable.

For PTT with Direwolf, the usual options are a GPIO line driving a transistor or optocoupler, serial RTS/DTR, or the GPIO on a CM108-type USB sound adapter. Whatever you choose, make sure a crashed program can't leave the rig keyed. A hardware watchdog or a pull-down on the PTT driver is worth having, and so is a timeout on the rig itself if it offers one.

What are the most reliable approaches for isolation, grounding, filtering and layout? I'm especially interested in what holds up with a 100 W HF station and antennas close to the house, not only QRP.

  • Replies 2
  • Views 45
  • Created
  • Last Reply

Top Posters In This Topic

Featured Replies

  • Moderators

Treat the cables as antennas first and the code second. Most of these failures come from RF getting onto the USB cable, sensor lead, rotator cable or relay control wiring and then being rectified inside a chip. A few ferrite cores on a lead rarely fix that on their own, but they help when the type matches the band. Common-mode chokes made from several turns of the cable through a suitable mix (31 is a popular choice for HF) usually do better than a single clip-on bead.

The same goes for sensor and rotator wiring. Put a small series resistor and a bypass capacitor right at the microcontroller pin, and keep the capacitor lead short. For a rotator position pot, an RC filter plus averaging many ADC samples in software cleans up a lot of jitter. If you use the ESP32's built-in ADC, remember that it's not especially linear and that ADC2 can conflict with Wi-Fi. An external ADC like an ADS1115 over I2C is often easier for position feedback.

Also separate the supplies where you can. Relay coils, rotator motors and the logic should not all share one thin wire and a single regulator. Put flyback diodes across relay coils, and drive the coils through a ULN2003-type driver or a MOSFET, not straight from a GPIO pin.

  • Moderators

On the Pi side, Direwolf is mostly about audio levels and PTT discipline. Start by running it with the radio's data or audio output set conservatively and watch the audio level it reports for received packets. The Direwolf documentation gives a rough target for the received level, so check it against your own setup instead of guessing. On transmit, overdriving the audio input is a common mistake. It makes a wide, distorted signal that decodes worse and annoys the neighbours on the frequency.

For an antenna switch, a small microcontroller makes sense, but the safe default state matters more than the clever part. Decide what the relays do on power loss or reset, and make sure it can't connect a transmitter to an unintended antenna or leave an open feedline. Switching under power is hard on relay contacts. If your switch doesn't interlock with PTT, add an inhibit line or have the controller only change antennas when the rig is not transmitting.

For a Si5351 used as a signal source, remember the outputs are square waves, so they carry strong harmonics. Add a low-pass filter for the band in use before it goes near a receiver or a transmit chain. Calibrate the crystal offset against a known reference, since the default correction is rarely perfect. Keep the I2C lines short, and consider shielding the module if it sits near the LCD and Pi, since both can be noisy.

Lastly, for soldering: a ground-plane layout on a proper PCB, or dead-bug construction over copper clad, usually beats a loose perfboard rat's nest for anything RF. A clean joint with the right flux matters more than a very hot iron.

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.