Home Remote case files and code
From the Subzero Labs video on YouTube.
Free, no sign-up. Copy it, use it, share it.
# Home Remote: case files and the door check 1. case_v5e.py draws both halves of the case and writes the STL files. Print the front with the face down and the back with the floor down. 2. door_check.py shows which parts answer on the two talking wires of the Pi (pins 3 and 5). 3. If all 112 answer only when the battery board is on: turn everything off, take the battery board off, and cover pads 3 and 5 on the bottom of the Pi with thin Kapton tape. Cover only those two. Put it back together and run the check again. 4. What the tape costs you: no battery percentage, no extra button, no clock on the battery board, and the Pi can't switch the battery off by itself. This is what worked on one Raspberry Pi Zero 2 W with a Whisplay Hat and a PiSugar 3. I don't know for sure why it happened. A firmware update from the maker may fix it properly. ## Known problems in this version (v5e), a fix is planned - The battery's small status lights, to the right of the power button, are hidden by the case. - The battery board is only held by magnets, so it can move when you push the power button.
"""Home Remote case v5e: Raspberry Pi Zero 2 W + Whisplay Hat + PiSugar 3, two halves that snap together.
Run: pip install build123d, then python case_v5e.py. It writes the STL files next to it.
In the video the openings were moved 2.5 mm: that is DX below."""
from build123d import *
DX = 2.5
HDX = 1.5 # HDMI window toward the LED end too
# 1. Shell
shell = Pos(0.4, 0, 0) * fillet(Box(71.2, 36.0, 34.5).edges(), radius=3) - Pos(0.4, 0, 0) * Box(67.2, 32.0, 30.5)
# 2. Split at z = 0
front = shell & Pos(0, 0, 50) * Box(200, 200, 100)
back = shell & Pos(0, 0, -50) * Box(200, 200, 100)
# 3. Tongue on FRONT half (thin RING)
front = front + (Pos(0.4, 0, -1.0) * Box(69.2, 34.0, 2.0) - Pos(0.4, 0, 0) * Box(67.2, 32.0, 30.5))
# 4. Groove in BACK half
back = back - Pos(0.4, 0, -1.1) * Box(69.6, 34.4, 2.2)
# 5. SNAP BUMPS on FRONT (outside of tongue) and DIMPLES in BACK (outer groove wall)
front = front + Pos(-20, 17.225, -1.2) * Box(5, 0.45, 0.8) + Pos(20, 17.225, -1.2) * Box(5, 0.45, 0.8) \
+ Pos(30.6, -17.225, -1.2) * Box(3.6, 0.45, 0.8) \
+ Pos(35.225, 0, -1.2) * Box(0.45, 5, 0.8) + Pos(-34.425, 0, -1.2) * Box(0.45, 5, 0.8)
back = back - Pos(-20, 17.4, -1.0) * Box(6, 0.4, 1.2) - Pos(20, 17.4, -1.0) * Box(6, 0.4, 1.2) \
- Pos(30, -17.4, -1.0) * Box(6, 0.4, 1.2) \
- Pos(35.4, 0, -1.0) * Box(0.4, 6, 1.2) - Pos(-34.6, 0, -1.0) * Box(0.4, 6, 1.2)
# Helper for port windows
def win(x, z, w, h, r=1.5):
return Pos(x, -17.0, z) * Rot(90, 0, 0) * extrude(RectangleRounded(w, h, r), amount=4, both=True)
# 6. Port WINDOWS on the -Y side (cut from BOTH halves)
front = front - win(-20.8 + HDX, 4.75, 13, 5.5) \
- win(21.4, 4.75, 9, 4, 1.2) \
\
- win(19.3 + DX, -1.75, 12.4, 7.2, 2.0)
back = back - win(-20.8 + HDX, 4.75, 13, 5.5) \
- win(21.4, 4.75, 9, 4, 1.2) \
\
- win(19.3 + DX, -1.75, 12.4, 7.2, 2.0)
# 7. SD-card notch at the -X end (cut from BOTH halves)
front = front - Pos(-34.2, 0, 5.25) * Box(8, 16, 4)
back = back - Pos(-34.2, 0, 5.25) * Box(8, 16, 4)
# 8. Front screen window (keep v3 exactly)
prof = Rectangle(33.0, 28.0)
prof = fillet(prof.vertices().group_by(Axis.X)[0], 3.9)
prof = fillet(prof.vertices().group_by(Axis.X)[-1], 1.4)
front = front - Pos(6.25, 0, 14.0) * extrude(prof, 4.0) - Pos(6.25, 0, 16.05) * extrude(prof, 1.2, taper=-45)
# LED hole : 2.5 mm, middle, centre 4.7 mm from the OUTER bevel edge of the screen window (x 23.95)
LED_X = 6.25 + 33.0 / 2 + 1.2 + 4.7
front = front - Pos(LED_X, 0, 16.25) * Cylinder(1.25, 6)
# 9. Back vents
for y in [-8, -4, 0, 4, 8]:
back = back - Pos(0, y, -17.25) * Box(40, 2.0, 6)
# Talk button (front half)
front = front - Pos(3.6, -17.0, 9.6) * Box(0.8, 6, 6.8) \
- Pos(15.6, -17.0, 9.6) * Box(0.8, 6, 6.8) \
- Pos(9.6, -17.6, 10.0) * Box(11.2, 0.8, 6.0) \
- Pos(9.6, -17.0, 6.8) * Box(12.8, 6.0, 1.2)
# Add talk button pusher LAST
front = front + Pos(9.6, -15.8, 8.7) * Box(9.0, 0.4, 2.4)
# PiSugar buttons (BACK half)
for bx in [-23.2 + DX, 9.6 + DX]:
# Slits
if bx == 9.6 + DX:
back = back - Pos(bx - 2.9, -17.0, -3.5) * Box(0.8, 6, 7) \
- Pos(12.8 + DX, -17.0, -3.5) * Box(0.8, 6, 7)
else:
back = back - Pos(bx - 2.9, -17.0, -3.5) * Box(0.8, 6, 7) \
- Pos(bx + 2.9, -17.0, -3.5) * Box(0.8, 6, 7)
# Thin outside
back = back - Pos(bx, -17.6, -5.0) * Box(5.0, 0.8, 4.0)
# Clear tongue for flap movement (front half)
front = front - Pos(bx, -16.5, -1.0) * Box(7.0, 2.0, 2.4)
# Add PiSugar pushers LAST
back = back + Pos(-23.2 + DX, -16.5, -0.9) * Box(4.0, 1.8, 1.6) \
+ Pos(9.6 + DX, -16.5, -0.9) * Box(4.0, 1.8, 1.6)
# Export
export_stl(front, "case_v5e_front.stl")
export_stl(back, "case_v5e_back.stl")
print(f"Front size: {front.bounding_box().size}")
print(f"Back size: {back.bounding_box().size}")
with open("case_v5e_solids.txt", "w") as f:
f.write(f"{len(front.solids())} {len(back.solids())}")
# print-ready: back floor on the bed, front face on the bed; fit slice = the port side wall of the back, full height
def put(p, name, flip=False):
if flip:
p = Rot(180, 0, 0) * p
b = p.bounding_box()
p = Pos(-b.center().X, -b.center().Y, -b.min.Z) * p
export_stl(p, name)
print(name, [round(v, 1) for v in (b.size.X, b.size.Y, b.size.Z)], round(p.volume / 1000, 1), "cm3")
sl = back & Pos(0, -18, -9) * Box(80, 18, 40)
print("slice solids", len(sl.solids()))
put(back, "case_v5e_back_print.stl")
put(front, "case_v5e_front_print.stl", flip=True)
put(sl, "case_v5e_back_fitslice.stl")
fs = front & Pos(0, -18, 8) * Box(80, 18, 60)
print("front slice solids", len(fs.solids()))
put(fs, "case_v5e_front_fitslice.stl", flip=True)
ls = front & Pos(28, 0, 8) * Box(20, 60, 60)
print("led slice solids", len(ls.solids()), "LED x", LED_X)
put(ls, "case_v5e_led_fitslice.stl", flip=True)"""The "112 doors" check from the video. Lists every part that answers on the Pi's two talking wires (I2C bus 1).
Run on the Raspberry Pi: sudo apt install python3-smbus then python3 door_check.py
One or two answers = normal. All 112 = something is answering for everyone, like my battery board did."""
import smbus
bus = smbus.SMBus(1)
found = []
for door in range(0x08, 0x78): # 112 addresses
try:
bus.read_byte(door) # knock: read one byte, change nothing
found.append(hex(door))
except OSError:
pass
print(len(found), "of 112 doors answered:", " ".join(found))Shared as shown in the video. Replace any <PLACEHOLDERS> with your own values.