LD-BLD-004  ·  v2.4.6  ·  published  ·  2026-03-30  ·  CC BY-SA 4.0
docs  /  build  /  libdrone — Complete Wiring and Electrical Integration Reference

About

Complete wiring and electrical integration reference for libdrone Pro. Covers wire selection physics (AWG, resistance, current capacity), power domain architecture, signal routing, GX12-7 payload connector wiring, EMC discipline, and a full verification checklist. Wiring is not just connectivity — it is EMC engineering, power integrity, and signal fidelity expressed in copper.

About

This document is a libdrone Complete Wiring and Electrical Integration Reference

libdrone — Wiring and Electrical Integration

Version 0.2 — Complete Reference

Wiring is not just connectivity. It is EMC engineering, power integrity, and signal fidelity all expressed in copper. A poor wire run turns a good flight controller into a noisy gyro. A well-run build flies on the first attempt and stays that way.

libdrone wiring follows three principles that do not bend:

  1. Separate power and signal by 20 mm minimum — the Platform provides dedicated routing zones for this reason.
  2. Twist power pairs, star every ground, solder capacitors directly on pads — not on pigtail wires.
  3. Route per physics — shortest path for high-current spikes, longest practical separation for antennas, strict zone discipline for everything in between.

Wire Selection — The Physics Behind the Gauge

AWG (American Wire Gauge) is the universal standard for wire sizing in drone builds. The numbering is counterintuitive: lower number = thicker wire = lower resistance = more current capacity. A 12 AWG wire is roughly four times the cross-sectional area of 20 AWG.

Why gauge matters: resistance, heat, and voltage drop

Every wire has resistance proportional to its length and inversely proportional to its cross-sectional area. When current flows through resistance, power is dissipated as heat (P = I$^2$ × R) and voltage drops across the wire (V = I \times R). Both matter on a drone.

A voltage drop on the ESC power feed means the motor receives less voltage than the battery provides — effective throttle is reduced and efficiency falls. A voltage drop on the 5V BEC feed means the FC, receiver, and GPS receive less than 5V — logic errors and resets follow. Heat from undersized wire is a fire risk and a reliability risk simultaneously.

The libdrone gauge table

AWG Diameter (mm) Resistance (mΩ/m) Continuous current Typical colour Use case
12 2.05 5.2 40 A Red / Black Battery to ESC main power
14 1.63 8.3 30 A Red / Black XT60 pigtail, ESC–PDB links
20 0.81 33 10 A Red / Black VTX power from buck, fan power
22 0.64 53 5 A Red / Black / Yellow BEC 5V rails, sense wires
24 0.51 84 2.5 A Blue / Green DShot signal, short UART runs
28 0.32 213 0.8 A Blue / Green UART signal, I2C, GPS, payload

Worked example — battery lead voltage drop: At 40 A through 10 cm of 12 AWG (one way, so 20 cm total round trip):

R_total = 0.2 m × 5.2 mΩ/m = 1.04 mΩ
V_drop  = 40 A × 0.00104 Ω = 41.6 mV

Negligible — this is why 12 AWG is sufficient for the battery leads at this length. Now try the same current through 10 cm of 22 AWG:

R_total = 0.2 m × 53 mΩ/m = 10.6 mΩ
V_drop  = 40 A × 0.0106 Ω = 424 mV — nearly half a volt gone as heat
P_heat  = 40² × 0.0106 = 16.96 W — enough to melt the insulation

This is not theoretical. It is why you cannot substitute a thinner wire "just for now."

Colour Code

Five colours are available. Every wire in the build follows this assignment without exception. Colour consistency means that at any point in the build — or six months later during troubleshooting — the purpose of any wire is visible without a meter.

Colour Meaning Examples
Red Positive power, any voltage Battery+, 5V BEC+, 12V buck output+
Black Ground / negative return Battery–, BEC GND, all signal grounds
Yellow Analog sense / measurement Voltage sense, current sense, ADC inputs
Blue High-speed digital signal DShot M1–M4, CRSF TX/RX, MSP UART
Green Low-speed digital / bus GPS UART, I2C SCL/SDA, payload UART

The logic: Red and black are universal power conventions — anyone who has ever held a multimeter expects them. Yellow marks signals that carry a measurement and must not be loaded or shorted — "caution, instrument wire." Blue marks fast signals where proximity to power causes corruption. Green marks slower bus signals that can tolerate somewhat longer runs but still require zone discipline.

Section 1 — Battery to ESC: The High-Current Backbone

What flows here

This is the highest-current path in the entire drone. During aggressive throttle inputs, total current draw across all four motors can reach 60–80 A instantaneously. In hover, it is typically 15–25 A. The voltage is the full 6S pack voltage: 21.0–25.2 V depending on state of charge.

This is not a signal wire. There is no information encoded in this voltage beyond "the battery is connected." What matters is getting that voltage to the ESC with minimum resistance, minimum inductance, and without radiating electromagnetic interference onto the rest of the electronics.

The wire

12 AWG, Red (positive) and Black (negative), twisted together.

Twisted because two wires carrying equal and opposite currents whose magnetic fields cancel each other at any external point. Every half-twist forces the fields to oppose. The net external field from a twisted pair approaches zero at distances greater than the twist pitch. At 1 twist per 25 mm on 12 AWG, the field at 50 mm distance is reduced by roughly 20 dB compared to untwisted wire carrying the same current. The gyroscope is measuring magnetic effects at the sub-microtesla level. Every milligauss saved on the power wiring is noise that never reaches the compass.

Keep the total run under 150 mm (battery lead + PDB + ESC feed combined). Inductance accumulates with wire length at approximately 1 µH/m for twisted pairs. At 150 mm this is 0.15 µH — tolerable. At 400 mm it is 0.4 µH. When motor current changes at 50 A/µs (a realistic throttle transient), the induced voltage spike is:

V_spike = L × dI/dt = 0.4 µH × 50 A/µs = 20 V

That 20 V spike sits on top of the 25.2 V battery voltage, delivering 45 V to the ESC MOSFETs whose rated breakdown voltage may be 40 V. The 1000 µF capacitor on the ESC pads clamps this, but only if it is close enough to respond in time.

The capacitor — why it must be on the pads, not on a pigtail

Every millimetre of wire between the capacitor and the ESC power pads adds approximately 1 nH of inductance. During a spike at 50 A/µs, each nH of series inductance adds 50 mV of unclamped voltage. At 30 mm of pigtail wire (30 nH), the capacitor arrives 1.5 V late to the party. Solder it directly on the pads. Zero pigtail. This is not a preference — it is the difference between MOSFET protection and MOSFET destruction.

Use a 1000 µF, 35 V, low-ESR electrolytic (Panasonic FM or equivalent). The "low-ESR" specification matters: standard electrolytics have ESR of 0.5–2 Ω at 100 kHz. The Panasonic FM series has ESR < 0.1 Ω at 100 kHz. A capacitor with high ESR cannot clamp a fast spike because its own internal resistance limits the current it can sink. The spike sees the ESR as a resistor in series with the capacitance, and the voltage across the MOSFET = spike voltage \times ESR / (ESR + Z_cap) — a high ESR means most of the spike still reaches the MOSFET.

Wiring map

XT60 connector (battery)
  │
  ├── RED (12 AWG) ─────────────────── ESC VBAT pad ──► 1000 µF cap (+) on pad
  │     twisted together ↕
  └── BLACK (12 AWG) ──────────────── ESC GND pad ───► 1000 µF cap (–) on pad

Sense wires (voltage and current monitoring)

Wire Colour AWG From To What flows
VBAT sense Yellow 22 PDB V+ pad FC VBAT_SENSE DC voltage, 21–25 V scaled via resistor divider to 3.3 V ADC range. No significant current — this is a measurement, not a power feed.
Current Yellow 22 PDB shunt FC CURR_SENSE Tiny voltage across a 1 mΩ shunt resistor. At 40 A: 40 A \times 0.001 Ω = 40 mV. The FC's ADC measures this millivolt signal and calculates amps consumed.

Both sense wires are yellow — they are measurement signals, not power. Keep them in the signal zone. Do not bundle them with the 12 AWG power wires. A sense wire lying against a high-current power wire picks up switching transients by inductive coupling and reports phantom current spikes that corrupt the battery consumption telemetry.

Testing this section

Before connecting the battery for the first time:

  1. Continuity — shorts check: Set multimeter to continuity mode (beep). Probe between the XT60 positive and negative pins. It must be silent — any tone means a short circuit somewhere in the power distribution. Do not connect the battery until this test passes.

  2. Continuity — correct polarity: Probe from XT60 positive to each ESC VBAT pad. Should beep (connected). Probe XT60 positive to each ESC GND pad. Should be silent (no connection between positive and ground at any ESC). Repeat for XT60 negative to ESC GND pads (beep) and XT60 negative to ESC VBAT pads (silent).

  3. Resistance — voltage drop measurement: Set multimeter to DC millivolts. Connect a known load (or use a bench power supply at safe voltage). Probe from XT60 positive to each ESC VBAT pad while current flows. Drop should be under 100 mV at 10 A — if higher, the solder joint has high resistance. Resolder.

After connecting the battery (motors disconnected, props OFF):

  1. Voltage verification: Multimeter DC volts between ESC VBAT and ESC GND on each ESC. Should read battery voltage ± 0.1 V. Significant discrepancy means a high-resistance connection in the power path.

  2. Sense wire calibration: In Betaflight Configurator → Power & Battery tab. With battery connected, the voltage reading should match a multimeter placed directly at the XT60. If it reads incorrectly, adjust the voltage scale factor in Betaflight to match.

Section 2 — ESC to Motors: Three-Phase Power

What flows here

Three wires per motor, each carrying alternating current that the ESC synthesises from the DC battery supply. The waveform is not a sine wave — it is a trapezoidal approximation created by switching the MOSFETs at 48 kHz. The peak voltage equals the battery voltage (up to 25.2 V). The current per motor at full throttle is 40–55 A on libdrone Pro.

These are the noisiest wires on the drone. The high-frequency switching creates strong electromagnetic fields. Every 48 kHz switching cycle sends a broadband electromagnetic pulse out from these wires at harmonics extending into the megahertz range. They must be kept as far as possible from the gyroscope, compass, GPS antenna, and receiver.

The wire

18–20 AWG, no fixed colour convention for the three phases — use heatshrink labels instead (A, B, C or M1A, M1B, M1C). Colour-coding motor phase wires by phase letter across all four motors is more useful than assigning colours by motor position.

Run the three phase wires for each motor twisted together as a group — ~1 twist per 15 mm. Three wires carrying balanced three-phase currents cancel their magnetic fields similarly to a twisted pair, though the cancellation is less perfect (three-phase balancing reduces field by roughly 15 dB rather than the 20 dB of a twisted pair). Still worth doing.

Route through the arm cable groove. The groove keeps the wires mechanically protected and away from the propeller arc. Do not allow motor wires to float free outside the arm — they will eventually contact a spinning propeller.

Wiring map

ESC phase pad A ── (twisted together) ── Motor terminal A
ESC phase pad B ─┤                     ├ Motor terminal B
ESC phase pad C ── (twisted together) ── Motor terminal C

Motor rotation direction is determined by which two of the three wires are swapped. In AM32, direction can also be reversed in firmware — but physical wire swap is more reliable as it requires no software state. Establish direction physically at build time; use AM32 only for the final correction if one motor runs backwards after the physical swap sequence.

Testing this section

With battery connected, props OFF, in Betaflight Motors tab:

  1. Spin test — each motor individually: Increase the motor slider for M1 slowly from zero. The motor should begin spinning smoothly. No grinding, no hesitation at low throttle, no vibration audible as a tone (a tone at a specific RPM indicates a resonance — check propeller balance before flying). Repeat for M2, M3, M4.

  2. Direction check: Each motor must spin in the correct direction for its position. Standard libdrone "Props In" configuration (all four motors spin inward toward the centre of the drone when viewed from above):

  3. Front-Left (M1): Clockwise
  4. Front-Right (M2): Counterclockwise
  5. Rear-Right (M3): Clockwise
  6. Rear-Left (M4): Counterclockwise If any motor spins the wrong direction, swap any two of its three phase wires.

  7. eRPM telemetry check: Enable BiDi DShot in Betaflight if not already done. In the Motors tab, spin each motor and verify that the RPM reading updates as throttle changes. If a motor shows 0 RPM while spinning, BiDi DShot is not configured or the ESC firmware does not support it.

  8. Twist effectiveness — oscilloscope optional: If an oscilloscope is available, probe from motor phase wire to chassis ground with the motor at half throttle. The 48 kHz switching waveform should be visible. Then probe the gyroscope power supply on the FC. With properly twisted motor wires routed in the power zone, the switching interference on the gyro supply should be below 20 mV peak-to-peak. If higher, recheck wire routing and twist pitch.

Section 3 — Flight Controller: 5V BEC Distribution

What flows here

The FC's internal BEC (Battery Eliminator Circuit) outputs a regulated 5.0 V from the 6S battery. Maximum current is approximately 2 A continuous, 3 A peak. Everything that runs from this rail — the receiver, the GPS module, the cooling fan — shares this budget.

Consumer Typical current Peak current
FC itself 200 mA 400 mA
RP2 receiver 50 mA 80 mA
M10Q GPS 50 mA 120 mA
Gdstime fan 150 mA 200 mA
GX12 payload 500 mA 2000 mA
Total ~950 mA ~2800 mA

The 2 A continuous limit is comfortably met in normal operation. With a maximum-draw payload connected, the peak approaches the limit — monitor FC temperature on long missions.

The wire

22 AWG, Red (5V+) and Black (GND). This rail carries logic-level voltage to sensitive devices. Any noise on this wire appears as power supply ripple on the FC, receiver, and GPS. Keep it short and do not bundle it with the high-current power wires.

Wiring map

FC 5V pad ──── RED (22 AWG) ─────┬── RP2 VCC
                                  ├── M10Q VCC
                                  └── Fan VCC (hardwired, always on)

FC GND pad ── BLACK (22 AWG) ────┬── RP2 GND  ──► star to PDB GND
                                  ├── M10Q GND
                                  └── Fan GND

DShot signal wires (M1–M4)

Wire Colour AWG From To What flows
M1–M4 Blue 24 FC motor pads ESC signal pads DShot600 digital pulses at 600 kbit/s. Logic high = 3.3 V, logic low = 0 V. One 16-bit packet per PID loop cycle (125 µs at 8 kHz). In BiDi mode, the ESC responds in the gap between FC transmissions with eRPM data on the same wire.

Blue because DShot is a high-speed digital signal that must be kept in the signal zone, away from all power wiring. Maximum length: 100 mm. Beyond this, the wire's distributed capacitance and inductance begin to round the signal edges, increasing bit error rate. The 4-bit CRC in each DShot packet will catch most errors and discard the packet, but repeated packet loss degrades motor responsiveness.

Testing this section

  1. BEC voltage measurement: With battery connected and no payload, multimeter between the 5V pad and any GND pad on the FC. Should read 4.95–5.05 V. Below 4.85 V indicates either high current draw or a weak solder joint in the BEC output path.

  2. BEC load test: Connect the GPS and receiver, then remeasure 5V. Voltage should not drop more than 50 mV under normal load. A large drop (>100 mV) indicates excessive resistance in the 5V distribution wiring or a marginal BEC.

  3. DShot signal integrity: In Betaflight Configurator → Motors tab, check that all four motor outputs are responsive and that BiDi telemetry (RPM) is visible when motors spin. An unresponsive motor output that works when the wire is repositioned indicates a borderline signal edge from a wire that is too long or routed too close to a power wire.

Section 4 — ELRS Receiver (RadioMaster RP2)

What flows here

Two UART signal wires (TX and RX) carrying CRSF protocol at 420,000 baud. CRSF packets are 64 bytes, sent at 250 Hz — one packet every 4 ms. Each packet contains 8 RC channels at 11-bit resolution, plus link quality statistics (RSSI, SNR, packet loss rate).

The signal voltage is 3.3 V logic level. The current through each signal wire is negligible — a few milliamps at most. The sensitivity of these wires is not to current damage but to noise pickup: the RP2 receiver is trying to decode digital pulses with a threshold at 1.65 V (half of 3.3 V). A noise spike of 0.5 V riding on the wire could be misread as a data transition, corrupting the RC channel data, producing twitching motors or false arming states.

The wire

28 AWG, Blue (CRSF TX and RX signals), Red (5V power), Black (GND).

The CRSF TX and RX wires should be twisted together as a pair. This may seem odd — they carry signals in opposite directions and are not a differential pair — but the act of twisting places each wire in close proximity to a wire at a similar potential, reducing the effective loop area that can pick up interference. Even modest twisting (1 per 20 mm) measurably reduces noise pickup on 28 AWG signal wires in a drone environment.

Wiring map

FC UART3 Wire colour AWG To RP2 What flows
TX Blue 28 RX FC transmits telemetry back to receiver (flight mode, GPS position, battery for display on transmitter). 3.3 V logic, up to 420k baud.
RX Blue 28 TX Receiver transmits RC channel data to FC. 250 Hz \times 64 byte packets. The critical link — loss here loses control.
5V Red 22 VCC 50 mA steady-state, 80 mA peak during radio retransmission.
GND Black 22 GND Common reference. Must share ground with FC.

Note on TX/RX crossover: The FC's TX (transmit) connects to the receiver's RX (receive) pin, and vice versa. This is always the case for any UART connection. A common first-time error is connecting TX to TX — no data flows, the configurator shows no receiver activity. If the receiver does not appear in Betaflight after powering on, swap the two blue wires.

Testing this section

  1. Physical binding check: Power on the transmitter first, then the drone. The RP2 LED should blink rapidly (searching), then go solid or slow-blink (bound). If it remains rapid-blinking, binding has not occurred — follow the ELRS binding procedure.

  2. CRSF detection in Betaflight: Go to Receiver tab. Move each stick on the transmitter. The corresponding channel bar should move in Betaflight. If no channels move, check:

  3. UART3 is set to "Serial RX" in Ports tab
  4. Receiver mode is set to "Serial" and protocol to "CRSF" in Receiver tab
  5. TX/RX wires are not crossed incorrectly

  6. Link quality check: The Receiver tab shows RSSI (signal strength) and Link Quality. At close range indoors, RSSI should be above –90 dBm and LQ should be 100%. Values below this at close range indicate a wiring problem (loose connection, antenna not connected to RP2) rather than a range problem.

  7. Noise floor check: In Betaflight Receiver tab, with the transmitter off and the drone powered, the channel values should be stable at their failsafe positions. Any twitching or random value changes with transmitter off means noise is coupling onto the CRSF signal wires — recheck routing away from power zone.

Section 5 — GPS Module (Matek M10Q-5883)

What flows here

Two UART signal wires carrying UBX binary protocol at 57,600 baud (approximately 7,200 bytes/second). A full GNSS position packet (latitude, longitude, altitude, speed, fix quality) is approximately 100 bytes, arriving at 10 Hz. The FC reads this and updates GPS Rescue position, OSD display, and position hold setpoints.

Additionally: I2C wires carrying magnetometer data from the QMC5883 compass chip on the same module. I2C at 400 kHz, a few bytes per measurement, polled by the FC at the magnetometer's 10–100 Hz update rate.

The wire

28 AWG, Green (UART and I2C signals), Red (5V power), Black (GND).

Green for GPS because it is a lower-speed digital signal compared to DShot and CRSF, and because the GPS signal chain is particularly sensitive to magnetic interference — keeping GPS wiring visually distinct from the Blue high-speed signals helps maintain discipline during routing.

The GPS module lives at the nose of the drone on its bracket — furthest from the ESC, motors, and battery. The wire run from the Platform to the GPS bracket is therefore the longest signal run in the build, typically 150–200 mm. At 28 AWG this is still well within specifications for 57,600 baud UART and 400 kHz I2C.

The compass on the M10Q is measuring the Earth's magnetic field — approximately 50 µT in central Europe. A single motor wire carrying 20 A at 30 mm distance creates a magnetic field of approximately 130 µT at the chip location. This is why the GPS is at the nose: maximum physical separation from the power wiring. The green wires routing from the GPS toward the Platform must pass through the signal zone, never the power zone. One green wire running through the power zone next to a twisted motor wire defeats the entire geometry of the nose mount.

Wiring map

FC UART2 Wire colour AWG To M10Q What flows
TX Green 28 RX FC sends UBX configuration commands to GPS on startup (set update rate, enable EGNOS, disable GLONASS). Infrequent — only during initialisation.
RX Green 28 TX GPS sends position fixes to FC at 10 Hz. 100-byte UBX packets. The critical link for GPS Rescue and position hold.
5V Red 22 VCC 50 mA steady state; 120 mA during cold start as the GNSS receiver's RF frontend warms up.
GND Black 22 GND Shared reference. Critical for compass — compass measures voltage differences that are referenced to this ground.

The 1 MΩ GPS tap (Connector B, Pin 2): A resistor of 1 MΩ is soldered in series between the M10Q GPS TX line and Payload Connector B Pin 2. The payload's ESP32-S3 UART RX input has an internal pull-up of approximately 50 kΩ. Without the series resistor, this 50 kΩ load on the GPS TX line would pull the logic levels toward 3.3 V \times 50/(50 + Z_driver) — potentially corrupting the GPS data the FC receives. With 1 MΩ in series, the payload's pull-up only affects the GPS TX line by 3.3 V \times 50/(1000 + 50) ≈ 0.16 V — negligible. The signal the ESP32-S3 receives is slightly attenuated but remains valid at 57,600 baud. Use Green, 28 AWG for this tap wire. Label it clearly — "GPS TAP, DO NOT SHORTEN, 1MΩ IN SERIES" — because removing or bypassing the series resistor destroys GPS integrity.

Testing this section

  1. Betaflight GPS status: Connect and power on. In Betaflight Configurator → GPS tab, within 90 seconds of first power-on outdoors (cold start), the satellite count should begin increasing. After 2–3 minutes, fix should be 3D with 12+ satellites visible.

  2. Coordinate sanity check: The latitude and longitude displayed in Betaflight GPS tab should correspond to your actual location. An incorrect position (e.g., 0.000, 0.000) means the GPS module has power but the FC is not parsing UBX correctly — check baud rate setting (57,600) and that UBX protocol is selected in Betaflight GPS settings.

  3. Compass calibration check: After arming, turn the drone slowly 360° horizontally. The heading display in the OSD should rotate smoothly and consistently with the drone's physical orientation. Erratic heading means compass interference — check that the power zone wires are not running near the GPS bracket.

  4. EGNOS status: In u-blox u-center software (connected via USB before the GPS is wired to the FC), check satellite view for EGNOS SBAS satellites. At least one EGNOS satellite (PRN 120, 123, 126 for European coverage) should show a signal. If EGNOS satellites are absent, enable SBAS in the Betaflight GPS configuration settings.

Section 6 — Video System (HDZero VTX and Camera)

What flows here

Power wire (12V from XL4015 buck converter): DC power at 9–12 V, up to 400 mA continuous (higher during RF transmission at 800 mW output power). The XL4015 switches at 180 kHz to produce this regulated output. The ripple on this wire — the residual 180 kHz switching noise — must be attenuated before it reaches the VTX.

UART wires (MSP DisplayPort): Low-speed bidirectional UART at 115,200 baud carrying MSP (MultiWii Serial Protocol) DisplayPort frames. The FC sends OSD data — battery voltage, GPS position, altitude, flight mode, RSSI, arm status — as character grid updates. The VTX decodes these and overlays them on the video frame. Current through these wires: a few milliamps.

MIPI CSI-2 cable (camera to VTX): A flat flexible cable (FFC), not a wire in the conventional sense. The MIPI clock frequency is 600–900 MHz for 1080p60 video. This is not a signal to solder — it is a precision assembly to handle. The ZIF (Zero Insertion Force) connectors at each end have a latch that must be lifted before the cable can be inserted and lowered to lock it. Never force the cable without lifting the latch.

The wire

20 AWG, Red (12V+) and Black (GND) for VTX power. 20 AWG is slightly heavier than necessary for 400 mA — this is intentional. Heavier wire has lower inductance and lower resistance, which means better suppression of the 180 kHz switching noise from the XL4015. The VTX power wire also benefits from a ferrite bead — 3–4 clip-on TDK 3.5 mm ferrite clamps stacked on the wire immediately at the buck converter output. These present high impedance at 180 kHz and its harmonics while passing DC efficiently.

28 AWG, Blue (MSP TX and RX) for UART. The MSP DisplayPort signal is at 115,200 baud — slow by drone standards, tolerant of modest noise. Still route in the signal zone.

Wiring map

Source Wire colour AWG To VTX pad What flows
XL4015 out+ Red 20 VBAT 9–12 V regulated DC. 400 mA typical, 800 mA peak at full RF power. 180 kHz ripple from switching — attenuate with ferrite beads at source.
XL4015 out– Black 20 GND Power return. Star to main GND.
FC UART1 TX Blue 28 RX OSD data from FC to VTX. Character grid updates at video frame rate (60 Hz).
FC UART1 RX Blue 28 TX VTX status to FC (power level, temperature). Infrequent.

MIPI cable handling rules: * Inspect the cable for kinks or damage before installation. Replace if any crease is visible — a creased MIPI cable has unpredictable impedance at 900 MHz. * Do not exceed the minimum bend radius. For a 0.5 mm pitch 30-pin FFC, minimum bend radius is approximately 10 mm. The Platform cable channel maintains this radius. * Route through the centreline channel from camera position to VTX position without deviation into the signal or power zones. * After connecting, gently tug the cable to confirm both latches are locked.

Testing this section

  1. Voltage at VTX: Multimeter between VBAT and GND pads on the VTX with battery connected. Should read 9–12 V (depending on XL4015 adjustment). If the VTX reads lower than 7 V it will not transmit; if higher than 25 V it will be damaged.

  2. Video signal in goggles: Power on drone. Put on HDZero goggles and switch to the appropriate channel/frequency. A clear image from the camera should appear. No image means either the VTX is not powered, the antenna is disconnected, or the MIPI cable is not seated correctly. A scrambled or flickering image (not snow — that is analog) usually indicates a MIPI cable seating issue.

  3. OSD overlay present: In the video image, telemetry data should appear overlaid — battery voltage, flight mode, GPS status. If the image is clean but no OSD appears, MSP DisplayPort is not configured in Betaflight (Ports tab → UART1 → set to MSP) or the blue UART wires are swapped.

  4. Switching noise check: After all wiring is complete and the ferrite beads are installed, power on the drone and look at the OSD battery voltage reading. It should be stable to within ±0.1 V. Rapidly changing or erratic battery voltage on OSD while the drone is stationary (no throttle change) indicates 180 kHz switching noise from the XL4015 coupling into the voltage sense wires. Add a ferrite bead to the VTX power wire closer to the buck converter output and retest.

Section 7 — Payload Interface (Dual GX12-7)

7.0 Wiring Abstraction — Two Layers

The GX12 wiring is documented in two independent layers. This is deliberate: the H7A3-SLIM will eventually be replaced by another FC. When it is, only Layer 2 needs updating. Every payload ever built, and the ICD itself, targets Layer 1 — which never changes.

Layer 1 — Functional signal names (permanent, FC-agnostic):

These names are used throughout the ICD (LD-PAY-002) and in libdrone.py. They do not depend on any specific FC product.

Functional name GX12 location Direction Description
UART_CMD Conn A PIN 3 FC → Payload Commands from FC to payload
UART_TLM Conn A PIN 4 Payload → FC MSP telemetry to OSD
I2C_SCL Conn A PIN 5 FC → Payload Sensor bus clock
I2C_SDA Conn A PIN 6 Bidirectional Sensor bus data
GPS_TAP Conn B PIN 2 FC → Payload GNSS position, read-only
AUX_GPIO1 Conn B PIN 5 FC → Payload Radio switch 1
AUX_GPIO2 Conn B PIN 6 FC → Payload Radio switch 2
UART5_TX Conn B PIN 3 FC → Payload Secondary comms
UART5_RX Conn B PIN 4 Payload → FC Secondary comms return
COMPANION_TX Companion header PIN 3 FC → Pi MAVLink2 / MSP
COMPANION_RX Companion header PIN 4 Pi → FC MAVLink2 / MSP return

Layer 2 — H7A3-SLIM implementation (current reference, replaceable):

Maps functional names to physical FC pads. When the FC changes, update this table only. Everything above and below this table is unchanged.

Functional name H7A3-SLIM pad UART assignment Baud
UART_CMD UART4 TX UART4 — payload primary 115200
UART_TLM UART4 RX UART4 — payload primary 115200
I2C_SCL I2C1 SCL Hardware I2C1 400kHz
I2C_SDA I2C1 SDA Hardware I2C1 400kHz
GPS_TAP M10Q UART2 TX tap Read-only via 1MΩ 57600
AUX_GPIO1 GPIO output pad Betaflight AUX3 mapping
AUX_GPIO2 GPIO output pad Betaflight AUX4 mapping
UART5_TX UART5 TX UART5 — payload secondary configurable
UART5_RX UART5 RX UART5 — payload secondary configurable
COMPANION_TX UART6 TX UART6 — COMPANION reserved 921600
COMPANION_RX UART6 RX UART6 — COMPANION reserved 921600

7.1 What flows here

The GX12-7 connectors carry a mixture of power and multiple signal types simultaneously. The pigtail wires inside the drone run from FC pads to the base of each GX12 chimney. The design intent is that these internal wires are permanent — they are part of the drone's infrastructure. The payload-side wires (outside the drone) are replaced with each new payload design.

Connector A — Signal zone, left GX12 (X = −25 mm)

Pin Signal Wire colour AWG What flows
1 5V Red 22 Regulated 5V from FC BEC. Up to 2A continuous to payload. Any payload that draws more must include its own regulation from a separate battery or the 12V rail.
2 GND primary Black 22 Power return. Connected to star ground at ESC GND pad. All payload signal grounds reference this.
3 UART4 TX Blue 28 FC transmits MSP commands to payload — start logging, change mode, request status. 3.3V logic, configurable baud rate.
4 UART4 RX Blue 28 Payload transmits telemetry to FC for OSD display — sensor readings, payload status, error codes.
5 I2C SCL Green 28 I2C clock at 400 kHz. The FC is I2C master. Pulled up to 3.3V via 4.7 kΩ resistor on FC. Any payload I2C device must not conflict with the I2C address space already in use. SCL twisted with SDA.
6 I2C SDA Green 28 I2C data. Bidirectional open-drain. Both FC and payload device pull this line low; the pull-up resistor returns it high when released.
7 SPARE Reserved. Do not use — future expansion.

I2C SCL and SDA (pins 5 and 6) should be twisted together as a pair. I2C is not a differential protocol, but twisting the two lines reduces the loop area between them, which reduces inductive noise pickup and capacitive coupling from adjacent wires. At 400 kHz, the wire's parasitic capacitance starts to slow the rising edges — the pull-up resistors must source enough current to charge this capacitance. With 28 AWG at 200 mm run length, a 4.7 kΩ pull-up is correct. Longer runs may require 2.2 kΩ.

Connector B — Power zone adjacent, right GX12 (X = +25 mm)

Pin Signal Wire colour AWG What flows
1 GND shield Black 28 Signal ground reference for Connector B. Tied to star ground.
2 GPS TX tap Green 28 + 1MΩ resistor in series Read-only GPS feed. The 1MΩ resistor is physically located inside the drone, immediately after the tap point on the M10Q TX line. Never omit or substitute a lower value — see GPS section for the loading analysis.
3 UART5 TX Blue 28 FC secondary UART transmit. Used for payload types that prefer UART over MSP — raw GPS forwarding, camera trigger commands.
4 UART5 RX Blue 28 FC secondary UART receive. Payload secondary telemetry channel.
5 AUX GPIO 1 Blue 28 Driven high (3.3V) when pilot activates radio switch. Payload uses this to start/stop data logging without a physical button.
6 AUX GPIO 2 Blue 28 Second radio switch mapping. Camera shutter trigger, mode change, or any binary payload control.
7 SPARE Reserved.

AUX GPIO pins (5 and 6) are driven by the FC GPIO output hardware. The FC maps a radio switch channel to these pins in Betaflight configuration. The payload must not source current back into these pins — they are outputs only. If a payload needs to drive the FC's GPIO, this requires a more complex arrangement not supported in the standard interface.

Testing this section

  1. Connector A power test: With dummy plug inserted (or with payload connected but payload powered off), measure voltage at GX12-A Pin 1 relative to Pin 2. Should read 5.00 V ± 0.05 V.

  2. I2C bus scan: Connect a payload containing a known I2C device (e.g. SEN66 at address 0x6B). In Betaflight CLI, type i2c_scanner or use a dedicated I2C scanner sketch on a test Arduino. The SEN66 at 0x6B should appear. If no devices found, check:

  3. I2C is enabled on the FC for the correct hardware pins
  4. Pull-up resistors are present (either on FC or payload board)
  5. SCL/SDA not swapped at the GX12 connector

  6. GPS tap integrity: Temporarily connect the GPS tap wire to a UART-to-USB adapter set to 57,600 baud. Open a serial monitor. NMEA sentences should scroll through — you should see $GPGGA lines with position data. If no data appears, the 1MΩ resistor or the tap solder joint is open. If the FC simultaneously loses GPS, the tap is loading the line too heavily — verify the 1MΩ resistor is installed correctly.

  7. AUX GPIO test: In Betaflight, assign a switch to AUX1 and map it to a GPIO output mode. With a multimeter on Connector B Pin 5, toggle the switch. Pin 5 should swing between 0 V and 3.3 V in synchrony with the switch position.

  8. GX12 locking ring seal: With the payload connector screwed onto the drone's GX12 socket and the ring finger-tight, the IP65 O-ring should be visibly compressed. A gap between the connector faces means the ring is not fully engaged and water protection is not active. The ring should stop rotating when the seal is made — do not overtighten (aluminium threads will gall).

Section 8 — Star Ground: The Map

All grounds in libdrone meet at one point: the ESC GND pads (or the PDB GND pad directly connected to them). No ground wire connects to any other ground wire at any point along its run. All grounds flow to the star point and nowhere else.

ESC GND pads (STAR POINT)
  
  ├── Battery GND (BLACK, 12 AWG) ────────────────── XT60 negative
  
  ├── FC GND (BLACK, 22 AWG) ──────────────────────── FC GND pad
      
      ├── RP2 GND (BLACK, 22 AWG) ──────────────── RP2 GND pin
      ├── M10Q GND (BLACK, 22 AWG) ─────────────── M10Q GND pin
      └── Fan GND (BLACK, 22 AWG) ──────────────── Fan GND pin
  
  ├── VTX GND (BLACK, 20 AWG) ───────────────────── VTX GND pad (via buck converter)
  
  ├── 1000µF cap GND (BLACK, directly on pad)
  
  └── GX12-A Pin 2 (BLACK, 22 AWG) ──────────────── Payload GND
       └── GX12-B Pin 1 (BLACK, 28 AWG) ──────────── Payload shield GND

                               NEVER: VTX GND separate wire to battery
                               NEVER: GND wire running parallel to signal wire
                               NEVER: Multiple ground paths creating a loop

Why loops are deadly: A closed conductive loop is an antenna. A magnetic field passing through the loop induces a current in the loop (Faraday's law). That current creates a noise voltage at every point in the circuit referenced to that ground. On a drone, the motor wires create strong alternating magnetic fields at motor commutation frequencies (3,500 Hz for a 14-pole motor at 30,000 RPM). Any ground loop that encloses an area through which this field passes will have 3,500 Hz noise induced into it — appearing as a false gyroscope signal at a frequency the RPM filter cannot remove because it is below motor RPM range.

The star ground eliminates loops by ensuring there is only one path between any two ground points: through the star. No closed loop can form.

Section 9 — Complete Build Verification Sequence

Perform these tests in order. Do not skip ahead — each section's tests depend on the previous sections being correct.

Stage 1 — Dead build (no battery, no power)

Set multimeter to continuity mode (beep).

  • [ ] XT60+ to XT60– : no beep (would indicate short circuit — do not proceed)
  • [ ] XT60+ to each ESC VBAT pad: beep (connected)
  • [ ] XT60– to each ESC GND pad: beep (connected)
  • [ ] XT60+ to each ESC GND pad: no beep
  • [ ] XT60– to each ESC VBAT pad: no beep
  • [ ] FC 5V pad to XT60+: no beep (BEC is not a direct connection — isolation expected)
  • [ ] All GND pads connected together: beep between any two GND test points

Stage 2 — Battery connected, props OFF, motors disconnected

Set multimeter to DC volts.

  • [ ] ESC VBAT to ESC GND: reads battery voltage ±0.2V (25.2V full charge)
  • [ ] FC 5V pad to GND: reads 4.95–5.05V
  • [ ] XL4015 output to GND: reads 9–12V (VTX supply)
  • [ ] GX12-A Pin 1 to Pin 2: reads 4.95–5.05V
  • [ ] GPS module VCC to GND: reads 4.95–5.05V
  • [ ] RP2 VCC to GND: reads 4.95–5.05V

Stage 3 — Betaflight connection (USB to FC)

In Betaflight Configurator:

  • [ ] FC connects and Betaflight reads firmware version
  • [ ] Gyro data visible in Setup tab — moves when drone is manually rotated
  • [ ] No calibration errors on startup (watch CLI for error messages during boot)
  • [ ] All UARTs assigned correctly in Ports tab:
  • UART1: MSP DisplayPort (VTX)
  • UART2: GPS (UBX)
  • UART3: Serial RX (CRSF)
  • UART4: MSP (payload)
  • UART5: custom (payload secondary)
  • [ ] CRSF detected in Receiver tab (channels visible)
  • [ ] All sticks move correct channels in correct direction
  • [ ] Switch positions visible on AUX channels
  • [ ] RSSI > –90 dBm at close range
  • [ ] Link Quality = 100% at close range
  • [ ] Failsafe triggers correctly when transmitter is powered off (channels move to failsafe positions)

Stage 5 — Motors (props OFF throughout)

In Betaflight Motors tab:

  • [ ] BiDi DShot enabled — RPM telemetry visible for all four motors when spinning
  • [ ] Each motor spins individually and stops when slider returns to zero
  • [ ] Motor directions correct (Props In configuration — see Section 2)
  • [ ] No grinding, ticking, or irregular noise from any motor at any throttle level
  • [ ] eRPM values plausible: at half throttle, approximately 15,000–20,000 RPM

Stage 6 — GPS acquisition (outdoors)

  • [ ] GPS satellites appear in GPS tab within 90 seconds (cold start: up to 3 minutes)
  • [ ] 3D fix acquired with 12+ satellites
  • [ ] Position displayed matches actual location (within 5 metres)
  • [ ] GPS Rescue armed status shown as "Ready" in GPS Rescue tab

Stage 7 — Video system

  • [ ] VTX voltage 9–12V confirmed (Section 6 test)
  • [ ] Video image visible in goggles
  • [ ] OSD overlay present (battery voltage, mode, GPS status)
  • [ ] No video tearing, freezing, or persistent corruption at close range

Stage 8 — Payload interface (if payload connected)

  • [ ] GX12-A Pin 1: 5V present
  • [ ] I2C device scan: payload sensor at expected address
  • [ ] GPS tap producing valid NMEA at 57,600 baud
  • [ ] AUX GPIO toggles with radio switch
  • [ ] Payload data logging confirmed on SD card after 60-second test run

Stage 9 — Blackbox gyro trace (maiden pre-check)

Enable blackbox logging. Arm the drone on the ground without props. Let it sit for 30 seconds. Disarm. Download blackbox. Open in Betaflight Blackbox Explorer.

  • [ ] Gyro noise floor below 80 Hz: flat (< 0.5°/s amplitude)
  • [ ] No large spikes at any frequency with drone sitting still
  • [ ] RPM filter notches visible at motor frequency harmonics if motors were spinning
  • [ ] If noise floor is elevated: check all star ground connections, verify twisted pairs, confirm caps are on ESC pads not pigtails

Quick Reference — Wire Colour Decision Tree

Is it carrying positive voltage to power something?
  YES  RED

Is it a ground / negative return?
  YES  BLACK

Is it an analog signal (voltage measurement, current sense, ADC input)?
  YES  YELLOW

Is it a high-speed digital signal (DShot, CRSF, MSP, UART > 100k baud)?
  YES  BLUE

Is it a low-speed bus signal (I2C, GPS UART, payload UART, GPIO)?
  YES  GREEN

Quick Reference — Wire Gauge Decision Tree

Will it carry more than 20 A?  12 AWG
Will it carry 1020 A?        14 AWG
Will it carry 210 A?         20 AWG
Will it carry 0.52 A?        22 AWG
Is it a DShot signal wire?    24 AWG (keep under 100 mm)
Is it any other signal wire?  28 AWG

Section 8 — Companion Interface (Pi Bay / LCM-1)

What flows here

The companion interface is a 4-wire JST-SH harness pre-installed in every drone during build. It connects the FC's dedicated companion UART (UART6, labelled COMPANION) to the Pi bay connector above the Backplane. It is capped and unused when no Pi is fitted. UART6 is permanently reserved for this purpose — never reassigned.

This harness is NOT a payload interface. It does not use the GX12 connectors. It is a separate, dedicated loom that runs alongside the GX12 loom through the Platform signal channel.

The wire

28 AWG, 4-wire: Red (5V_COMP), Black (GND), Blue (FC TX), Blue (Pi TX). Use different shades of blue or label with heat-shrink: "FC→Pi" and "Pi→FC". Power (5V_COMP) comes from a dedicated XL4016 buck converter tapped from the battery rail — NOT from the FC BEC. This keeps the Pi's power budget completely independent of the FC's 2A BEC limit.

Wiring map

Wire Colour AWG From To What flows
5V_COMP Red 28 XL4016 buck output + JST-SH PIN 1 5.1V regulated from battery rail. Pi + companion electronics only.
GND Black 28 XL4016 buck output − JST-SH PIN 2 Common ground. Ties to star ground at ESC GND.
COMPANION_TX Blue 28 H7A3-SLIM UART6 TX JST-SH PIN 3 FC transmits MAVLink2 (ArduPilot) or MSP (Betaflight) to Pi. 921600 baud.
COMPANION_RX Blue 28 H7A3-SLIM UART6 RX JST-SH PIN 4 Pi transmits to FC. Telemetry, commands, status. 921600 baud.

Routing

Route companion harness alongside GX12 loom through Platform LEFT signal channel (X = −20 mm). The 4-wire bundle adds negligible diameter. Terminate JST-SH connector at Pi bay base — position near mast boss pads for short jumper to Pi GPIO.

Buck converter for companion power

XL4016 or equivalent 5V buck. Input: battery rail tap (6S = 21–25V input range). Output: 5.1V, 1A minimum. Mount on Platform in signal zone adjacent to FC/ESC stack. Output connects to JST-PH 2-pin header → feeds JST-SH PIN 1 on companion harness.

This is a second small buck converter alongside the existing XL4015 (which powers the VTX). Same installation logic — ferrite bead on output, low-ESR cap on input.

Testing this section

  1. No Pi fitted: Verify JST-SH connector is capped. Measure 5V_COMP at buck output = 5.1V ± 0.1V. Harness should not affect FC operation at all.

  2. Pi fitted: Connect Pi, power drone. Pi should boot within 20 seconds. Open serial monitor on companion UART at 921600 baud — MAVLink heartbeat packets should appear. Pi WiFi hotspot should be visible on a phone/laptop.

  3. Independence check: With Pi running and WiFi active, verify FC temperature is unchanged. Pi power draw must not appear on FC BEC voltage — they are independent rails.


Revision History

Version Date Author Summary
0.3 2026-03-29 JS Section 7 restructured with Layer 1/2 abstraction model. Section 8 added: companion interface (Pi bay), companion harness, buck converter for companion power.
0.2 2026-03 JS Complete rewrite. GX12-7 dual connector wiring. Platform zone discipline.
0.1 2025-12 JS Initial wiring reference.