PCB enclosures for Arduino, ESP32, Raspberry Pi and custom boards

STM32 Blue Pill and Teensy enclosures: 3D printed cases for boards with no mounting holes

The Blue Pill (53 x 22.5 mm) and Teensy 4.0 (35.5 x 17.8 mm) have no holes and live on headers. How to hold them with rails or pin channels, and prompts for both.
8 September 2026 · 3 min readelectronicsenclosuresstm32

The boards

BoardOutlineUSBPin rowsHoles
STM32F103 Blue Pill53 x 22.5 mmMicro-B on the short edge2 x 20, 15.2 mm apart, plus a 4-pin SWD header on the far edgeNone
Black Pill (F401/F411)53 x 21 mmUSB-C on the short edge2 x 20None
Teensy 4.035.5 x 17.8 mmMicro-B on the short edge2 x 14, 15.2 mm apartNone
Teensy 4.161 x 17.8 mmMicro-B on the short edge, microSD on the far edge2 x 24, 15.2 mm apartNone
Teensy LC / 3.235.5 x 17.8 mmMicro-B2 x 14None

The Blue Pill also has two jumper blocks (BOOT0 and BOOT1) on top and a reset button near the USB end, both worth reaching.

Holding a hole-less board

Pin-row channels are the best answer for these boards because they are almost always used with headers. Two channels in the base, 15.2 mm apart, 2.6 mm wide and 8 mm deep, capture the pin rows; the board rests on its pin shoulders and cannot slide. The channels double as feet.

Edge rails work when the board is bare: grooves 1.8 mm wide along the long edges, with the USB end open.

A carrier PCB is the cleanest: if the Teensy sits on a perfboard or a custom carrier, give the carrier's dimensions and holes and treat the Teensy as the tallest component.

The prompt (Blue Pill)

Prompt
An enclosure for an STM32 Blue Pill, board 53 x 22.5 mm with 2 x 20 headers soldered pointing down, rows 15.2 mm apart. Two 2.6 x 8 mm pin channels in the base, 1.8 mm walls, 0.5 mm clearance, 14 mm internal height above the pin shoulders. A 9 x 4 mm micro USB cutout on the short edge, a 6 mm hole in the lid above the reset button 8 mm from the USB edge, a 12 x 8 mm slot in the lid above the BOOT jumpers, and a 12 x 5 mm slot on the far short edge for the SWD header. Snap-fit lid.

The prompt (Teensy 4.1)

Prompt
A case for a Teensy 4.1, board 61 x 17.8 mm with headers pointing down, rows 15.2 mm apart. Pin channels in the base, 1.6 mm walls, 12 mm internal height, micro USB cutout on one short edge, a 15 x 3 mm microSD slot on the other short edge at board level, an 8 x 4 mm slot on one long side for the USB host cable, sliding lid.

Debug access

Both families are programmed through a debug header: SWD on the STM32, the built-in bootloader over USB on the Teensy (with a program button on top). Leave a hole or slot for whichever you use, or you will open the case on every firmware change. "A 6 mm hole above the program button" is enough for the Teensy.

Printing

Pin channels are narrow vertical slots and print cleanly. Keep the channel width at 2.6 mm; 2.54 mm pins plus the plastic shoulders need it. If the board rocks, ask for "a 1 mm rib along the channel floor" to raise it.

Prompts to start from

Open one in the builder, change the numbers to yours, and the model renders in seconds. Keep adjusting in the chat before you print.

An enclosure for an STM32 Blue Pill, board 53 x 22.5 mm with 2 x 20 headers soldered pointing down, rows 15.2 mm apart. Two 2.6 x 8 mm pin channels in the base, 1.8 mm walls, 0.5 mm clearance, 14 mm internal height above the pin shoulders. A 9 x 4 mm micro USB cutout on the short edge, a 6 mm hole in the lid above the reset button 8 mm from the USB edge, a 12 x 8 mm slot in the lid above the BOOT jumpers, and a 12 x 5 mm slot on the far short edge for the SWD header. Snap-fit lid.

Open in the builderPre-filled after sign-in. Preview is free.

A case for a Teensy 4.1, board 61 x 17.8 mm with headers pointing down, rows 15.2 mm apart. Pin channels in the base, 1.6 mm walls, 12 mm internal height, micro USB cutout on one short edge, a 15 x 3 mm microSD slot on the other short edge at board level, an 8 x 4 mm slot on one long side for the USB host cable, sliding lid.

Open in the builderPre-filled after sign-in. Preview is free.

A tiny case for a bare Teensy 4.0, board 35.5 x 17.8 mm, no headers: edge rails with 0.4 mm clearance, 1.5 mm walls, 7 mm internal height, micro USB cutout on the short edge, a 6 mm hole in the lid above the program button, friction lid.

Open in the builderPre-filled after sign-in. Preview is free.

Questions

Three ways: channels in the base that capture the soldered pin rows, edge rails that the bare board slides into, or a carrier PCB with its own holes. Pin channels are the usual choice for Blue Pill and Teensy boards.

Yes, if you leave access: a slot for the SWD header on the STM32, a hole above the program button on the Teensy, and the USB cutout on both. Ask for them in the prompt.

Yes. Give its outline (53 x 21 mm) and say USB-C; the rest of the prompt is the same as the Blue Pill.

Generate the enclosure for your board

Describe the board, the ports and how the lid closes. The case renders in your browser in seconds and every cutout is a sentence away from moving. Preview is free.