6.8 KiB
6.8 KiB
Hardware Wiring & Interface Schematic
ESP32 Amateur Radio Parrot (Simplex) Repeater
This document provides the complete hardware pinout, isolation circuits, and connection schematics between the ESP32 controller and your amateur radio transceiver (handheld or mobile base station).
1. ESP32 Controller Pinout
| ESP32 Pin | Function | Direction | Description |
|---|---|---|---|
| GPIO 23 | PIN_PTT |
Output (Active HIGH) | Controls PTT optocoupler to key the radio transmitter |
| GPIO 22 | PIN_COS_SQUELCH |
Input (Pullup Active LOW) | Optional: Hardware squelch from radio (if available) |
| GPIO 34 | PIN_AUDIO_IN |
Analog Input (ADC1_CH6) | Audio from radio speaker jack (via DC bias & 10µF cap) |
| GPIO 25 | PIN_AUDIO_OUT |
Analog Output (DAC1) | Audio to radio microphone input (via low-pass filter & trimpot) |
| GPIO 2 | PIN_LED_STATUS |
Output | Onboard LED: lights up when PTT is keyed |
| GND | Ground | Common | ESP32 digital/analog ground |
| VIN / 5V | DC Power | Input | 5V DC power supply (minimum 1A recommended) |
2. Complete Interfacing Schematic
==============================
ESP32 CONTROLLER BOARD
==============================
|
| GPIO 23 (PTT Output)
v
[ 330Ω ]
|
+------+------+
| PC817 |
| OPTOCOUPLER|
+------+------+
| | |
GND <--+ | +--> RADIO PTT LINE
+---------> RADIO GND (PTT Ground)
-----------------------------------------------------------------------------------------
AUDIO RECEIVE (RADIO SPEAKER OUT -> ESP32 ADC)
-----------------------------------------------------------------------------------------
Radio Speaker Out (+) ----+
|
[ 600:600Ω ] (Audio Isolation Transformer - breaks ground loops)
|
Radio Audio GND ----------+
| (Transformer Secondary)
+----[ 10µF Cap ]----+
| |
ESP32 GND ----------------+ +----> GPIO 34 (ADC1)
|
[ 100kΩ to 3.3V ]
|
[ 100kΩ to GND ]
(Biases input to ~1.65V DC)
-----------------------------------------------------------------------------------------
AUDIO TRANSMIT (ESP32 DAC -> RADIO MIC IN)
-----------------------------------------------------------------------------------------
GPIO 25 (DAC1) ----[ 1kΩ Resistor ]----+
|
[ 10nF Cap ] ---> ESP32 GND (RC Reconstruction Filter)
|
v
[ 10kΩ Trimpot ] (Adjusts output drive level)
|
v (Wiper)
+------+------+
| 600:600Ω | (Audio Isolation Transformer)
+------+------+
|
+------------> RADIO MIC IN (+)
+------------> RADIO MIC GND (-)
3. Detailed Subsystems & Component Values
A. PTT Transmitter Keying (Optocoupler Isolated)
- Optocoupler: PC817 (or 4N25 / 4N35 / EL817)
- Anode Resistor: 330 Ω (limits current from GPIO 23 to ~6.5 mA)
- Emitter: Connects to Radio Ground (PTT Return)
- Collector: Connects to Radio PTT pin
- Operation: When ESP32 sets GPIO 23 HIGH, the optocoupler transistor conducts, pulling the radio PTT line to ground and keying the transmitter. The radio chassis is completely galvanically isolated from the ESP32.
B. Rx Audio Input Conditioning (Audio Jack -> GPIO 34)
- DC Blocking Capacitor: 10 µF (Electrolytic or ceramic, rated 16V+)
- DC Bias Divider: 2× 100 kΩ resistors (one to 3.3V, one to GND). This holds the ADC input at 1.65V so the full AC audio waveform can swing without negative voltage clipping.
- Audio Transformer: Generic 600:600 Ω red audio transformer (Bourns LM-NP-1001 or equivalent). Highly recommended to eliminate hum and high-frequency RF feedback.
C. Tx Audio Output Conditioning (GPIO 25 -> Radio Mic)
- Reconstruction Filter: 1 kΩ resistor + 10 nF capacitor forming a low-pass filter at ~16 kHz to smooth DAC quantization steps.
- Level Attenuator: 10 kΩ miniature potentiometer (trimpot). Radio microphone inputs are sensitive (typically 10 mV – 50 mV RMS). The ESP32 DAC outputs 0–3.3V peak-to-peak. Adjust the trimpot until your replayed voice is loud and clear without over-modulating (splatter).
- Audio Transformer: 600:600 Ω isolation transformer.
4. Kenwood / Baofeng 2-Pin (K-Plug) Connector Pinout
Most handhelds (Baofeng UV-5R / BF-888S / UV-K5, Kenwood, Wouxun, AnyTone) use the standard K-Plug:
3.5 mm TRS (Speaker) 2.5 mm TRS (Microphone / PTT)
==================== ============================
[ Tip ] : Rx Audio Out [ Tip ] : +3.3V (Unused)
[ Ring ] : Not Connected [ Ring ] : Mic Audio In (+)
[ Sleeve]: Audio Ground [ Sleeve]: PTT & Ground
- To key PTT on Baofeng/Kenwood: Connect the 2.5mm Sleeve to the 2.5mm Ring (via the PC817 optocoupler).
- Audio In to ESP32: Connect to 3.5mm Tip and 3.5mm Sleeve.
- Audio Out to Radio: Connect to 2.5mm Ring and 2.5mm Sleeve.
5. RF Immunity Guidelines for Repeaters
- Snap-on Ferrite Chokes: Place at least two snap-on ferrite chokes (Type 43 or 31) on the audio cable right where it enters the ESP32 enclosure.
- Metal Enclosure: House the ESP32 and interface board inside an aluminum or shielded box to prevent transmitter RF desensitizing the ESP32 or locking up the Wi-Fi chip.
- Antenna Separation: Keep the transceiver antenna at least 1–2 meters away from the microcontroller board whenever possible.