Skip to content

Instantly share code, notes, and snippets.

@max-dark
Last active February 19, 2025 03:50
Show Gist options
  • Save max-dark/f2e367cfc55f9f26836d098c99dd4b57 to your computer and use it in GitHub Desktop.
Save max-dark/f2e367cfc55f9f26836d098c99dd4b57 to your computer and use it in GitHub Desktop.
Arduino Uno R3 mount holes
/*
0
+--> X (width)
|
V
Y (height)
+---------------------------.
| o<-a \
+-----+ |
| USB | \
+-----+ b->o|
| Arduino UNO R3 |
| mount holes |
|| c->o|
|| o<-d /
+----------------------------+
*/
// constants
MILL_PER_INCH = 1000;
SM_PER_INCH = 2.54;
MM_PER_INCH = SM_PER_INCH * 100;
function inch(mill) = mill / MILL_PER_INCH;
function mill(inch) = inch * MILL_PER_INCH;
function in2sm(inch) = SM_PER_INCH * inch;
function in2mm(inch) = MM_PER_INCH * inch;
function mill2sm(mill) = SM_PER_INCH * inch(mill);
function mill2mm(mill) = MM_PER_INCH * inch(mill);
UNO_R3_WIDTH_INCH = 2.70;
UNO_R3_HEIGHT_INCH = 2.10;
/*
Arduino Uno R3 mount holes
*/
module arduino_uno_mount(d = 3.2)
{
pt_a_x = in2mm(0.55 + 0.05);
pt_a_y = in2mm(0.10);
pt_b_x = pt_a_x + in2mm(2.00);
pt_b_y = pt_a_y + in2mm(0.60);
pt_c_x = pt_b_x + in2mm(0.00);
pt_c_y = pt_b_y + in2mm(1.10);
pt_d_x = pt_a_x - in2mm(0.05);
pt_d_y = in2mm(UNO_R3_HEIGHT_INCH) - in2mm(0.1);
translate([pt_a_x, pt_a_y, 0])
{
circle(d = d);
}
translate([pt_b_x, pt_b_y, 0])
{
circle(d = d);
}
translate([pt_c_x, pt_c_y, 0])
{
circle(d = d);
}
translate([pt_d_x, pt_d_y, 0])
{
circle(d = d);
}
}
module debug_uno()
{
translate([-in2mm(UNO_R3_WIDTH_INCH / 2), -in2mm(UNO_R3_HEIGHT_INCH / 2), 0])
{
difference()
{
linear_extrude(height = 3, center = true)
{
square([in2mm(UNO_R3_WIDTH_INCH), in2mm(UNO_R3_HEIGHT_INCH)]);
}
linear_extrude(height = 10, center = true)
{
arduino_uno_mount(10);
}
}
}
}
debug_uno();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment