Cooper Brown

A USB driver board for a motorized zoom lens: XIAO RP2040 + DRV8871

NotePart of Open Rocket TrackerPart of Laser-isolated PCBs

The Computar H10Z0812MP zoom lens on my rocket tracker has three 8 V DC motors (zoom, focus, iris) and preset pots on zoom and focus. This board runs all of it from one USB-C cable: a XIAO RP2040, a 5 → 8 V boost and three DRV8871 H-bridges. I've assembled three, one v1 and two v2, all laser-isolated in-house on my UV laser. One of each survived. Here's the circuit, the pinouts, what changed between the two layouts and how each board tested.

The finished v2 lens driver board: XIAO RP2040 on the left, three DRV8871 drivers and the 6-pin JST XH motor connector on the right, 4-pin pot connector at the bottom
Fig. 1 — The v2 board. XIAO on the left, the three DRV8871s next to J1 (motors), J2 (pots) at the bottom, boost and inductor top right

What the lens wants

The H10Z0812MP is an 8–80 mm F1.2 C-mount CCTV zoom. Each axis is a small DC motor: put 8 V across its two wires to move it one way and reverse the polarity to move it back. Zoom and focus also have a 5 kΩ preset pot, so you can read where they are. That's enough to close the loop on focus and zoom from the lens's own pots, which is the point of the board. From the Computar datasheet:

MotorsDC 8 V, about 4 s end to end
Iris≤ 20 mA, white / brown
Focus≤ 50 mA, green / black, 5 kΩ preset pot
Zoom≤ 45 mA, yellow / red, 5 kΩ preset pot
Pot wiresSupply (+) purple, focus position blue, return (−) orange, zoom position grey

The lens lets you tie brown, black and red together as a common return. Don't, if you drive it with H-bridges: each motor needs both of its own wires.

The circuit

USB-C into the XIAO gives 5 V. The XIAO's 5 V pin feeds a TLV61046A boost set to 7.95 V for the motor rail (VM), and VM feeds three DRV8871s, one per motor. The current limit on each driver is set by one resistor, so there's no sense resistor. At 180 kΩ it's 64 kV / 180 kΩ ≈ 0.36 A, far above what the motors draw, so it's only a safety cap. All 18 parts are SMD on the front.

U1Seeed XIAO RP2040 (castellated module, USB-C, 3.3 V logic)
U2TI TLV61046A boost, SOT-23-6. 5 V → 0.795 × (1 + 180k/20k) = 7.95 V. EN tied to VIN, always on
L110 µH shielded, Bourns SRN4018-100M
U3–U5TI DRV8871DDAR H-bridge, HSOP-8 PowerPAD: zoom, focus, iris
R1 / R2180 kΩ / 20 kΩ 1 %, boost feedback divider
R3–R5180 kΩ 1 %, ILIM, ≈ 0.36 A per driver
C1–C5Designed 2.2 µF 25 V X7R 0805. My 0805 sample book has no 2.2 µF, so every board has 1 µF 50 V
J1JST XH 6-pin SMT side-entry (S6B-XH-SM4-TB), motors
J2JST XH 4-pin SMT side-entry (S4B-XH-SM4-TB), preset pots
Pot supplyThe pots are powered from GPIO D3 (POT_VCC), not from 3V3, so firmware has to drive it high. Wipers go to A1 (zoom) and A2 (focus)

The DRV8871 takes two inputs per motor: IN1/IN2 = 1/0 forward, 0/1 reverse, 1/1 brake, 0/0 coast and sleep. Its inputs have internal pull-downs, so the motors stay off until firmware runs. The exposed pad sits on GND copper, and at lens-motor currents soldering it is optional.

Pinouts and crimping

Both layouts use the same J1/J2 pin order, checked pin by pin between the two board files, so one set of cables fits either. IN1 high and IN2 low makes the A wire positive. Crimp to these tables:

J1-1ZOOM_B · red (zoom −)
J1-2ZOOM_A · yellow (zoom +)
J1-3FOCUS_B · black (focus −)
J1-4FOCUS_A · green (focus +)
J1-5IRIS_B · brown (iris −)
J1-6IRIS_A · white (iris +)
J2-1POT_VCC (D3) · purple, supply (+)
J2-2FOCUS_POS (A2) · blue, focus position
J2-3GND · orange, return (−)
J2-4ZOOM_POS (A1) · grey, zoom position

The easiest way to crimp: push the empty housing onto the header, then put each crimped wire into the hole in front of its pin. The cable side is XHP-6 and XHP-4 housings with SXH-001T-P0.6 crimps, or a pre-crimped XH lead kit, which is what I used.

The analog side and the pot supply are the same on both layouts. The motor inputs moved in v2, so the firmware needs a pin table per board:

ZOOM IN1/IN2v2: D4 / D6 (GP6 / GP0) · SN02: D8 / D7 (GP2 / GP1)
FOCUS IN1/IN2v2: D5 / D7 (GP7 / GP1) · SN02: D4 / D9 (GP6 / GP4)
IRIS IN1/IN2v2: D9 / D8 (GP4 / GP2) · SN02: D6 / D5 (GP0 / GP7)
ZOOM_POSA1 (GP27), ADC
FOCUS_POSA2 (GP28), ADC
POT_VCCD3 (GP29), drive high
UnusedD0, D10, 3V3

On v2 all six motor inputs are on separate PWM channels.

v1 (SN02) vs v2

Both are built on the S size of my Modular PCBs blanks: SN02 on a Rev 1 blank, v2 on Rev 2, which adds corner pockets, Cu/FR4 fiducials, laser targets and an F/B key. The circuit and BOM didn't change. The layout did, mostly to make bridges less likely after SN02's 3.3 V short.

Copper renders of the two layouts side by side: SN02 on the Rev 1 blank and v2 on the Rev 2 blank
Fig. 2 — Front copper, SN02 (left) and v2 (right). Each colour is a net; the brown is the GND pour
ConnectorsSN02: J1 on the left edge, J2 on the right. v2: J1 on the right edge (pin 1 at the bottom), J2 on the bottom edge (pin 1 at the left), so both cables leave near one corner. They can't share one edge of a Rev 2 blank: J1 alone needs 21.8 mm and the free edge between pockets is 21.6 mm. The USB-C comes out the left edge
Under the XIAOSN02 routed traces under the module. v2 has no front copper under it
Clearancesv2: every routed trace is at least 0.4 mm from other-net copper, and the GND pour stands 0.5 mm off all non-GND copper (SN02: 0.25 mm)
Grid viasThe blank has a grid of vias. 48 of them sit within 0.45 mm of a pad on another net, and v2 leaves those floating, so a solder bridge onto one shorts nothing. On SN02 they were GND, some only 0.27 mm from signal pads, the XIAO's 3V3 pad among them
Motor tracesv2 stacks the drivers 5.08 mm apart, so their outputs line up with J1's pins and run straight across. Each driver's OUT1/OUT2 and IN1/IN2 are swapped together, so IN1 high still makes the A wire positive. That's why the motor-input pin map changed
Trade-offsThe VM caps C3–C5 sit in the bottom-right corner, 5–18 mm from their drivers on a 0.5 mm back trace, fine at a 0.36 A limit. There's more copper on the back (+5V, the VM bus, two motor inputs, ZOOM_POS, the three ILIM runs). The driver bodies are only about 0.2 mm apart, so place them square
Checksv2: KiCad DRC 0 errors, 0 unconnected, ERC 0 errors, all 83 pads match the schematic
Back of the v2 board, showing the laser-isolated back traces and vias
Fig. 3 — The back of v2: the VM bus, motor inputs and ILIM runs, isolated on the laser

The driver orientation trips people up, so for whoever solders one: pin 1 is the dot or dimple on top of the DRV8871, and the bevelled long edge is the pins 1–4 side. Placed 180° the wrong way, the chip's VM pin lands on the ground pad and it dies at power-on. If the dot and the printing ever disagree, trust the dot. On the TLV61046A, pin 1 is the leg nearest L1, and its tiny printed code reads upside down when it's right.

SN02: build and bench test

SN01 was cut a little wrong, so the first real board is SN02. I laser-isolated it on a Rev 1 blank on 2026-11-18. Rev 1 has no fiducials, so I burned my own X-corner marks on each side, measured them and corrected the job from them (the camera alignment note covers how).

Assembly was stencil, paste and hotplate:

Stencil0.1 mm 304 stainless, cut on the xTool F2 Ultra and held in my stencil jig. One firm pass with a stiff blade at 45–60°, then lift the clamp straight up
PasteSn63/Pb37 T4 no-clean, melts at 183 °C
ProfileSoak 150–165 °C for 60–90 s, peak 210–225 °C at the board, 30–60 s above 183 °C
Hotplate350 W 100 × 100 mm constant-temperature plate: set 150 °C, soak 60–90 s once it reads 150, then set 235 °C. Judge by the paste going from dull grey to shiny, and give it 15–30 s after the last joint (the driver thermal pads) goes shiny. Cool without bumping or blowing on it
OrderLow, fiddly parts first: drivers, boost, L1, resistors, caps, then J1 (its courtyard overlaps the XIAO's on SN02) and J2. On SN02 everything except the XIAO went on the hotplate, and the XIAO was hand-soldered last with flux. On v2 the XIAO goes on the hotplate with the rest
InspectionMicroscope for bridges on the 1.27 mm DRV8871 pins and the SOT-23-6

Before the first USB plug-in I ran eight resistance checks with the board unpowered. They catch the faults that kill something the moment power arrives. Readings across capacitors start low and climb; the value it settles at is what counts.

1 · +5V–GNDAcross C1. Climbs to OL without the XIAO, settles above ~100 Ω with it. Don't plug in under ~10 Ω
2 · VM–GNDAcross C2. ~200 kΩ (R1 + R2). Under ~1 kΩ is usually a bridge on a driver's VM pin or a blob under a driver
3 · +5V–VMAbove ~1 kΩ. Under ~100 Ω, look for a bridge on U2's bottom-row legs
4 · SW–GNDL1 to GND. Same as check 1, since L1 joins SW to +5V. Low here and on 1: U2's top-right legs are bridged
5 · Across L1~0 Ω. OL means L1 is open at one end: not dangerous, but the boost won't run
6 · FB–GNDAcross R2, ~18–20 kΩ. ~0 Ω and the boost runs up to its ~30 V maximum. ~180 kΩ means R1 and R2 are swapped
7 · VM–FBAcross R1, ~170–180 kΩ. OL means R1 is open, which also makes the boost run away
8 · XIAO 3V33V3 to GND on the XIAO pads, above ~100 Ω. Don't plug in under ~10 Ω

The motor inputs and outputs aren't in that list on purpose: at plug-in the drivers' inputs sit low, so their outputs stay off. On the first plug-in the idle current should be well under 100 mA, nothing should get warm in the first 5–10 s, and VM across C2 should read 7.9–8.0 V. About 5 V means the boost isn't running. Over 9 V, unplug.

SN02 had a 3.3 V short to GND. Solder had bridged two traces under the XIAO's pads, because the isolation under the module just isn't good. Reworking the XIAO cleared it and the board came up on USB, but it was a bodge fix and something else could have been wrong too, so I made another board.

I flashed MicroPython v1.29.0. The 1200-baud reset drops the XIAO into its bootloader, so no BOOT button needed. With the lens unplugged, the pins were switched from the PC over the REPL while I measured:

Boost and pot supplyVM across C2 and POT_VCC at J2 pin 1: pass
Motor outputsZoom, focus and iris at J1, forward / off / reverse with all three cycling together: all switch both ways
Pot inputsA1 and A2, each grounded with a wire: about 3.13 V idle on the RP2040's internal pull-ups, 0.00–0.01 V grounded

With nothing connected, the pot inputs float down to about 0.1 V, so that test only means something with the internal pull-ups on. They're a test setting. With the pots connected they stay off.

v2: build and bench test

I burned two v2 boards on the same day, back to back. The first one I covered in UV-cured resin solder mask, so solder couldn't bridge the traces. The resin on the back stuck to the hotplate, and when I pulled the board off, the parts went flying. The second had no mask, and it was burned, stencilled, assembled, flashed and tested that afternoon. The front isolation has 0.5 mm channels to match the pour clearance, the back 0.30 mm (wider on the back adds no bridging margin, since nothing is soldered there). Each burn was aligned from the blank's fiducials plus two marks burned on its laser targets, about 26 min of laser time in all against 13.4 for SN02. The laser PCB page has the process. I didn't mark reference designators on this one: the auto-placer put the U3/U4/U5 labels beside the wrong drivers.

Paste, hotplate profile and inspection were the same as SN02, except the XIAO went on the hotplate with everything else. It came through fine.

Fig. 4 — v2 on the hotplate at the peak
The reflowed v2 board on the hotplate next to flakes of green solder mask
Fig. 5 — After reflow. The green flakes on the plate are the first v2 board's solder mask

It came up on USB with the factory firmware, and I flashed the same MicroPython v1.29.0 file as SN02. Then a self check that runs on the XIAO and tests everything the XIAO can see by itself, with the lens unplugged:

PinsEvery pin follows its own pull-up and pull-down, and can be driven high and low
BridgesNone between any two of the 11 pins
Motor inputsAll six show the DRV8871's internal pull-down, which proves the XIAO joint, the trace and vias, and the driver's pin joint
Pot sidePOT_VCC and the two pot inputs, read through the ADC

Results:

Self check33 of 33 pass, run twice
POT_VCC3.29 V driven high, 0.01 V driven low, at the XIAO pin
ZOOM / FOCUS_POS3.15 / 3.14 V on pull-up, 0.05 V on pull-down, at the XIAO pins
Chip temp30 °C
Motor outputsAll three channels cycled together (forward 5 s, off 3 s, reverse 5 s, off 3 s), each pair measured at J1 (zoom 1–2, focus 3–4, iris 5–6): all three good

The self check can't see the boost, the driver outputs or the connector joints, because nothing on the board feeds those back to the XIAO. That's what the meter at J1 is for. The J1 result also proves the 8 V boost works, since the drivers have no other supply. And the new pin map works as designed: zoom D4/D6, focus D5/D7, iris D9/D8.

Fig. 6 — The three DRV8871s, the TLV61046A and L1 after reflow
Fig. 7 — On USB, leads in J1 and J2

Lessons

Keep copper out from under the module. SN02's 3.3 V short was solder bridging two traces under the XIAO, where the isolation just isn't good. v2 has no front copper under the XIAO, leaves the grid vias near other-net pads floating and pulls the pour back to 0.5 mm.

Skip the UV-cured solder mask. On the first v2 board I put down my own UV-cured mask after the copper burns and laser-opened the pads through it. The resin on the back stuck to the hotplate and the board was lost (Fig. 5). I've stopped using solder mask on my boards since, and they work fine without it.

A self check isn't the whole test. A self check on the XIAO is quick and catches opens and bridges on every pin it touches, but the boost, the driver outputs and the connector joints still need a meter.