Skip to the content
4 layers25.4 × 25.4 mmTwonkie, the printed circuit board in 3D

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

6

README

hw/README.md

Before 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:

  1. Back side components
  2. Front side components
  3. Basic connectivity/bootloader test
  4. 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.

GroupComponentsValue
1U4STM32
2R3400
R2, R5620
3DS1LED
4C3, C8100n
C74.7µ
C11µ
R4400
FB1Ferrite Bead
5D1, U1, U3, Q4, R28

Part 2: Front side

GroupComponentsValue
6Q1, Q2, Q3NFET
8R9, R17, R25, R264k75
R10, R181k
R11, R1912k1
R12, R205k11
R6, R7400
R15, R23, R24100
R14, R22200
9R1, R8, R13, R16, R21, R2735k7
10C24u7
C4, C9100n
C51u
C610n
11FB2Ferrite Bead
12DS2, 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.

  1. Double check all components:
    • Are all ICs oriented the right way?
    • Did you miss any solder joints?
    • Do you see any obvious solder bridges?
  2. 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.
  3. Do the same on the input side of U3.
  4. 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")
  5. Flash the firmware via the bootloader, then unplug and plug back in to boot the Twonkie firmware.
  6. You can test the LED using the serial shell:
    • tw sink puts 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 0 turns the blue LED on, gpioset LED_B_L 1 turns it off.
    • Same for LED_R_L and LED_G_L
  7. Check I2C connectivity to the two INA260 monitors:
    • ina 0 attempts to access U1, ina 1 does 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
QtyValueFootprintReferences
635k7Resistor_SMD:R_0402_1005Metric_Pad0.72x0.64mm_HandSolderR1, R8, R13, R16, R21, R27
4100nCapacitor_SMD:C_0402_1005Metric_Pad0.74x0.62mm_HandSolderC3, C4, C8, C9
4400Resistor_SMD:R_0402_1005Metric_Pad0.72x0.64mm_HandSolderR3, R4, R6, R7
44k75Resistor_SMD:R_0402_1005Metric_Pad0.72x0.64mm_HandSolderR9, R17, R25, R26
4BSD840NPackage_TO_SOT_SMD:SOT-363_SC-70-6Q1, Q2, Q3, Q4
3100Resistor_SMD:R_0402_1005Metric_Pad0.72x0.64mm_HandSolderR15, R23, R24
3TestPointTestPoint:TestPoint_Pad_D1.0mmTP1, TP2, TP3
20.012twonkie:R_Shunt_Ohmite_LVK12R28, R29
212k1Resistor_SMD:R_0402_1005Metric_Pad0.72x0.64mm_HandSolderR11, R19
21kResistor_SMD:R_0402_1005Metric_Pad0.72x0.64mm_HandSolderR10, R18
21uCapacitor_SMD:C_0402_1005Metric_Pad0.74x0.62mm_HandSolderC1, C5
2200Resistor_SMD:R_0402_1005Metric_Pad0.72x0.64mm_HandSolderR14, R22
24.7uCapacitor_SMD:C_0402_1005Metric_Pad0.74x0.62mm_HandSolderC2, C7
25k11Resistor_SMD:R_0402_1005Metric_Pad0.72x0.64mm_HandSolderR12, R20
2600@100MHzInductor_SMD:L_0402_1005Metric_Pad0.77x0.64mm_HandSolderFB1, FB2
2620Resistor_SMD:R_0402_1005Metric_Pad0.72x0.64mm_HandSolderR2, R5
2CLVBA-FKALED_SMD:LED_Cree-PLCC4_3.2x2.8mm_CCWDS1, DS2
2INA237Package_SO:VSSOP-10_3x3mm_P0.5mmU1, U2
1HEART
110nCapacitor_SMD:C_0402_1005Metric_Pad0.74x0.62mm_HandSolderC6
1629105150521twonkie:USB_Micro-B_Wuerth_629105150521_HandSolderJ3
1690-024-294T331twonkie:EDAC_690-024-294T331_EdgeMountJ2
1AD8606Package_SO:MSOP-8_3x3mm_P0.65mmU5
1BZT52C5V6Diode_SMD:D_SOD-123D1
1EVQ-P7M01PButton_Switch_SMD:SW_SPST_EVQP7CSW1
1G***twonkie:dojoe-logodojoe-logo
1MIC5504Package_TO_SOT_SMD:SOT-23-5_HandSolderingU3
1STM32F072CBtwonkie:LQFP-48_7x7mm_P0.5mm-QFN48-FrankensteinU4
1USB4151twonkie:GCT_USB4151_EdgeMountJ1
1oshw_logo_silkscreen_back_3.5mmtwonkie:oshw_logo_silkscreen_back_3.5mmOSHW_LOGO

Similar boards

  • 2 layers23.9 × 37 mmZeptoduck panelized, the printed circuit board in 3D

    Zeptoduck panelized

    mrk-fox/ZeptoDuck

    The smallest rubber ducky in the world

    110 parts
  • 2 layers20.5 × 11 mmSwd over c pogo, the printed circuit board in 3D

    Swd over c pogo

    kitspace-test-repos/kicad6-file-collection

    4 partsMIT
  • 2 layers69.9 × 114.3 mmLed smart plug, the printed circuit board in 3D

    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 mmArgo v9-stable rev4, the printed circuit board in 3D

    Argo v9-stable rev4

    SensorsINI/argo

    Code for Autonomous sail boat

    139 parts16
  • 4 layers89.3 × 90.7 mmBreadboard DMM, the printed circuit board in 3D

    Breadboard DMM

    Acliad/toast-o-meter

    Breadboard mounted DMM with volts, amps, ohms, continuity, and diode feature.

    152 parts1
  • 2 layers32.3 × 19.1 mmICM 20600 Breakout, the printed circuit board in 3D

    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.