Sign in with STEVE

steve/pin-header

Through-hole pin header, 2.54 mm and 2.00 mm pitch, one or two rows, 1 to 40 pins per row, straight or right-angle.

v1.1.0 Latest STEVE MIT 0
Isometric
part.py 76 lines · Python · STEVE runtime · checked
Download
1"""Through-hole pin header, 2.54 mm and 2.00 mm pitch, one or two rows, straight or right-angle (2.54 mm only). Pin 1 is at the origin, the row along +X.
2Straight: the second row along +Y, the insulator's underside on the XY plane, the mating posts up. Right-angle: the second row's tails along -Y, the
3insulator standing on the XY plane, the mating posts along +Y. The tails go down through the board. Dimensions in the README."""
4from steve import Model
5
6pitch = 2.54 # mm Pitch
7rows = 1 # Rows
8pins = 8 # Pins per row
9style = "straight" # straight or right-angle
10detail = "full" # full: square posts and notched insulator; simple: one block per row, with no posts
11
12# pitch: (above the insulator C, insulator height, tail B, one-row width, two-row width, post square).
13# 2.54: Samtec TSW lead style -07, catalogue page TSW/HTSW (F-226), A 10.92, B 2.54, C 5.84, widths 2.48 and 5.02, post .025 in.
14# 2.00: Samtec TMM lead style -02, catalogue page TMM (F-226), A 8.20, B 3.70, C 3.00, body 1.50, widths 1.97 and 3.94. The page doesn't
15# print the post size, so 0.50 here is a proportion of the pitch, for looks.
16SIZES = {2.54: (5.84, 2.54, 2.54, 2.48, 5.02, 0.64), 2.0: (3.00, 1.50, 3.70, 1.97, 3.94, 0.50)}
17
18# Right-angle, 2.54: Samtec TSW lead style -08-RA, same page: post out from the insulator C 5.84, tail below the insulator E 2.29, tail to the insulator D 1.52,
19# insulator height 3.02 (one row) and 5.56 (two rows). The insulator's depth is taken as the straight header's 2.54 high.
20RIGHT_ANGLE = (5.84, 2.29, 1.52, 3.02, 5.56)
21
22
23above, body_h, tail, one, two, post = SIZES[pitch]
24width = one if rows == 1 else two
25length = pitch * pins
26y0 = (rows - 1) * pitch / 2 - width / 2
27x0 = -pitch / 2
28notch = 0.12 * pitch # the V between pins, for looks
29outline = [(x0, y0)]
30for i in range(1, pins):
31 outline += [(x0 + i * pitch - notch, y0), (x0 + i * pitch, y0 + notch), (x0 + i * pitch + notch, y0)]
32outline += [(x0 + length, y0), (x0 + length, y0 + width)]
33for i in range(pins - 1, 0, -1):
34 outline += [(x0 + i * pitch + notch, y0 + width), (x0 + i * pitch, y0 + width - notch), (x0 + i * pitch - notch, y0 + width)]
35outline += [(x0, y0 + width)]
36
37model = Model()
38if style == "right-angle":
39 out, drop, back, high_one, high_two = RIGHT_ANGLE
40 high = high_one if rows == 1 else high_two
41 with model.sketch("body_sketch", on="XY", name="Insulator") as sk:
42 sk.rect("body_outline", (x0, back), (x0 + length, back + body_h))
43 model.extrude("body", "body_sketch", distance=high, name="Insulator")
44 if detail == "full":
45 rise = (high - (rows - 1) * pitch) / 2
46 for row in range(rows):
47 z = rise + row * pitch
48 y_tail = -row * pitch
49 model.plane(f"run_plane_{row}", on="XZ", offset=-y_tail + post / 2, name="Posts")
50 with model.sketch(f"post_sketch_{row}", on=f"run_plane_{row}", name="Posts") as sk:
51 for i in range(pins):
52 sk.rect(f"post_{row}_{i}", (i * pitch - post / 2, z - post / 2), (i * pitch + post / 2, z + post / 2))
53 model.extrude(f"posts_{row}", f"post_sketch_{row}", distance=-(back + body_h + out - y_tail + post / 2), name="Posts")
54 model.plane(f"tail_plane_{row}", on="XY", offset=-drop, name="Tails")
55 with model.sketch(f"tail_sketch_{row}", on=f"tail_plane_{row}", name="Tails") as sk:
56 for i in range(pins):
57 sk.rect(f"tail_{row}_{i}", (i * pitch - post / 2, y_tail - post / 2), (i * pitch + post / 2, y_tail + post / 2))
58 model.extrude(f"tails_{row}", f"tail_sketch_{row}", distance=drop + z + post / 2, name="Tails")
59else:
60 with model.sketch("body_sketch", on="XY", name="Insulator") as sk:
61 if detail == "full":
62 sk.polyline("body_outline", outline, closed=True)
63 else:
64 sk.rect("body_outline", (x0, y0), (x0 + length, y0 + width))
65 model.extrude("body", "body_sketch", distance=body_h if detail == "full" else body_h + above, name="Insulator")
66 if detail == "full":
67 model.plane("tail_plane", on="XY", offset=-tail, name="Tail end")
68 with model.sketch("posts_sketch", on="tail_plane", name="Posts") as sk:
69 for row in range(rows):
70 for i in range(pins):
71 x, y = i * pitch, row * pitch
72 sk.rect(f"post_{row}_{i}", (x - post / 2, y - post / 2), (x + post / 2, y + post / 2))
73 model.extrude("posts", "posts_sketch", distance=tail + body_h + above, name="Posts")
74model.material("steel-generic", color="#2b2b2d")
75result = model.result()
76

Through-hole pin header, straight or right-angle, with square posts and a notched insulator. Pin 1 at the origin, row along +X. Heights and widths from Samtec's TSW and TMM pages. See the README.

Pin header

A through-hole pin header, straight or right-angle. Right-angle: the tails and second row go along -Y, the posts along +Y, and the insulator stands on the XY plane.

Straight: Pin 1 is at the origin, the row runs along +X and the second row along +Y. The insulator's underside is on the XY plane, the mating posts point up and the tails go down through the board.

Source

  • 2.54 mm: Samtec TSW/HTSW catalogue page (F-226), https://suddendocs.samtec.com/catalog_english/tsw_th.pdf, lead style -07: post above the insulator C 5.84, tail B 2.54, overall A 10.92, so the insulator is 2.54 high. Width 2.48 (one row), 5.02 (two rows). Post .025 in square, 0.64 mm.
  • 2.54 mm right-angle: the same TSW/HTSW catalogue page, lead style -08-RA: post out from the insulator C 5.84, tail below the insulator E 2.29, tail to the insulator D 1.52, insulator height 3.02 (one row) and 5.56 (two rows).
  • 2.00 mm: Samtec TMM catalogue page (F-226), https://suddendocs.samtec.com/catalog_english/tmm_th.pdf, lead style -02: C 3.00, B 3.70, A 8.20, insulator 1.50. Width 1.97 and 3.94.

Other headers of the same pitch differ in post and tail length, so check the one you buy.

Proportions, for looks only: the V notches between pins, the 2.00 mm post size of 0.50 mm, which that page doesn't print, and the right-angle insulator's depth, taken as the straight header's 2.54.

2.00 mm right-angle, surface-mount, 1.27 mm and 1.00 mm headers aren't here yet; see COVERAGE.md.

  1. 1.1.0 Latest Compare with 1.0.0

    Right-angle 2.54 mm headers.

  2. 1.0.0
More #pin-header
STEVEMIT

steve/pin-socket

Straight through-hole pin socket, 2.54 mm pitch, one or two rows, 1 to 40 pins per row.

0 81 sizes 0 7 minutes ago v1.0.0
STEVEMIT

steve/macropad-keyplate

Adafruit MacroPad RP2040 key plate (product 5128): 3 x 4 switch cut-outs, measured from Adafruit's published model.

0 1 size 0 4 days ago v1.0.0
STEVEMIT

steve/round-spacer

Round unthreaded clearance spacer for M3 screws (Harwin R30-601): Ø4.76 × Ø3.30, any length.

0 9 sizes 0 4 days ago v1.0.0
STEVEMIT

steve/pcb-card-guide

PCB card guide and board retaining clip, boards 1 to 2.4 mm, any length: simplified, measured from step.parts' models.

0 50 sizes 0 4 days ago v1.0.0