-
Notifications
You must be signed in to change notification settings - Fork 1
/
battery-adapter.scad
111 lines (99 loc) · 3.49 KB
/
battery-adapter.scad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
// Written by Tobias Mädel <[email protected]>
// https://github.com/manawyrm
// https://tbspace.de/
circle_segments = 360;
battery_diameter = 10.36;
battery_length = 40.00;
battery_length_pole = 1.20;
battery_pole_diameter = 3.80;
pcb_height = 1.6;
platform_height = (battery_diameter / 2) - pcb_height;
pogo_passthru_length = 8;
pogo_passthru_height = 4;
// battery minus to pogo center
battery_to_pogo = 12.85;
// battery minus to screw hole center
battery_to_screw = 20.21;
// fit for M3 brass threaded insert
screw_hole_diameter = 4;
screw_hole_depth = 7.2;
screw_hole_distance = 5.45;
difference() {
union() {
// plattform for the PCB
color("black")
translate([0,0,battery_diameter / 2 + (platform_height / 2)])
cube([
battery_length,
battery_diameter * 2,
platform_height
],center=true);
// AAA batteries
difference() {
union()
{
color("white")
{
for (i=[0:1])
{
translate([
0,
(0.5 * battery_diameter) - (i * battery_diameter),
battery_diameter / 2
])
{
// swapped polarity
rotate([0, 270 - (i * 180), 0])
{
// main battery
linear_extrude(height = battery_length, center = true)
circle(d = battery_diameter, $fn=circle_segments);
// battery positive pole
//translate([0,0,battery_length / 2 + (battery_length_pole / 2)])
// linear_extrude(height = battery_length_pole, center = true)
// circle(d = battery_pole_diameter, $fn=circle_segments);
}
}
}
}
}
translate([0,0,10])
{
cube([
battery_length,
battery_diameter * 2,
platform_height
],center=true);
}
}
}
// pogo pin hole
translate([-1 * (battery_length / 2 - pogo_passthru_height / 2) + battery_to_pogo,
0,
battery_diameter / 2 + (platform_height / 2)
])
cube([
pogo_passthru_height,
pogo_passthru_length,
50
],center=true);
// screw holes
translate([-1 * (battery_length / 2) + battery_to_screw,
screw_hole_distance,
battery_diameter / 2 + (platform_height / 2)
])
cylinder(h=screw_hole_depth,
r1=screw_hole_diameter / 2,
r2=screw_hole_diameter / 2,
center = true,
$fn=circle_segments);
translate([-1 * (battery_length / 2) + battery_to_screw,
-screw_hole_distance,
battery_diameter / 2 + (platform_height / 2)
])
cylinder(h=screw_hole_depth,
r1=screw_hole_diameter / 2,
r2=screw_hole_diameter / 2,
center = true,
$fn=circle_segments);
}