Added JST-XH connector for pcbs.

This commit is contained in:
Martin Budden 2020-01-11 20:53:29 +00:00
parent 2c77f184a2
commit d1324a670e
4 changed files with 85 additions and 1 deletions

View File

@ -718,6 +718,7 @@ module pcb_component(comp, cutouts = false, angle = undef) { //! Draw pcb compon
if(show(comp, "flat_flex")) flat_flex(cutouts);
if(show(comp, "D_plug")) if(!cutouts) translate_z(d_pcb_offset(comp[4])) d_plug(comp[4], pcb = true);
if(show(comp, "molex_hdr")) if(!cutouts) molex_254(comp[4]);
if(show(comp, "jst_xh")) if(!cutouts) jst_xh_header(jst_xh_header, comp[4], param(5, false), param(6, "white"), param(7, undef));
if(show(comp, "term254")) if(!cutouts) green_terminal(gt_2p54,comp[4], comp[5]);
if(show(comp, "gterm35")) if(!cutouts) green_terminal(gt_3p5, comp[4], comp[5]);
if(show(comp, "gterm635")) if(!cutouts) green_terminal(gt_6p35, comp[4], comp[5]);

View File

@ -339,6 +339,20 @@ PERF74x51 = ["PERF74x51", "Perfboard 74 x 51mm", 74, 51, 1.0, 0, 3.0, 0, "sienna
PSU12V1A = ["PSU12V1A", "PSU 12V 1A", 67, 31, 1.7, 0, 3.9, 0, "green", true, [[3.5, 3.5], [-3.5, 3.5], [-3.5, -3.5], [3.5, -3.5]], [], []];
pcbs = [ExtruderPCB, PI_IO, RPI0, EnviroPlus, RPI3, ArduinoUno3, ArduinoLeonardo, Keyes5p1, PERF80x20, PERF70x50, PERF70x30, PERF60x40, PERF74x51, PSU12V1A, DuetE, Duex2, Duex5, Melzi, ZC_A0591];
RAMPSEndstop = ["RAMPSEndstop", "RAMPS Endstop Switch",
40.0, 16.0, 1.6, 0, 2.54, 0, "red", false,
[
[2, 2], [2, 13.5], [17, 13.5], [36, 13.5]
],
[
[ 12, 8, -90, "jst_xh", 3, true, "white", "silver"],
[ 26, 13.5, 0, "chip", 12, 4, 5.5],
[ 26, 10.5, 0, "chip", 12, 2, 5.5, "white"],
[ 27.5, 17, 15, "chip", 15, 0.5, 4.5, "silver"],
],
[]];
pcbs = [ExtruderPCB, PI_IO, RPI0, EnviroPlus, RPI3, ArduinoUno3, ArduinoLeonardo, Keyes5p1, PERF80x20, PERF70x50, PERF70x30, PERF60x40, PERF74x51, PSU12V1A, DuetE, Duex2, Duex5, Melzi, ZC_A0591, RAMPSEndstop];
use <pcb.scad>

View File

@ -205,3 +205,71 @@ module pin_socket(type, cols = 1, rows = 1, right_angle = false, height = 0, smt
}
}
}
module jst_xh_header(type, pin_count, right_angle=false, colour, pin_colour) { //! Draw JST XH connector
colour = colour ? colour : hdr_base_colour(type);
pin_colour = pin_colour ? pin_colour : hdr_pin_colour(type);
sizeY = 5.75;
pitch = hdr_pitch(type);
module jst_xh_socket(type, pin_count) {
socketSizeZ = hdr_socket_depth(type);
pinOffsetX = 2.45;
sizeY = 5.75;
wallThickness = 0.8;
size = [pinOffsetX * 2 + (pin_count - 1) * pitch, sizeY, socketSizeZ];
translate([-size[0] / 2, -size[1] / 2, 0]) {
// the base
cube([size[0], size[1], wallThickness]);
// the three full sides
translate([0, size[1] - wallThickness, 0])
cube([size[0], wallThickness, size[2]]);
cube([wallThickness, size[1], size[2]]);
translate([size[0] - wallThickness, 0, 0])
cube([wallThickness, size[1], size[2]]);
// the sides with cutouts
cube([size[0], wallThickness, 2]);
cutoutWidth = 1;
cutoutOffset = pinOffsetX - cutoutWidth / 2;
cube([cutoutOffset, wallThickness, size[2]]);
translate([size[0] - cutoutOffset, 0, 0])
cube([cutoutOffset, wallThickness, size[2]]);
cube([cutoutOffset, wallThickness, size[2]]);
translate([size[0]-cutoutOffset, 0, 0])
cube([cutoutOffset, wallThickness, size[2]]);
translate([cutoutOffset + cutoutWidth, 0, 0])
cube([size[0] - 2 * (cutoutWidth + cutoutOffset), wallThickness, size[2]]);
}
} // end module
color(colour)
if(right_angle)
translate([0, -1, sizeY / 2])
rotate([-90, 0, 180])
jst_xh_socket(type, pin_count);
else
jst_xh_socket(type, pin_count);
color(pin_colour)
for(x = [0 : pin_count - 1]) {
pinWidth = hdr_pin_width(type);
verticalPinLength = right_angle ? hdr_pin_below(type) + sizeY / 2 : hdr_pin_length(type);
translate([pitch * (x - (pin_count - 1) / 2), 0, 0]) {
pin(type, verticalPinLength);
if(right_angle) {
translate([0, -pinWidth / 2, sizeY / 2 - pinWidth / 2])
rotate([0, -90, 0])
rotate_extrude(angle = 90, $fn = 32)
translate([0, -pinWidth / 2])
square(pinWidth);
translate([0, -sizeY / 2 - 3 * pinWidth / 4, sizeY / 2])
rotate([90,0,0])
pin(type, hdr_pin_length(type) - hdr_pin_below(type));
}
}
}
}

View File

@ -25,6 +25,7 @@
// c
//
2p54header = ["2p54header", 2.54, 11.6, 3.2, 0.66, "gold", grey20, 8.5];
jst_xh_header = ["JST XH header",2.5,10,3.4, 0.64, "gold", grey90, 7];
pin_headers = [ 2p54header ];