-
Notifications
You must be signed in to change notification settings - Fork 42
/
CurrentRanger_OLED.scad
169 lines (125 loc) · 5.7 KB
/
CurrentRanger_OLED.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
// SSD1306 oled module cover
// design by Marius Gheorghescu, September 2020
// offset between the OLED PCB and CurrentRanger PCB
pcb2pcb_offset = 12.60;
// pcb width&height + some clearance
oled_pcb_x = 25.3 + 0.3;
oled_pcb_y = 26.1 + 0.4;
// assuming square pattern
oled_screw_spacing = 21;
// screen dimensions
oled_screen_x = 24;
oled_screen_y = 12;
oled_screen_thickness = 2.4;
// oled offset from center (should be closer to the pins)
oled_screen_y_offset = 1.15;
oled_pcb_thickness = 1.6;
// connector + some clearance
connector_x = 11.3;
connector_y = 2.8;
// ideally multiple of extrusion width to minimize thin walls
wall_thickness = 1.6;
top_wall_thickness = 0.6;
// leave opening to see the logo / access serial
open_bottom = 1;
// internal and computed values (LCD module + 2-3 layers of print)
epsilon = 0.001;
total_case_height = pcb2pcb_offset + oled_screen_thickness + top_wall_thickness;
retainer_clip_cutout = connector_y + wall_thickness;
module case()
{
difference() {
translate([0, 0, total_case_height/2])
hull() {
cube([2*wall_thickness + oled_pcb_x-1, 2*wall_thickness + oled_pcb_y-1, total_case_height], center=true);
cube([2*wall_thickness + oled_pcb_x, 2*wall_thickness + oled_pcb_y-1, total_case_height-1], center=true);
cube([2*wall_thickness + oled_pcb_x-1, 2*wall_thickness + oled_pcb_y, total_case_height-1], center=true);
}
// PCB corner supports (look ma, no screws!)
translate([0,0, (oled_screen_thickness + oled_pcb_thickness)/2 + top_wall_thickness])
hull() {
cube([oled_pcb_x-5, oled_pcb_y, oled_screen_thickness + oled_pcb_thickness], center=true);
cube([oled_pcb_x, oled_pcb_y-5, oled_screen_thickness + oled_pcb_thickness], center=true);
translate([0, 0, total_case_height])
cube([oled_pcb_x, epsilon, epsilon], center=true);
}
// pcb load path
translate([0,0, total_case_height/2 + oled_screen_thickness])
{
difference() {
union() {
cube([oled_pcb_x, oled_pcb_y, total_case_height], center=true);
}
translate([0, oled_pcb_y/2 - connector_y*0.75, 0])
cube([connector_x + 4*wall_thickness, connector_y + + 2*wall_thickness, total_case_height], center=true);
}
}
// LCD cutout
translate([0, oled_screen_y_offset, 0])
cube([oled_screen_x, oled_screen_y, total_case_height], center=true);
// connector
taper_amount = 0.08;
translate([0, oled_pcb_y/2 - connector_y*0.75, total_case_height*3/2 - pcb2pcb_offset])
{
hull() {
translate([0, 0, total_case_height/2])
cube([connector_x + taper_amount, connector_y + taper_amount, epsilon], center=true);
translate([0, 0, -total_case_height/2])
cube([connector_x - taper_amount, connector_y - taper_amount, epsilon], center=true);
}
// connector load clearance
hull() {
translate([0, connector_y/8, -total_case_height/3])
cube([connector_x, connector_y*1.25, 5], center=true);
translate([0, -connector_y, 0])
cube([epsilon, 4+epsilon, epsilon], center=true);
}
translate([0,-wall_thickness/2 - epsilon, 0])
cube([connector_x - connector_y, connector_y+wall_thickness, total_case_height], center=true);
}
// retaining clip
translate([0, -retainer_clip_cutout/2, oled_screen_thickness + oled_pcb_thickness + 1])
hull() {
cube([oled_pcb_x + 2, oled_pcb_y - retainer_clip_cutout, epsilon], center=true);
cube([oled_pcb_x, oled_pcb_y - retainer_clip_cutout, 2], center=true);
}
if (open_bottom) {
// opening to see the logo / access the BT/serial connector
rotate([50,0,0])
translate([0,0, total_case_height + 100/2])
cube([100,100,100], center=true);
}
}
}
module retainer_clip()
{
// springiness - how much to oversize it so it stays put
oversize = 0.5;
//clip_height = oled_pcb_y - retainer_clip_cutout - wall_thickness;
clip_height = oled_pcb_y/2;
difference() {
union() {
translate([0, total_case_height/4, clip_height/2])
cube([oled_pcb_x, total_case_height/2, clip_height], center=true);
// wings
translate([0,0, clip_height/2])
hull() {
cube([oled_pcb_x + 2 + oversize, epsilon, clip_height], center=true);
cube([oled_pcb_x + oversize, 2, clip_height], center=true);
}
}
// make it elastic
translate([0, total_case_height/4 - wall_thickness, clip_height/2])
cube([oled_pcb_x - 2*wall_thickness, total_case_height/2, clip_height + epsilon], center=true);
// clearance for the resistors on the PCB, just in case
hull() {
translate([0, 0, clip_height/2])
cube([oled_pcb_x - 2*wall_thickness, wall_thickness, clip_height + epsilon], center=true);
translate([0, -wall_thickness, clip_height/2])
cube([oled_pcb_x - 2*wall_thickness + wall_thickness*1.5, wall_thickness, clip_height + epsilon], center=true);
}
}
}
case();
translate([2*oled_screen_x, 0, 0])
retainer_clip();