Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RPi4 (w/ optional "blower" case) and other component changes. #7

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Supported boards
| [NanoPi Neo 2](boards/nanopi_neo2.scad) | ![NanoPi Neo 2](boards/gif/nanopi_neo2.gif) |
| [Orange Pi Zero](boards/orangepi_zero.scad) | ![Orange Pi Zero](boards/gif/orangepi_zero.gif) |
| [Raspberry Pi 3](boards/rpi3.scad) | ![Raspberry Pi 3](boards/gif/rpi3.gif) |
| [Raspberry Pi 4](boards/rpi4.scad) | ![Raspberry Pi 4](boards/gif/rpi4.gif) |


Corresponding cases
Expand All @@ -34,6 +35,8 @@ Corresponding cases
| [NanoPi Neo 2](cases/nanopi_neo2.scad) | ![NanoPi Neo 2](cases/gif/nanopi_neo2.gif) | [VERIFIED](pics/nanopi_neo2.jpg):<br />![NanoPi Neo 2](pics/small/nanopi_neo2.jpg) |
| [Orange Pi Zero](cases/orangepi_zero.scad) | ![Orange Pi Zero](cases/gif/orangepi_zero.gif) | [VERIFIED](pics/orangepi_zero.jpg):<br />![Orange Pi Zero](pics/small/orangepi_zero.jpg) |
| [Raspberry Pi 3](cases/rpi3.scad) | ![Raspberry Pi 3](cases/gif/rpi3.gif) | [VERIFIED](pics/rpi3.jpg):<br />![Raspberry Pi 3](pics/small/rpi3.jpg) |
| [Raspberry Pi 4](cases/rpi4.scad) | ![Raspberry Pi 4](cases/gif/rpi4.gif) | [VERIFIED](pics/rpi4.jpg):<br />![Raspberry Pi 4](pics/small/rpi4.jpg) |
| [Raspberry Pi 4](cases/rpi4_blower.scad)(blower fan case) | ![Raspberry Pi 4](cases/gif/rpi4_blower.gif) | [VERIFIED](pics/rpi4_blower.jpg):<br />![Raspberry Pi 4](pics/small/rpi4_blower.jpg) |


Usage
Expand Down
7 changes: 7 additions & 0 deletions boards.scad
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use <boards/hikey.scad>
use <boards/nanopi_neo2.scad>
use <boards/orangepi_zero.scad>
use <boards/rpi3.scad>
use <boards/rpi4.scad>
use <boards/wemos_esp8266.scad>

boards = [
Expand All @@ -31,6 +32,8 @@ boards = [
["nanopi_neo2", nanopi_neo2_info()],
["orangepi_zero", orangepi_zero_info()],
["rpi3", raspberry_pi_3_info()],
["rpi4", raspberry_pi_4_info()],
["rpi4_blower", raspberry_pi_4_info(blower=true)],
["wemos_esp8266", wemos_esp8266_info()],
];

Expand All @@ -42,6 +45,8 @@ module boards_get_plate_2d(id) {
nanopi_neo2_plate_2d();
orangepi_zero_plate_2d();
raspberry_pi_3_plate_2d();
raspberry_pi_4_plate_2d();
raspberry_pi_4_plate_2d(); // blower case
wemos_esp8266_plate_2d();
}
}
Expand All @@ -54,6 +59,8 @@ module boards_get_board(id) {
nanopi_neo2();
orangepi_zero();
raspberry_pi_3();
raspberry_pi_4();
raspberry_pi_4(blower=true);
wemos_esp8266();
}
}
Expand Down
4 changes: 2 additions & 2 deletions boards/bbb.scad
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ comp_info = [
[ethernet_info(), ethernet_dim, [ 1, 1,-1], [0,0,2], [-1,-1, 1], [-in2mm(100), in2mm(855), 0]],
[female_header_info(), gpio_dim, [-1, 1,-1], [0,0,0], [-1, 1, 1], [18, -0.5, 0]],
[female_header_info(), gpio_dim, [-1,-1,-1], [0,0,0], [-1,-1, 1], [18, 0.5, 0]],
[microhdmi_info(), microhdmi_dim, [ 1,-1, 1], [0,0,0], [ 1,-1,-1], [ in2mm(25), in2mm(850), 0]],
[microhdmi_info(), microhdmi_dim, [ 1, 1,-1], [2,0,0], [ 1,-1,-1], [ in2mm(25), in2mm(850), 0]],
[microsdcard_info(), microsdcard_dim, [ 1,-1, 1], [0,0,0], [ 1,-1,-1], [in2mm(110), in2mm(1205)+.5, 0]],
[microsdslot_info(), microsdslot_dim, [ 1,-1, 1], [0,0,0], [ 1,-1,-1], [0, in2mm(1205), 0]],
[miniusb_info(), miniusb_dim, [ 1, 1, 1], [0,0,2], [-1,-1,-1], [-in2mm(25), in2mm(1575), 0]],
Expand All @@ -108,7 +108,7 @@ module beaglebone_black() {
ethernet(dim=ethernet_dim);
female_header_pitch254(dim=gpio_dim, n=23, m=2);
female_header_pitch254(dim=gpio_dim, n=23, m=2);
microhdmi(dim=microhdmi_dim);
microhdmi(dim=microhdmi_dim, l_fold=0);
microsdcard(dim=microsdcard_dim);
microsdslot(dim=microsdslot_dim);
miniusb(dim=miniusb_dim);
Expand Down
Binary file modified boards/gif/bbb.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified boards/gif/cubieboard.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified boards/gif/hikey.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified boards/gif/nanopi_neo2.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified boards/gif/orangepi_zero.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified boards/gif/rpi3.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added boards/gif/rpi4.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added boards/gif/wemos_esp8266.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
155 changes: 155 additions & 0 deletions boards/rpi4.scad
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
// Copyright (c) 2017 Clément Bœsch <u pkh.me>
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

include <../globals.scad>

use <../case.scad>
use <../utils.scad>
use <../electronics/cpu.scad>
use <../electronics/hdmi.scad>
use <../electronics/header.scad>
use <../electronics/jack.scad>
use <../electronics/misc.scad>
use <../electronics/network.scad>
use <../electronics/sd.scad>
use <../electronics/usb.scad>


board_dim = [85, 56, 1.25];


/* Plate holes */
hole_d = 2.75;
hole_orig = [board_dim[0], board_dim[1]] * -.5;
ring_off = 5.6 - hole_d;
hole_pad = 3.5;
holes_pos = [for (y=[0, 49], x=[0, 58]) hole_orig + [x, y] + hole_pad*[1,1]];

lusb = 17.5;
wusb = 15;
husb = 16;

duct_th = 1.2;

/* Components bounding box dimensions */
ethernet_dim = [21.25, 16,13.75];
gpio_dim = [ 51, 5, 8.5];
microhdmi_dim = [ 7.3, 6.5, 3.25];
jack_dim = [ 14.5, 7, 6];
microsdcard_dim = [ 15, 11, 1];
microsdslot_dim = [ 11.5, 12, 1.25];
usbc_dim = [ 7.35, 8.94, 3.2];
serialcon_dim = [ 2.5, 22, 5.5];
usbx2_dim = [ lusb, wusb, husb];
cpu_dim = [ 15, 15, 2.4]; // draw cpu to assist fan aligmnent

ethusb_dim = [ lusb, 3.25, husb]; // cleanup box
usbusb_dim = [ lusb, 3, husb]; // cleanup box
btm_cutout_dim = [ 10,52.5,husb+1];
duct_dim = [15+2*duct_th,20+2*duct_th,26.2];

module raspberry_pi_4_plate_2d() {
plate_2d(board_dim[0], board_dim[1], 3);
}

function comp_info(blower=false) = [
/* info function box dimensions comp-corner rotate board-corner position */
[microhdmi_info(), microhdmi_dim, [ 1, 0,-1], [0,0,3], [-1,-1, 1], [ 26,-1.65, 0]],
[microhdmi_info(), microhdmi_dim, [ 1, 0,-1], [0,0,3], [-1,-1, 1], [39.5,-1.65, 0]],
[jack_info(), jack_dim, [ 1, 0,-1], [0,0,3], [-1,-1, 1], [53.5, -2, 0]],
[microsdcard_info(), microsdcard_dim, [ 1, 0,-1], [2,0,2], [-1, 0,-1], [-2.25, 0, 0]],
[microsdslot_info(), microsdslot_dim, [ 1, 0,-1], [2,0,2], [-1, 0,-1], [ 1.75, 0, 0]],
[usbc_info(), usbc_dim, [ 1, 0,-1], [0,0,3], [-1,-1, 1], [11.2, -1.2, 0]],
[pin_header_info(), gpio_dim, [ 0, 0,-1], [0,0,0], [-1, 1, 1], [32.5, -3.5, 0]],
[serialcon_rpi_info(), serialcon_dim, [ 0,-1,-1], [0,0,0], [-1,-1, 1], [ 46.5, 1, 0]], // camera
[serialcon_rpi_info(), serialcon_dim, [ 0, 0,-1], [0,0,2], [-1,-1, 1], [ 4, 28, 0]], // display
[cpu_info(), cpu_dim, [ 0, 0,-1], [0,0,3], [-1,-1, 1], [29.25,32.5, 0]],
if(blower) each [
[ethernet_info(), ethernet_dim, [ 1, 0,-1], [0,0,0], [ 1,-1, 1], [ 3,45.75, 0], 0],
[usbx2_info(), usbx2_dim, [ 1, 0,-1], [0,0,0], [ 1,-1, 1], [ 3.2, 9, 0], 0],
[usbx2_info(), usbx2_dim, [ 1, 0,-1], [0,0,0], [ 1,-1, 1], [ 3.2, 27, 0], 0],
// Case top needs to cover usb/eth, for blower to mount to.
// This component ensures bottom has no odd overhangs on top after extending it's height.
[unknown_info(), btm_cutout_dim, [ 1,-1,-1], [0,0,0], [ 1,-1, 1], [ 3.2, 1.56,-1], 0],
// for case top cutout
[duct_info(), duct_dim, [ 0, 0, 0], [0,0,0], [-1,-1, 1], [29.25,32.5,17.2], 0.25]

] else each [
[ethernet_info(), ethernet_dim, [ 1, 0,-1], [0,0,0], [ 1,-1, 1], [ 3,45.75, 0]],
[usbx2_info(), usbx2_dim, [ 1, 0,-1], [0,0,0], [ 1,-1, 1], [ 3.2, 9, 0]],
[usbx2_info(), usbx2_dim, [ 1, 0,-1], [0,0,0], [ 1,-1, 1], [ 3.2, 27, 0]],
[unknown_info(), ethusb_dim, [ 1, 0,-1], [0,0,0], [ 1,-1, 1], [ 3.2, 36, 0]],
[unknown_info(), usbusb_dim, [ 1, 0,-1], [0,0,0], [ 1,-1, 1], [ 3.2, 18, 0]]
]
];

module raspberry_pi_4(blower=false) {
extrude_plate(board_dim[2], holes_pos, hole_d, ring_off, clr=c_green_pcb, clr_ring=c_yellow)
raspberry_pi_4_plate_2d();

// Must use outer "if" statement so children of conditional are each treated as separate child.
if (blower) {
set_components(board_dim, comp_info(blower)) {
microhdmi(dim=microhdmi_dim);
microhdmi(dim=microhdmi_dim);
jack(dim=jack_dim);
microsdcard(dim=microsdcard_dim);
microsdslot(dim=microsdslot_dim);
usbc(dim=usbc_dim);
pin_header_pitch254(dim=gpio_dim, n=20, m=2);
serialcon_rpi(dim=serialcon_dim);
serialcon_rpi(dim=serialcon_dim);
cpu(dim=cpu_dim, clr=c_metal);

ethernet(dim=ethernet_dim, swap_led=true);
usbx2(dim=usbx2_dim);
usbx2(dim=usbx2_dim, clr=c_usb_blue);
%cube(btm_cutout_dim, center=true);
%duct();
}
} else {
set_components(board_dim, comp_info(blower)) {
microhdmi(dim=microhdmi_dim);
microhdmi(dim=microhdmi_dim);
jack(dim=jack_dim);
microsdcard(dim=microsdcard_dim);
microsdslot(dim=microsdslot_dim);
usbc(dim=usbc_dim);
pin_header_pitch254(dim=gpio_dim, n=20, m=2);
serialcon_rpi(dim=serialcon_dim);
serialcon_rpi(dim=serialcon_dim);
cpu(dim=cpu_dim, clr=c_metal);

ethernet(dim=ethernet_dim, swap_led=true);
usbx2(dim=usbx2_dim);
usbx2(dim=usbx2_dim, clr=c_usb_blue);
%cube(ethusb_dim, center=true);
%cube(usbusb_dim, center=true);
}
}
}

function raspberry_pi_4_info(blower=false) = [
["board_dim", board_dim],
["components", comp_info(blower)],
["holes_d", hole_d],
["holes_pos", holes_pos],
];


blower = false;
demo_board(board_dim) {
raspberry_pi_4(blower);
*#bounding_box(board_dim, comp_info(blower));
}
2 changes: 1 addition & 1 deletion case.scad
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ module _vents(vents, w=2.1) {
start = -length/2 + off + w/2;
translate(pos) {
intersection() {
circle(d=max(dim), center=true);
circle(d=max(dim));
for (i = [0:n_vents-1])
translate([0, start + i*w*2])
square([dim[0], w], center=true);
Expand Down
Binary file modified cases/gif/bbb.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cases/gif/hikey.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cases/gif/nanopi_neo2.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cases/gif/orangepi_zero.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified cases/gif/rpi3.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cases/gif/rpi4.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cases/gif/rpi4_blower.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cases/gif/wemos_esp8266.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions cases/rpi4.scad
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Copyright (c) 2017 Clément Bœsch <u pkh.me>
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

use <../boards/rpi4.scad>
use <../case.scad>
use <../utils.scad>

board_dim = map_get(raspberry_pi_4_info(), "board_dim");

vents = [
[
"bottom", default_bottom_vents(board_dim),
],[
"top", [
["dim", [board_dim[0] * .3, board_dim[1] * .7]],
["pos", [-18, -4.5]],
]
]
];

cfg = [
["min_z", 3],
["max_z", 9],
["vents", vents],
];

mode = "demo";
case("rpi4", cfg, mode);
70 changes: 70 additions & 0 deletions cases/rpi4_blower.scad
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// Copyright (c) 2017 Clément Bœsch <u pkh.me>
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

use <../boards/rpi4.scad>
use <../case.scad>
use <../utils.scad>
use <../electronics/misc.scad>

board_dim = map_get(raspberry_pi_4_info(blower=true), "board_dim");

vents = [
[
"bottom", [],
]
];

cfg = [
["min_z", 2.5],
["max_z", 15],
["vents", vents],
];


// Uncomment to manually export case bottom
// with extra vent holes out of the side (recommended)
/*
!difference() {
case("rpi4_blower", cfg, "bottom");
dslot = 4;
sep = 2;
translate([-43,0,13])
rotate([0,-90]) rotate(-90) linear_extrude(100) {
for(i=[-1:1]) hull() {
translate([(dslot+sep)*i,-4]) circle(d=dslot, $fn=40);
translate([(dslot+sep)*i,4]) circle(d=dslot, $fn=40);
}
for(i=[-4,-3,-2,2,3,4]) hull() {
translate([(dslot+sep)*i,-9]) circle(d=dslot, $fn=40);
translate([(dslot+sep)*i,4]) circle(d=dslot, $fn=40);
}
}
}
//*/

mode = "demo";
case("rpi4_blower", cfg, mode);

// Uncomment to export printed duct separately
//!duct();

/*
// External dependency on NopSCADLib only if blower fan mockup is wanted
// (does not animate with case demo)
$t=1;
include <../NopSCADlib/core.scad>
include <../NopSCADlib/vitamins/blowers.scad>
translate([-5.8,4.5,17.825]) rotate(-90) translate([-10,0,0])
blower(RB5015);
//*/
7 changes: 4 additions & 3 deletions electronics/_internal.scad
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ include <../globals.scad>

$vpr = [50, 0, 90];

module components_demo(pad=30) {
module components_demo(pad=30, rowsfirst=false) {
n = $children;
cols = ceil(sqrt(n));
rows = ceil(n / cols);
// provide option to arranage by rows befor columns
cols = !rowsfirst ? ceil(sqrt(n)) : ceil(n / ceil(sqrt(n)));
rows = rowsfirst ? ceil(sqrt(n)) : ceil(n / ceil(sqrt(n)));
offx = pad * (rows - 1) / 2;
offy = pad * (cols - 1) / 2;
for (i = [0:n-1]) {
Expand Down
Binary file modified electronics/gif/hdmi.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified electronics/gif/usb.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading