Sign in with STEVE

steve/tht-led

Through-hole round LEDs from Vishay's drawings: 5 mm (T-1 3/4, TLHx5400) and 3 mm (T-1, TLHx4400), red, yellow or green.

v1.0.1 Latest STEVE MIT 0
Isometric
part.py 65 lines · Python · STEVE runtime · checked
Download
1"""Through-hole round LED with two straight leads, Vishay's 5 mm (T-1 3/4) and 3 mm (T-1) packages, standing on the board at its lead
2standoffs. The body's axis is the Z axis, the cathode lead at -X and the anode at +X (2.54 nom. apart); the 5 mm flange's flat is on the
3cathode side. The board's top face is the XY plane. Dimensions from Vishay's data sheets, listed in the README."""
4import math
5
6from steve import Model
7
8package = "5mm" # Package
9color = "red" # Lens colour (tinted diffused)
10tail = 3.0 # mm Leads below the board
11
12# Each entry: (body diameter, flange diameter, flange thickness, height from the flange's underside to the top, dome radius,
13# standoff below the flange's underside (the leads' kink, where the part seats: 12.5 - 8.7 and 5.8 - 4.4), lead spacing, lead size along X, lead size along Y), mm.
14# Vishay "TLHR540., TLHY540., TLHG540." Rev. 2.6, 09-Sep-2022, document 83012 (www.vishay.com/docs/83012/tlhg540.pdf), page 7,
15# "Package dimensions": body Ø 5 +/-0.15, flange Ø 5.8 +/-0.15, 8.7 +/-0.3 and 7.7 +/-0.15 from the top to the flange's underside and
16# top face, R 2.49 (sphere), 12.5 +/-0.3 from the top to the leads' kink, leads 0.5 +0.15/-0.05 square, 2.54 nom. apart.
17# Vishay "TLHR440., TLHO440., TLHY440., TLHG440." Rev. 3.8, 21-Mar-2023, document 83006 (www.vishay.com/doc?83006), page 9, "Package
18# dimensions": body Ø 2.9 +/-0.15, flange Ø 3.2 +/-0.15, 4.4 +/-0.3 and 3.4 +/-0.15, R 1.4 (sphere), 5.8 +/-0.3 to the kink, leads
19# 0.5 x 0.4, 2.54 nom. apart.
20PACKAGES = {
21 "5mm": (5.0, 5.8, 1.0, 8.7, 2.49, 3.8, 2.54, 0.5, 0.5),
22 "3mm": (2.9, 3.2, 1.0, 4.4, 1.4, 1.4, 2.54, 0.5, 0.4),
23}
24# Part numbers by package and colour (the sheets' tables), for the README: 5mm TLHR5400, TLHY5400, TLHG5400; 3mm TLHR4400, TLHY4400,
25# TLHG4400.
26COLORS = {"red": "#c8202a", "yellow": "#e8c21c", "green": "#3fa34d"}
27# Proportion, for looks (the 5 mm top view draws the flange's flat but doesn't dimension it): the flat is 0.88 x the flange's radius from
28# its centre. The 3 mm top view draws no flat.
29FLAT = 0.88
30
31if package not in PACKAGES:
32 raise ValueError(f"no package {package!r}: {', '.join(PACKAGES)}")
33if color not in COLORS:
34 raise ValueError(f"no colour {color!r}: {', '.join(COLORS)}")
35Db, Df, tf, H, Rd, stand, pitch, lx, ly = PACKAGES[package]
36Rb, Rf = Db / 2, Df / 2
37z0 = stand
38top = z0 + H
39
40model = Model()
41# Body: the flange, the cylinder and the dome (a sphere of radius R meeting the cylinder), revolved about the axis.
42dome = [(Rd * math.cos(math.radians(a)), top - Rd + Rd * math.sin(math.radians(a))) for a in range(0, 90, 10)]
43section = [(0, z0), (Rf, z0), (Rf, z0 + tf), (Rb, z0 + tf), (Rb, top - Rd)] + ([(Rd, top - Rd)] if Rd < Rb else []) + dome[1:] + [(0, top)]
44with model.sketch("body_sketch", on="XZ", name="Body") as sk:
45 sk.polyline("body_section", section, closed=True)
46model.revolve("body", "body_sketch", axis="Z", op="new", body="body_body", name="Body")
47if package == "5mm":
48 # The flange's flat on the cathode (-X) side.
49 with model.sketch("flat_sketch", on="XY", name="Flange flat") as sk:
50 sk.rect("flat_rect", (-Rf - 1, -Rf - 1), (-FLAT * Rf, Rf + 1))
51 model.extrude("flat", "flat_sketch", distance=z0 + tf, op="cut", body="body_body", name="Flange flat")
52# Leads: straight, from the tail below the board up to the flange's underside.
53leads = []
54for name, sx in (("cathode", -1), ("anode", 1)):
55 model.plane(f"{name}_plane", on="XY", offset=-tail, name=f"{name.title()} lead")
56 with model.sketch(f"{name}_sketch", on=f"{name}_plane", name=f"{name.title()} lead") as sk:
57 sk.rect(f"{name}_rect", (sx * pitch / 2 - lx / 2, -ly / 2), (sx * pitch / 2 + lx / 2, ly / 2))
58 model.extrude(f"{name}_lead", f"{name}_sketch", distance=tail + z0, op="new", body=f"{name}_body", name=f"{name.title()} lead")
59 leads.append(f"{name}_body")
60# Materials, for looks and a rough mass: the body is tinted epoxy resin (density about 1.2), shown as pmma (1.18), the nearest clear
61# plastic in the material list, in the lens colour; the leads are tin-plated steel or copper alloy (the sheets don't say), shown as copper.
62model.material("pmma", bodies=["body_body"], color=COLORS[color])
63model.material("copper", bodies=leads, color="#c9ccd1")
64result = model.result()
65

Through-hole round LED with two straight leads, standing on the board at its lead standoffs, from Vishay's package drawings: the 5 mm (T-1 3/4) TLHR5400, TLHY5400 and TLHG5400, with the flange's flat on the cathode side, and the 3 mm (T-1) TLHR4400, TLHY4400 and TLHG4400. Tinted diffused lens in red, yellow or green. Cathode lead at -X, the body's axis on Z. See the README.

Through-hole LED

A round through-hole LED with two straight leads: the moulded body (flange, cylinder and spherical dome) standing on the board at the leads' standoff kinks. The body's axis is the Z axis and the board's top face the XY plane. The cathode lead is at -X and the anode at +X, 2.54 nom. apart. The 5 mm flange has its flat on the cathode side.

package is Vishay's 5 mm (T-1 3/4) or 3 mm (T-1) package, color the tinted diffused lens's colour, and tail how far the leads run below the board.

Package Parts Body Ø Flange Ø Flange Top above the flange's underside Dome Kink below the flange Leads
5mm TLHR5400, TLHY5400, TLHG5400 5 ±0.15 5.8 ±0.15 1.0 (8.7 - 7.7) 8.7 ±0.3 R 2.49 sphere 3.8 (12.5 - 8.7) 0.5 square, 2.54 nom.
3mm TLHR4400, TLHY4400, TLHG4400 2.9 ±0.15 3.2 ±0.15 1.0 (4.4 - 3.4) 4.4 ±0.3 R 1.4 sphere 1.4 (5.8 - 4.4) 0.5 x 0.4, 2.54 nom.

The values in brackets follow from the drawings' dimensions, which run from the top: to the flange's underside, to its top face and to the leads' kink.

Source

Vishay's data sheets, from Vishay's own site:

  • "TLHR540., TLHY540., TLHG540.", High Efficiency LED, Ø 5 mm Tinted Diffused Package, Rev. 2.6, 09-Sep-2022, document 83012, https://www.vishay.com/docs/83012/tlhg540.pdf. Page 7, "Package dimensions in millimeters": Ø 5 ±0.15, Ø 5.8 ±0.15, 8.7 ±0.3, 7.7 ±0.15, R 2.49 (sphere), 12.5 ±0.3 to the kink, leads 0.5 +0.15/-0.05, 2.54 nom., 35.5 ±0.55 overall; anode A and cathode C in the top view, the flange's flat at C.
  • "TLHR440., TLHO440., TLHY440., TLHG440.", High Efficiency LED, Ø 3 mm Tinted Diffused Package, Rev. 3.8, 21-Mar-2023, document 83006, https://www.vishay.com/doc?83006. Page 9, "Package dimensions in millimeters": Ø 2.9 ±0.15, Ø 3.2 ±0.15, 4.4 ±0.3, 3.4 ±0.15, R 1.4 (sphere), 5.8 ±0.3 to the kink, leads 0.5 +0.2/-0.1 x 0.4 +0.15/-0.05, 2.54 nom.

Proportions, for looks only. The 5 mm top view draws the flange's flat but doesn't dimension it: here the flat is 0.88 x the flange's radius from its centre. The leads are straight from the tail up to the flange's underside; the kink, the seating point, isn't drawn as a shape, and the resin that runs below the flange (< 0.7, < 0.6) isn't modelled.

Materials are for looks and a rough mass. The body is tinted epoxy resin (density about 1.2), shown as pmma (1.18), the nearest clear plastic in the material list, in the lens colour. The sheets don't name the lead material, and the leads are shown as copper. The sheets give no weight, so there is no mass check.

Catalogue models

The old catalogue's LED names are generic: a diameter and no maker. As for generic pin headers, a model maps to a maker's package when its body, the flange and the cylinder, is within 0.15 mm of the maker's drawing. Where the old model is plainly wrong for its size, it maps to the real part. Measured on the reference models (2026-11-06), against Vishay's drawings:

Models Body Ø Flange Ø Flange's underside to top Flange Leads Flange above the board
LED_D5.0mm, _Green, _Yellow (one model) old 4.9 5.8, flat on the cathode side 8.6 1.0 0.4 square 3.0
Vishay 5 mm 5 ±0.15 5.8 ±0.15 8.7 ±0.3 1.0 0.5 square 3.8 (at the kink)
LED_D3.0mm, _Green, _Yellow (one model) old 3.0 3.8, flat on the cathode side 5.3 1.0 0.4 square 3.0
Vishay 3 mm 2.9 ±0.15 3.2 ±0.15 4.4 ±0.3 1.0 0.5 x 0.4 1.4 (at the kink)
  • The 5 mm models map to TLHR5400, TLHG5400 and TLHY5400: the body is within 0.15. The leads differ, as post sizes differ between makers of the same part, and so does the seating height.
  • The 3 mm models map to TLHR4400, TLHG4400 and TLHY4400 although their flange and height differ by more: Vishay's 3 mm (Ø 3.2, 4.4) and Kingbright's WP710A10 (Spec No. DSAL0505, V.12A, 08/11/2023, kingbrightusa.com: Ø 3.2, 4.6) agree, so the old model, at Ø 3.8 and 5.3, is plainly wrong for a 3 mm LED rather than a different part.
  • Not mapped, as no table read yet: horizontal models (leads bent at a height the drawings don't give), the blue, clear and flat-top models (Vishay's sheets have red, yellow and green tinted lenses only), the infrared emitters (another part), and the other sizes and shapes.
  1. 1.0.1 Latest Compare with 1.0.0
  2. 1.0.0
More #led
STEVEMIT

steve/axial-resistor

Axial leaded metal film resistor, Vishay Beyschlag MBA/SMA 0204, MBB/SMA 0207 and MBE/SMA 0414, with colour rings, horizontal or vertical.

1 9 sizes 0 4 hours ago v1.0.0
STEVEMIT

steve/leaded-inductor

Axial leaded inductor, Fastron fixed choke coils (MICC, SMCC, MECC, HCCC, LACC, HBCC, VHBCC, XHBCC) and suppression coils (MISC, MESC, 77A), Vishay Dale molded IM-1 to IM-10, horizontal or vertical.

0 63 sizes 0 4 hours ago v1.1.0
STEVEMIT

steve/axial-diode

Axial leaded diodes in Vishay's DO-35, DO-41, DO-15, DO-201AD and P600 packages, with the cathode band, horizontal or vertical.

0 30 sizes 0 2 hours ago v1.0.0
STEVEMIT

steve/bridge-rectifier

Single-phase bridge rectifiers in Vishay's through-hole cases: GBL, GBU, KBL and KBU in-line, KBPC1 and KBPC6 square, from Vishay's data sheets.

0 7 sizes 0 2 hours ago v1.0.0