

Twonkie
A USB-PD sniffer/injector/sink based on Google's Twinkie, re-designed to be manufactured by mere mortals.
- Size
- 25.4 × 25.4 mm
- Copper layers
- 4
- Thickness
- 1.6 mm
- Parts
- 62
- Nets
- 78
- Pads
- 329
- Tracks, vias
- 879, 120
- Pours
- 19
- Routed
- Yes
- KiCad
- KiCad 8.0 (file 20240108)
- Created
- 16 Feb 2021
- Updated
- 19 Sep 2025
Overview
Twonkie is an open-source printed circuit board by dojoe, from the dojoe/Twonkie repository on GitHub. It is a 4-layer board of 25.4 × 25.4 mm with 62 parts on 78 nets, routed with 879 tracks and 120 vias.
It is built around the STM32F072CBT6, AD8606ARZ and BSD840N-VB, with the BZT52C5V6, EVQ-P7M01P and USB4151-GF-C among its other parts. Its parts include 29 resistors, 9 capacitors, 5 ICs, 4 transistors and 3 connectors. It belongs with the power boards and the STM32 boards of this library.
Main components
6STM32F072CBT6
LQFP-48(7x7)-40℃~+85℃ 1.65V~3.6V 128KB 12bit 12bit 16KB 32 Bit 37 48MHz ARM Cortex-M0 Built-in FLASH LQFP-48(7x7) Microcontrollers (MCU/MPU/SOC) ROHSSTMicroelectronicsMicrocontrollers (MCU/MPU/SOC)AD8606ARZ
SOIC-8-40℃~+125℃ 0.5pA 1.2mA 100dB 10MHz 1pA 2 2.7V~5.5V 4.5uV/℃ 5V/us 80mA 80uV 8nV/√Hz@1kHz ESD protection、Built-in compensation、Overvoltage protection、Reverse-phase input protection Rail-to-Rail Input, Rail-to-Rail Output SOIC-8 Precision Op Amps ROHSAnalog DevicesPrecision Op AmpsBSD840N-VB
SC-70-6MOSFETsVBsemi ElecBZT52C5V6
SOD-123Zener DiodeshongjiachengEVQ-P7M01P
SMD-4P,3.5x2.9mm-20℃~+70℃ 1.35mm 1.6N 100,000 cycles 12V 3.55mm 3.5mm 50mA Black J-Lead Rectangular Button SPST-NO Surface Mount,Vertical Without Bracket SMD-4P,3.5x2.9mm Tactile Switches ROHSPanasonicTactile SwitchesUSB4151-GF-C
SMD-40℃~+85℃ 1 24P 48V 5A Black Male Surface Mount,Vertical Type-C SMD USB Connectors ROHSGlobal Connector Technology (GCT)USB Connectors
README
hw/README.mdBefore you begin
Recommended tools (apart from the usual)
The board is too tiny to stay put from its own weight so you'll need a proper vise. "Third Hand"s are no good for this since they can't clamp small boards properly and aren't stable enough. I recommend a StickVise or similar.
A knife with a straight, strong blade.
Non-serrated pliers.
You can solder everything using a smallish chisel tip and you'll be fine. For enhanced comfort, a fine angled tip makes the passives much easier. I used a TS80-J02 with great success.
Gel flux. Liquid flux evaporates too quickly for my taste. I use Edsyn FL-22 for everything but there's plenty other good stuff out there too.
A watchmaker's loupe, more for inspection than for the actual soldering. Of all the tools I acquired last year, this super cheap 7x loupe made the biggest difference and it's never leaving my workbench again. Have a strong light (such as a phone camera LED) at the ready for inspection too, there's no such thing as "too much light".
General tips
-
Keep both the schematics and the board file open while you build, you'll likely want to refer back to them more often than not.
-
I wholeheartedly recommend this thread by @thingskatedid: https://twitter.com/thingskatedid/status/1348234262886039558
-
The passives are indistinguishable once taken out of their tapes!
- Always work with a single value at a time
- Only remove as many components from the tape as you need right now
- Immediately put the tape back into the pouch it came in, as that's where the value is noted - or write the value onto the tape.
-
For each group of passives below, it saves time to batch up different types of operations: First put a small solder blob on one pad of each site, then tack down each component, then solder the other side for all components in a row.
-
If the solder joints on nearby passives blob together a lot, use some flux and a little less solder. It's also a good idea to make a final flux pass across the finished passives just like you would be drag soldering a leaded part, it makes the solder joints look a lot nicer.
Assembly instructions
These instructions are optimized for hand assembly; the components are grouped in a way that if you follow the groups in order you should never have one component in the way of soldering another. Within a given group the order does not matter; I recommend doing all components of one value before moving on to the next value.
The overall order of assembly is:
- Back side components
- Front side components
- Basic connectivity/bootloader test
- USB-C connectors
Part 1: Back side
We start on the back side because that's where the STM32 sits which is the most daunting to solder, and because the components on that side are generally flatter so if you have to solder without a vise they won't make the board as wobbly when you do the front side.
If your STM32 is a QFN part, take extra care to inspect its solder joints after you put it down. Once the board is fully populated any bad solder joints here will be hard to fix.
| Group | Components | Value |
|---|---|---|
| 1 | U4 | STM32 |
| 2 | R3 | 400 |
| R2, R5 | 620 | |
| 3 | DS1 | LED |
| 4 | C3, C8 | 100n |
| C7 | 4.7µ | |
| C1 | 1µ | |
| R4 | 400 | |
| FB1 | Ferrite Bead | |
| 5 | D1, U1, U3, Q4, R28 |
Part 2: Front side
| Group | Components | Value |
|---|---|---|
| 6 | Q1, Q2, Q3 | NFET |
| 8 | R9, R17, R25, R26 | 4k75 |
| R10, R18 | 1k | |
| R11, R19 | 12k1 | |
| R12, R20 | 5k11 | |
| R6, R7 | 400 | |
| R15, R23, R24 | 100 | |
| R14, R22 | 200 | |
| 9 | R1, R8, R13, R16, R21, R27 | 35k7 |
| 10 | C2 | 4u7 |
| C4, C9 | 100n | |
| C5 | 1u | |
| C6 | 10n | |
| 11 | FB2 | Ferrite Bead |
| 12 | DS2, U5, U2, J3, SW1, R29 |
Part 3: Basic connectivity / bootloader test
This step is done on the not-quite-finished Twonkie because if anything isn't right the board is much easier to hold in the vise without two USB-C connector sticking out.
- Double check all components:
- Are all ICs oriented the right way?
- Did you miss any solder joints?
- Do you see any obvious solder bridges?
- Measure resistance between the 3V3 rail and GND, this is easiest at the output side of U3. Kiloohms are good, Ohms are an indication of a short somewhere.
- Do the same on the input side of U3.
- Hold down the bootloader switch and plug the dongle in via the Micro-B connector. It should now enumerate as the bootloader (VID 0x0483, PID 0xDF11, "STM32 BOOTLOADER")
- Flash the firmware via the bootloader, then unplug and plug back in to boot the Twonkie firmware.
- Check out the Firmware README for building and flashing instructions.
- You can test the LED using the serial shell:
tw sinkputs the device into sink mode where the firmware doesn't keep overwriting the LED state. You may need to reconnect the shell after this.gpioset LED_B_L 0turns the blue LED on,gpioset LED_B_L 1turns it off.- Same for
LED_R_LandLED_G_L
- Check I2C connectivity to the two INA260 monitors:
ina 0attempts to access U1,ina 1does so for U2
That's all we can test for now, let's finish the board next.
Part 4: USB-C connectors
The USB-C connectors are used in an unorthodox way: Straddle mount USB-C connectors for 1.6mm boards don't exist, so we take connectors meant for right-angle surface mounting and modify them into our own custom straddle mount configuration. With those modifications the solder connections work really well, and we achieve mechanical stability by soldering the connector shields to the board all around.
We start out with the unmodified connector. This is the receptacle but the steps for the plug are identical.
First, the mounting legs have to get out of the way. Grab them with your pliers and bend them back and forth until they break off.
Next up, the locating pegs have to go too. Cut them off close to the base.
Now comes the tricky part: We have to bend the pins of the connector slightly inwards so they touch the board edge at an angle, but not so much that they don't reach the board edge or break off. The photos should give you an idea of how far to bend them.
Start by sliding the knife under roughly a quarter to half the pins on one side, and gently bend them inwards. Bending only part of the pins at once requires less force and therefore allows for better control. Take care to rotate the knife blade around the long axis, as opposed to using it as a lever, so that all pins receive equal force and bend the same way.
Move along the row of pins, bending groups of pins inwards until the entire row is bent.
Repeat the same process on the other side; the end result should look something like this:
Now you can slide the connector into its place on the PCB. The PCB is designed such that the shell sits inside the PCB with a slight press fit. If you feel it's jammed in there too tightly you can simply sand off a little bit of the PCB, but sand off only very little and try to sand off both sides equally to maintain pin alignment.
Push the connector all the way towards the board edge and adjust its position until it sits exactly centered and in line with the board:
The pins on both sides should now align with the pads and touch the corner of the board edge. If there's a tiny gap that's no problem, the solder will bridge that. Larger gaps need to be fixed by adjusting the connector's position or bending the pins to compensate.
Once you're satisfied with the connector, tack down one pin on one board side, double check that everything still looks good, then tack down one pin on the opposite side. Triple check that everything still looks good, then you can drag solder all the pins into place.
When the pins have all been soldered, inspect them for missing connections or solder bridges and correct any that come up.
Finally you can solder down the shells: Using a soldering iron that can pump out a bit of heat (TS-80 is good, TS-100 is better, a powerful temperature controlled soldering station is best), first just pre-heat the shell for a bit, then add some solder and make sure it wets along the entire length of the neighboring pad. Then you can start heating the pad too and add loads of solder to make a solid connection. Do this on all four mounting pads and the connector won't go anywhere.
Part 5: Enjoy!
And that's it! Clean your board with isopropanol and have fun with your new PD sniffer!
Test 1: Sniff some power supply traffic
For starters, you can open a shell, type tw trace on and plug Twonkie in between a PD power supply and sink to watch them negotiate a power contract.
A very good test for many of the board devices is to do this in all four possible combinations of input and output plug orientation. The supply and sink should be able to negotiate a contract in all orientations, and Twonkie should be able to trace all of this. If some orientations don't work, check the solder joints on the USB-C connectors for bridges or opens - especially opens can be very sneaky with the haxxy edge mount we're using. If the connectors look alright, check the board devices next - especially the resistor banks and transistors are likely culprits since they directly interact with the USB-C control channels.
Test 2: Twonkie as sink
The second test would be to attach only a power supply to Twonkie, with no sink at the other end, and type tw sink at the shell to put Twonkie into sink mode. (You may have to reconnect to the shell since Twonkie reboots into a different firmware.) Once in sink mode you can type tw vbus to watch what voltage the supply provides, and pd 0 dev X will limit the negotiated voltage to a maximum of X volts, so you can step through various supply voltages and watch them change. Test this in either plug orientation too; if you're having problems here you should double check the resistor banks on the control channels.
To go from sink mode back to sniffer mode you can type reboot at the shell.
Parts
62| Qty | Value | Footprint | References |
|---|---|---|---|
| 6 | 35k7 | Resistor_SMD:R_0402_1005Metric_Pad0.72x0.64mm_HandSolder | R1, R8, R13, R16, R21, R27 |
| 4 | 100n | Capacitor_SMD:C_0402_1005Metric_Pad0.74x0.62mm_HandSolder | C3, C4, C8, C9 |
| 4 | 400 | Resistor_SMD:R_0402_1005Metric_Pad0.72x0.64mm_HandSolder | R3, R4, R6, R7 |
| 4 | 4k75 | Resistor_SMD:R_0402_1005Metric_Pad0.72x0.64mm_HandSolder | R9, R17, R25, R26 |
| 4 | BSD840N | Package_TO_SOT_SMD:SOT-363_SC-70-6 | Q1, Q2, Q3, Q4 |
| 3 | 100 | Resistor_SMD:R_0402_1005Metric_Pad0.72x0.64mm_HandSolder | R15, R23, R24 |
| 3 | TestPoint | TestPoint:TestPoint_Pad_D1.0mm | TP1, TP2, TP3 |
| 2 | 0.012 | twonkie:R_Shunt_Ohmite_LVK12 | R28, R29 |
| 2 | 12k1 | Resistor_SMD:R_0402_1005Metric_Pad0.72x0.64mm_HandSolder | R11, R19 |
| 2 | 1k | Resistor_SMD:R_0402_1005Metric_Pad0.72x0.64mm_HandSolder | R10, R18 |
| 2 | 1u | Capacitor_SMD:C_0402_1005Metric_Pad0.74x0.62mm_HandSolder | C1, C5 |
| 2 | 200 | Resistor_SMD:R_0402_1005Metric_Pad0.72x0.64mm_HandSolder | R14, R22 |
| 2 | 4.7u | Capacitor_SMD:C_0402_1005Metric_Pad0.74x0.62mm_HandSolder | C2, C7 |
| 2 | 5k11 | Resistor_SMD:R_0402_1005Metric_Pad0.72x0.64mm_HandSolder | R12, R20 |
| 2 | 600@100MHz | Inductor_SMD:L_0402_1005Metric_Pad0.77x0.64mm_HandSolder | FB1, FB2 |
| 2 | 620 | Resistor_SMD:R_0402_1005Metric_Pad0.72x0.64mm_HandSolder | R2, R5 |
| 2 | CLVBA-FKA | LED_SMD:LED_Cree-PLCC4_3.2x2.8mm_CCW | DS1, DS2 |
| 2 | INA237 | Package_SO:VSSOP-10_3x3mm_P0.5mm | U1, U2 |
| 1 | HEART | ||
| 1 | 10n | Capacitor_SMD:C_0402_1005Metric_Pad0.74x0.62mm_HandSolder | C6 |
| 1 | 629105150521 | twonkie:USB_Micro-B_Wuerth_629105150521_HandSolder | J3 |
| 1 | 690-024-294T331 | twonkie:EDAC_690-024-294T331_EdgeMount | J2 |
| 1 | AD8606 | Package_SO:MSOP-8_3x3mm_P0.65mm | U5 |
| 1 | BZT52C5V6 | Diode_SMD:D_SOD-123 | D1 |
| 1 | EVQ-P7M01P | Button_Switch_SMD:SW_SPST_EVQP7C | SW1 |
| 1 | G*** | twonkie:dojoe-logo | dojoe-logo |
| 1 | MIC5504 | Package_TO_SOT_SMD:SOT-23-5_HandSoldering | U3 |
| 1 | STM32F072CB | twonkie:LQFP-48_7x7mm_P0.5mm-QFN48-Frankenstein | U4 |
| 1 | USB4151 | twonkie:GCT_USB4151_EdgeMount | J1 |
| 1 | oshw_logo_silkscreen_back_3.5mm | twonkie:oshw_logo_silkscreen_back_3.5mm | OSHW_LOGO |
Similar boards
- 2 layers23.9 × 37 mm

- 4 layers62 × 10 mm

Pc healthypi move program adapter v7
Protocentral/healthypi-move-hw
Hardware files for the HealthyPi Move
13 parts160MIT - 6 layers11.6 × 7.2 mm

- 2 layers20.5 × 11 mm

- 2 layers69.9 × 114.3 mm

Led smart plug
wbsipz/hardware-design-portfolio
Hardware design portfolio featuring power electronics, embedded control, and PCB projects.
116 parts - 2 layers94.8 × 67.2 mm

- 4 layers89.3 × 90.7 mm

Breadboard DMM
Acliad/toast-o-meter
Breadboard mounted DMM with volts, amps, ohms, continuity, and diode feature.
152 parts1 - 2 layers32.3 × 19.1 mm

ICM 20600 Breakout
PStinno/icm-20600-breakout-pcb
Breakout board for the ICM 20600 3-axis Accelerometer and Gyroscope.
22 parts1CC-BY-SA-4.0
Questions
How big is the Twonkie PCB?
It measures 25.4 × 25.4 mm and has 4 copper layers, 1.6 mm thick.
What parts does the Twonkie use?
62 parts, built around the STM32F072CBT6, AD8606ARZ, BSD840N-VB and BZT52C5V6. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
Where can I download the Twonkie KiCad files?
From the dojoe/Twonkie repository on GitHub, at the commit this page was made from: the board is hw/twonkie.kicad_pcb and its schematic hw/twonkie.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the Twonkie design in my own project?
Its repository states no licence, so its author keeps all rights: ask dojoe before reusing the design.

















