Moonbell Cottage — Raspberry Pi 4 case as a cottage
111 L × 81 W × 67 H mm (plus feet). Seven printed parts in five colours (the shutter is printed twice), none needs supports.

A white cottage on a black base, with a purple shingle roof, a blue door with a gold moon on it, and two shuttered windows. The Pi is inside the walls. The fan lies in the attic and blows out through the slots in both gables. The stars in the shutters are real holes. This case has a power button, on the end wall away from the USB sockets, and no camera. Under the button, an opening at the foot of the wall reaches the microSD card, so it comes out and goes in with the case closed.
Files
| File | What it is |
|---|---|
3mf/plate_1_black.3mf |
the base, in print orientation |
3mf/plate_2_white.3mf |
walls and attic block |
3mf/plate_3_purple.3mf |
the roof |
3mf/plate_4_blue.3mf |
the door and two shutters |
3mf/plate_5_gold.3mf |
the moon |
stl/ |
the same seven parts one by one |
step/cottage_assembly.step |
assembled CAD model incl. a reference Pi, fan and button, for Fusion / FreeCAD / Onshape. The moon is not in it (see below) |
cottage_case.py |
parametric source. uv run cottage_case.py regenerates everything above |
preview/ |
renders: assembled, front, rear, the button's end (card), top, exploded, inside, print plates |
Six parts are drawn as solids, like the other cases. The moon is not: it is a rounded shape turned into a mesh of 16,000 triangles. A mesh goes into STL and 3MF files but not into a STEP file.
Printing

One plate per filament colour.
| Plate | Colour | Parts | Time | Filament |
|---|---|---|---|---|
| 1 | black | base | 39 min | 22 g |
| 2 | white | walls, attic block | 1 h 44 min | 70 g |
| 3 | purple | roof | 1 h | 35 g |
| 4 | blue | door, 2 shutters | 10 min | 3 g |
| 5 | gold | moon | 4 min | 1 g |
Times and weights are Bambu Studio's own estimates for the P2S, 0.4 mm nozzle, "0.20mm Standard" with 3 walls, Bambu PLA Basic.
In Bambu Studio, for each plate:
- File → Import → Import 3MF/STL/STEP… and pick the plate file. It will say the file was not made by Bambu Studio and only the geometry is loaded: that is expected. If it asks whether to load it as one object with multiple parts, answer no.
- Process "0.20mm Standard". Under Strength set Wall loops to 3. Leave supports off.
- Choose the filament, Slice plate, Print plate.
The parts are already turned the right way up. Don't auto-orient them:
| Part | How it lies on the bed |
|---|---|
| base, attic block | as they stand |
| walls | upside-down, standing on the ceiling |
| roof | on end, standing on one gable edge with the ridge upright |
| door, shutters, moon | on their backs |
The walls have to be upside-down. Their socket openings run down to their lower edge, and so does the top of the way in to the microSD card, so as they stand they would start as separate pieces with bridges laid across them, which is how the Fossil Rib Cage's first shell failed. Upside-down they start as one flat face 100 × 69 mm and the openings are open at the top. That is also why the two gables are not part of the walls: upside-down they would be points on the bed.
The roof stands on end so that both of its sides print as upright walls, with the shingles drawn by the outline of each layer. It is the tallest, thinnest print here: 77 mm tall on a footprint of 111 × 32 mm, with 4.3 cm² of it touching the bed. If it comes loose, give it a brim.
PETG is the safer choice next to a Pi 4, at least for the white parts.
Hardware
| Qty | Screw | Where |
|---|---|---|
| 4 | M3 × 8 pan head | base → walls, from underneath |
| 4 | M3 × 8 pan head | walls → attic block, up through the ceiling from inside |
| 2 | M3 × 8 pan head | attic block → roof, up into the ridge from inside the block |
| 1 | M3 × 8 pan head | wall → moon, through the door, from inside |
| 4 | M2.5 × 6 | Pi → base posts |
| 4 | M2.5 × 6 | wall → shutters, two each, from inside |
| 4 | 12 mm stick-on rubber feet | recesses under the base |
| 1 | 12 mm momentary push button, panel mount (M12 thread) | power button, in the end wall |
| 1 | CanaKit Raspberry Pi Fan (RSP-FAN, 30 × 30 mm) | in the attic |
That is 11 M3 × 8 and 8 M2.5 × 6. All screws thread straight into the plastic (pilot holes are sized for that). The button, fan and feet are the same ones the other cases use.
Assembly

"Front" is the side with the door. Seen from the front, USB and Ethernet are at the left-hand end and the power button at the right-hand end.
- Screw the Pi to the four posts in the base: the 40-pin header along the front (the side with the four slots), USB-C and HDMI over the dip in the back edge.
- Hold each shutter over its star-shaped hole in the front wall, curved edge up, and fit 2 M2.5 screws into it from inside the walls.
- Lay the moon in its bed on the door, sit the door inside its frame, and fit 1 M3 screw from inside through the wall and the door into the moon.
- Push the power button through the hole in the end wall from outside and tighten its nut inside.
- Turn the attic block upside-down and lay the roof under it. Fit 2 M3 screws down the two holes inside the block's passage into the roof's ridge. The roof goes on either way round.
- Stand the walls upright. Lay the fan on the ceiling over the round hole, label up, turned so its lead leaves beside the L-shaped slot, and feed the lead down through the slot.
- Lower the attic block over the fan, the vents to front and back and its cut-away corner over the lead. Two ridges pinch the fan, so press it down the last few millimetres. Holding the two together, turn them over and fit 4 M3 screws through the ceiling into the block.
- Hold the walls over the base. Plug the button onto pins 5 and 6 and the fan's two wires onto pins 4 and 9 (see "Wiring" below).
- Lower the walls straight down. Their socket openings are slots open at the bottom, so they pass the sockets, and the lip on the base goes inside the front wall and the button's end wall.
- Turn the case over, fit the 4 base screws, and stick on the feet. The screw heads sit 6.4 mm down their holes.
The microSD card goes in and comes out with the case closed: see below.
The microSD card

The card comes out and goes in with the case closed and standing on its feet, through the opening at the foot of the power button's end wall. The card's end is 9 mm in from the wall's face, under the end of the board, too deep for a slot and a nail. So the opening runs from the bottom of the base up to 14 mm, 24 mm wide, and the base's floor is cut away for 13 mm behind it. A fingertip slides in along the table to the card's underside, and nothing else is in its way.
- To take it out: lay a fingertip on the table, nail up, and slide it straight in under the board, a little toward the back of the house from under the button. When it is under the card's end, press up on the card and draw it out.
- To put one in: hold it with its contacts up, toward the board, and slide it in under the board until it enters the socket. Push its end with a fingertip until it stops, about 2.5 mm out of the socket, as on a bare Pi.
- Tweezers on the card's end do the same, for a short nail or a finger that will not reach.
Wiring
With the base in front of you and its slotted front edge toward you, the 40-pin header runs along the near edge of the Pi and pin 1 is at its right-hand end (the microSD end). The row nearer you holds the even pins, the row nearer the middle of the board the odd ones.
- Button → pins 5 and 6: the third pair from the right, one behind the other. Either wire on either pin.
- Fan red → pin 4 (5 V): near row, second from the right.
- Fan black → pin 9 (ground): far row, fifth from the right.
Count carefully: the first two pins of the near row (pins 2 and 4) carry 5 V. Bridging
5 V to a GPIO pin can damage the Pi. The fan runs whenever the Pi has power.
The Arcade Wedge's README has the dtoverlay=gpio-shutdown line
the button needs and what to expect from it.
Fan

The fan lies flat on the walls' ceiling, over a 28 mm hole above the middle of the Pi, in a pocket in the underside of the attic block. Nothing clips. The pocket's sides hold it and two ridges pinch it, a low wall at each end of the pocket stops it sliding along the attic, and the pocket's sloping sides stop it rising.
With its label up the fan draws air up off the Pi and blows it along a passage under the ridge and out through the three slots in each gable, 3 cm² in all. Air comes in through the four slots in the base, the stars in the shutters, the way in to the microSD card and round the sockets. Turned over, it blows down onto the Pi instead.
Check before printing
- Fan: the pocket takes a fan 30 × 30 mm square and up to 7.6 mm thick.
CanaKit publishes 30 × 30 mm but not the thickness; 7 mm is the figure usually
quoted. If yours is thicker, set
FAN_T_MAXto its thickness and re-run the script. There is room for 8.5 mm before the passage above the fan reaches the seats of the ridge screws. - The fan's lead: room is cut for it round one corner of the pocket, on both sides of that corner. A lead that leaves the middle of a side has no way out: check yours.
- Button: a 12 mm panel button with a nut up to 16.2 mm across its corners. Its
body passes 1.1 mm above where the Pi's display connector is drawn, 5.5 mm tall.
There is no room for a 16 mm button. Set
SWITCH_HOLE_Dto 0 for no hole. - Plugs: the socket openings are the size the other cases use. The base stands 1 mm inside the walls, so the moulding of a plug that stops at the wall does not meet it.
What differs from the concept picture
- It is the picture seen in a mirror. On a Pi 4, with USB and Ethernet at the right-hand end, USB-C and HDMI are along the near side. Built as pictured, the power and TV cables would leave from beside the door. Mirrored, they leave from the back, and USB and Ethernet are on the left as you face the door. The front itself looks the same either way.
- The back has sockets too: USB-C, two HDMI and audio. The back gable has the same three vents as the front.
- A power button, on the right-hand end wall, and under it the way in to the microSD card. The picture shows neither.
- There is a joint across each gable at the height of the eaves. The gables belong to the attic block, not the walls (see "Printing"). They stand 0.8 mm proud of the walls, so the joint reads as a step and not as a crack.
- The USB and Ethernet sockets show through three openings, not one framed window, and the openings run down to the black base with no white under them. The walls have to pass the sockets as they go on, and the strips between the openings hold the wall together.
- The door is wider than it is tall, 24 × 21 mm. The walls are only 27 mm tall, and the frame has to end below the joint.
- The shutters do not open, and the door does not either.
- The roof has five rows of five shingles a side, a round roll along the ridge, and slopes at 26°.
- The feet are stick-on rubber ones in recesses, not printed.
- A fan, which the picture does not show.
What has been checked
- Nothing here has been printed.
- Both checks of
../print_check.py(uv run ../print_check.py stl/*.stl), which the Fossil Rib Cage's two failed prints were missing. They read the same with the microSD card's opening as without it: - Every part starts on the bed as one piece, and no piece starts apart from the rest higher up. An earlier drawing of the walls failed this: the lowest notch of each star-shaped window is a point of wall which, upside-down, started in mid-air (0.8 mm²). That notch is now left out of the hole in the wall. The star in the shutter in front of it is whole.
- No piece leans while it stands alone. The pieces that do stand alone are upright: in the walls, the two strips between the USB and Ethernet openings (3 × 5.4 mm, 17 and 19 mm tall) and a post between the back openings (1.9 × 2.4 mm, 8 mm tall), the same as the Rib Cage's and the Cat Nap's. Worked out as beams, the strips move 0.07 mm at the top for each newton pushed sideways. The grille bars of the Arcade Wedge's shell, which printed, move 0.47.
- Undersides, by scanning the print-orientation STL files for faces that lean more than 45°. What it finds are bridges and the tops of holes:
- walls: the top of the button's hole (12.4 mm round), the flat edge of each star window (5 mm) and the screw holes. The door's frame, the ledges under the windows and the screw blocks are all sloped at 45° on the side that faces the bed.
- attic block: the tops of the vents (bridges of 28, 20 and 10 mm), the flat roof of the passage (5.4 mm wide) and the seats of the two ridge screws (7 mm).
- base: the tops of the slots (9 mm) and the roofs of the feet's recesses (12 mm) and the screw heads' (7 mm), as the other cases' bases have.
- roof: only the two screw holes, which lie sideways (2.8 mm). The round end of every shingle is sloped at 45°.
- door: none. Shutter: the ends of its two screw holes. Moon: its screw hole ends in a blunt point.
- In CAD: no part overlaps another, or the reference Pi, a fan 7 or 7.6 mm thick, the button, any screw head, or jumper plugs standing on header pins 4, 5, 6 and 9. These moves were stepped through: the roof off the attic block, the block off the fan and the walls, the walls with everything fixed to them off the base over the Pi, the door out of its frame, a shutter off the wall. Nothing touches except the two ridges that pinch the fan.
- The microSD card's opening, in CAD, with the case closed. It cuts only the base and the walls, and only takes plastic away, so every fit above is as it was. A box 14 mm wide round the card, from 1 mm under it to the board's underside, runs clear from outside to the card's end. So does a fingertip 16 mm wide from the table to the card's underside, reaching 1.5 mm in past the card's end, with the table where the pictures put it, 3.5 mm under the base. The opening misses the button and its nut (3.8 mm of wall is left under the button's hole), the screw blocks, the Pi's posts and the feet. It adds no undersides to either part: in both it is open at the edge that is up as they print, and the base still starts on the bed as one piece. Nothing has been printed with it, and no card or finger has been tried through it.
- The moon: its mesh is a closed surface. It lies 0.25 mm inside its bed in the door all round. Its screw hole has 1.3 mm of plastic round it for its whole depth and 1.2 mm above its point. An earlier drawing had 0.8 mm, and the moon was made fuller.
- In the slicer: the five plates slice in Bambu Studio with the P2S profile, no supports, no warnings. Both of the Rib Cage's failed plates passed this too, so it says little. The black and white plates were sliced again with the card's opening, headless, with the same settings: no warnings, and the times and weights above.
- What to look at on the first prints:
- The roof, on end. Its two sides are plates 2.2 to 4.2 mm thick held only along the ridge, so the eaves are free edges 60 mm from it. Look for ripples near the top. Half of each shingle's round end faces the bed, at 45°.
- The attic block's vents: the widest is a 28 mm bridge in a 2.4 mm wall, on the front of the house.
- The door's frame: its outer face prints facing the bed at 45°, and it is the most looked-at white surface.
- What depends on the printer and has no check here: the door in its frame, the moon
in its bed and the lip on the base (
FIT), the roof on the attic block (ROOF_CL), the fan's pinch (FAN_GRIP), and the screws biting, most of all the M3 into the moon (4 mm of thread in a part 14 mm across) and the M2.5 into each shutter (3 mm). - What depends on parts I have not measured: the button over the display connector, where the fan's lead leaves it, and how far a jumper plug's wire needs to bend. The plugs' tops are 5 mm under the ceiling. Where the card's end really is (drawn from the Pi's drawing, good to about 1 mm), and how tall the feet are: the fingertip goes under the card from the table, so thinner feet leave it less room.
Parameters worth knowing (top of cottage_case.py)
| Name | Default | Effect |
|---|---|---|
HL, WS, R0 |
50.2 / 34.5 / 3 | half-length, half-depth and corner radius of the walls. The Pi sits against the back wall and the USB end; the front and the other end have the room for the screw blocks and the button |
Z_RIM |
9 | height of the black base. The Pi's board is PI_LIFT (1 mm) above it |
Z_DIP |
7.2 | top of the base under the back sockets |
Z_CEIL, CEIL_T |
33 / 2.6 | underside and thickness of the ceiling |
BASE_IN |
1 | how far the base stands inside the walls |
SLOT_X, SLOT_L |
four / 9 | the air slots in the front of the base |
PITCH_T |
0.48 | rise of the roof per mm across |
EAVE_OUT, GABLE_OUT |
5.3 / 3.2 | how far the roof overhangs the side walls and the gables |
JETTY |
0.8 | how far the gables stand proud of the walls |
ROOF_T, ROOF_CL |
2.2 / 0.25 | the roof's thickness under its shingles, and its gap to the attic block |
COURSES, TABS, SH_TIP |
5 / 5 / 2 | rows of shingles a side, shingles in a row, thickness at their round ends |
RIDGE_R |
3.6 | the roll along the ridge. The two ridge screws end inside it |
VENTS, VENT_H |
three / 2.6 | the slots in each gable: height above the walls and width, and how tall each is |
FIT |
0.25 | clearance between printed parts; raise it if your printer runs tight |
FAN_T_MAX, FAN_FIT |
7.6 / 0.2 | thickest fan the pocket takes, and the clearance at its sides |
FAN_GRIP |
0.25 | height of the two ridges that pinch the fan (less = looser) |
WIRE_W, WIRE_L |
3.5 / 12 | the room for the fan's lead round one corner of the pocket |
SWITCH_HOLE_D, BTN_Y, BTN_Z |
12.4 / 0 / 24 | the button's hole (0 for none) and where it is on the end wall |
SD_HOLE_W, SD_HOLE_Y, SD_HOLE_TOP, SD_HOLE_R |
24 / 0 / 14 / 4 | the way in to the microSD card, at the foot of the button's end wall: its width (0 for none), its middle, its top above the base's underside and the radius of its top corners. The card's middle is at y = -3.7 |
SD_FLOOR_IN |
13 | how far in from the wall's face the base's floor is cut away behind it (0 for not at all). The card's end is 9 mm in |
DOOR_W, DOOR_STRAIGHT, DOOR_T |
24 / 9 / 2 | the door: width, height below its round top, thickness |
FRAME_W, FRAME_H |
3.6 / 2.6 | the frame round the door: width at the wall, how far it stands out |
SHUT_X, SHUT_Z, SHUT_W, SHUT_H, SHUT_T |
30 / 22.6 / 16 / 17.6 / 4 | where the windows are, and the shutters' size |
WIN_R, WIN_RI |
4.2 / 1.8 | the star in each shutter: tips and notches |
MOON_R, MOON_RI, MOON_OFF, MOON_TURN |
7 / 5.2 / 4.4 / 20 | the moon: its outer circle, the circle bitten out of it, how far over the bite is, and which way it faces |
MOON_H, MOON_PUFF, MOON_SINK |
6.4 / 3 / 0.4 | how far the moon stands up, how full it is, how deep it sits in the door |
M3_PILOT, PI_SCREW_PILOT |
2.8 / 2.15 | self-tapping hole sizes |
A thinner moon leaves less plastic round its screw. Run
uv run ../print_check.py stl/*.stl after any change.
Redrawing the previews
uv run cottage_case.py --assembled /tmp/cottage_assembled
/Applications/Blender.app/Contents/MacOS/Blender -b -P render_previews.py -- \
/tmp/cottage_assembled stl preview
Where the dimensions come from
- Raspberry Pi 4 Model B: official mechanical drawing (https://datasheets.raspberrypi.com/rpi4/raspberry-pi-4-mechanical-drawing.pdf). The display and camera connectors are drawn 5.5 mm tall, the usual figure for that kind of connector, not one taken from the drawing.
- Fan: CanaKit Raspberry Pi Fan product page (https://www.canakit.com/raspberry-pi-fan.html): 30 × 30 mm. The thickness is the usual value for 30 mm fans, not a CanaKit figure.
- Push button: a 15 mm rim, a 14 mm nut and 27 mm behind the wall's face are the usual values for 12 mm panel buttons, not a measurement of yours.
- Jumper plugs are drawn 14 mm tall on a header 2.5 mm above the board.