// Tempi case — two printed parts, no supports, no screws. // Top view matches the wiring picture: ESP32-S3-Zero on the left with USB-C // through the back wall, RFM69HW on the right, antenna straight up through the lid. // // openscad -D 'part="base"' -o tempi-skal-bas.stl tempi-skal.scad // openscad -D 'part="lid"' -o tempi-skal-lock.stl tempi-skal.scad (already flipped for printing) // part="plate" shows both as they go on the bed, part="open" the assembled view. part = "open"; // ---- sizes (mm) ----------------------------------------------------------- cav_x = 50; cav_y = 28; // cavity wall = 2; floor_t = 2; depth = 14; // cavity depth in the base r_out = 7; // outer corner radius chamfer = 1.2; lid_t = 2.4; // lid plate lip = 3; lip_t = 1.6; // lid lip: depth, thickness fit = 0.15; // clearance per side between lip and wall; raise if the lid is tight rest = 2; // boards sit this high above the floor (room for wire ends) gap = 0.35; fence = 1.2; // play around each board, thickness of the fences that locate it hold = 0.4; // air between the lid's two posts and the parts they hold down esp = [18, 23.5, 1.2]; // ESP32-S3-Zero, USB edge against the back wall esp_x = -cav_x/2 + 2.5; // left edge of the board rfm = [19.7, 16, 1.6]; // RFM69HW, turned so SCK/MISO/MOSI/NSS face the ESP32 rfm_x = esp_x + esp[0] + 7; rfm_y = cav_y/2 - 0.5 - rfm[1]; usb = [12.5, 7]; // opening for the plug's overmould usb_z = floor_t + rest + esp[2] + 1.6; ant = [rfm_x + 1.0, rfm_y + rfm[1] - 3.0]; // ANA pad: second from the back on the RFM's left edge ant_d = 2.4; led = [esp_x + esp[0]/2, cav_y/2 - 6.5]; // RGB LED between the two buttons led_d = 6; led_skin = 0.5; chip = [esp_x + esp[0]/2, cav_y/2 - 16]; // middle of the ESP32 chip can = [rfm_x + rfm[0]/2, rfm_y + rfm[1]/2 - 2]; // on the radio's shield, clear of the antenna L = cav_x + 2*wall; W = cav_y + 2*wall; H = floor_t + depth; $fn = 64; module rr(l, w, r) { offset(r) square([l - 2*r, w - 2*r], center = true); } module shell(h, c_bottom = 0, c_top = 0) { hull() { translate([0, 0, c_bottom]) linear_extrude(h - c_bottom - c_top) rr(L, W, r_out); if (c_bottom > 0) linear_extrude(0.01) rr(L - 2*c_bottom, W - 2*c_bottom, r_out - c_bottom); if (c_top > 0) translate([0, 0, h - 0.01]) linear_extrude(0.01) rr(L - 2*c_top, W - 2*c_top, r_out - c_top); } } module base() { ex = esp_x + esp[0]/2; difference() { union() { difference() { shell(H, c_bottom = chamfer); translate([0, 0, floor_t]) linear_extrude(depth + 1) rr(cav_x, cav_y, r_out - wall); } // ESP32 tray: a rest under the middle (the pin rows stay free for wire ends), a fence on both // long sides and a stop behind the board that takes the push of the plug translate([ex - 3.5, cav_y/2 - esp[1], floor_t - .01]) cube([7, esp[1], rest]); for (x = [esp_x - gap - fence, esp_x + esp[0] + gap]) translate([x, cav_y/2 - esp[1] - gap - fence, floor_t - .01]) cube([fence, esp[1] + gap + fence - 4, rest + esp[2]]); translate([esp_x - gap - fence, cav_y/2 - esp[1] - gap - fence, floor_t - .01]) cube([esp[0] + 2*gap + 2*fence, fence, rest + esp[2] + 1.5]); // radio tray: rest under the middle, full fences front and back, low ones under the pad rows translate([rfm_x + rfm[0]/2 - 4.5, rfm_y + rfm[1]/2 - 4.5, floor_t - .01]) cube([9, 9, rest]); for (y = [rfm_y - gap - fence, rfm_y + rfm[1] + gap]) translate([rfm_x - gap - fence, y, floor_t - .01]) cube([rfm[0] + 2*gap + 2*fence, min(fence, cav_y/2 - y), rest + rfm[2]]); for (x = [rfm_x - gap - fence, rfm_x + rfm[0] + gap]) translate([x, rfm_y - gap - fence, floor_t - .01]) cube([fence, rfm[1] + 2*gap + fence, rest + 0.8]); } // USB-C opening in the back wall translate([ex, cav_y/2 - 1, usb_z]) rotate([-90, 0, 0]) linear_extrude(wall + 2) hull() for (s = [-1, 1]) translate([s * (usb[0] - usb[1])/2, 0]) circle(d = usb[1]); // nail notch to get the lid off translate([-5, -W/2 - 1, H - 1.2]) cube([10, wall + 1.01, 2]); } } module lid() { // as it sits on the box difference() { union() { translate([0, 0, H]) shell(lid_t, c_top = chamfer); translate([0, 0, H - lip]) linear_extrude(lip + .01) difference() { rr(cav_x - 2*fit, cav_y - 2*fit, r_out - wall - fit); rr(cav_x - 2*fit - 2*lip_t, cav_y - 2*fit - 2*lip_t, r_out - wall - fit - lip_t); } // two posts keep the boards in their trays: one over the ESP32 chip, one over the radio's shield translate([chip[0], chip[1], floor_t + rest + esp[2] + 0.9 + hold]) cylinder(d = 4, h = H - (floor_t + rest + esp[2] + 0.9 + hold) + .01, $fn = 32); translate([can[0], can[1], floor_t + rest + rfm[2] + 1.8 + hold]) cylinder(d = 4, h = H - (floor_t + rest + rfm[2] + 1.8 + hold) + .01, $fn = 32); } translate([ant[0], ant[1], H - 1]) cylinder(d = ant_d, h = lid_t + 2, $fn = 32); translate([led[0], led[1], H - 1]) cylinder(d = led_d, h = lid_t - led_skin + 1, $fn = 48); } } module lid_print() { translate([0, 0, H + lid_t]) rotate([180, 0, 0]) lid(); } // ---- dummies for pictures only -------------------------------------------- bz = floor_t + rest; module esp_pcb() { translate([esp_x, cav_y/2 - esp[1] + 0.1, bz]) cube(esp); } module esp_metal(){ translate([esp_x + esp[0]/2 - 4.5, cav_y/2 - 6.6, bz + esp[2]]) cube([9, 7.6, 3.2]); } module esp_chip() { translate([chip[0], chip[1], bz + esp[2]]) rotate(45) translate([-3.5, -3.5, 0]) cube([7, 7, 0.9]); } module esp_btn() { for (s = [-1, 1]) translate([esp_x + esp[0]/2 + s*4.6 - 1.5, cav_y/2 - 9.3, bz + esp[2]]) cube([3, 3, 1.4]); } module esp_led() { translate([esp_x + esp[0]/2 - 1, cav_y/2 - 9, bz + esp[2]]) cube([2, 2, 0.8]); } module rfm_pcb() { translate([rfm_x, rfm_y, bz]) cube(rfm); } module rfm_can() { translate([rfm_x + 4.5, rfm_y + 2.5, bz + rfm[2]]) cube([11, 11, 1.8]); } module antenna(h = 40) { translate([ant[0], ant[1], bz + rfm[2]]) cylinder(d = 1.3, h = h, $fn = 16); } pts = [[0, 0, 0], [1, 0, 0]]; module wire(d = 1.25) { for (i = [0 : len(pts) - 2]) hull() { translate(pts[i]) sphere(d = d, $fn = 10); translate(pts[i + 1]) sphere(d = d, $fn = 10); } } if (part == "base") base(); else if (part == "lid") lid_print(); else if (part == "lid_on") lid(); else if (part == "plate") { translate([0, -W/2 - 4, 0]) base(); translate([0, W/2 + 4, 0]) lid_print(); } else if (part == "esp_pcb") esp_pcb(); else if (part == "esp_metal") { esp_metal(); rfm_can(); } else if (part == "esp_chip") { esp_chip(); esp_btn(); } else if (part == "esp_led") esp_led(); else if (part == "rfm_pcb") rfm_pcb(); else if (part == "antenna") antenna(); else if (part == "wire") wire(); else { color("#d9572b") base(); color("#d9572b") translate([0, 0, 22]) lid(); color("#234") esp_pcb(); color("#ccc") { esp_metal(); rfm_can(); } color("#4b8a57") rfm_pcb(); color("#eab23a") antenna(); }