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.
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.
| 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 |
| 2 | standoffs. 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 |
| 3 | cathode side. The board's top face is the XY plane. Dimensions from Vishay's data sheets, listed in the README.""" |
| 4 | import math |
| 5 | |
| 6 | from steve import Model |
| 7 | |
| 8 | package = "5mm" # Package |
| 9 | color = "red" # Lens colour (tinted diffused) |
| 10 | tail = 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. |
| 20 | PACKAGES = { |
| 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. |
| 26 | COLORS = {"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. |
| 29 | FLAT = 0.88 |
| 30 | |
| 31 | if package not in PACKAGES: |
| 32 | raise ValueError(f"no package {package!r}: {', '.join(PACKAGES)}") |
| 33 | if color not in COLORS: |
| 34 | raise ValueError(f"no colour {color!r}: {', '.join(COLORS)}") |
| 35 | Db, Df, tf, H, Rd, stand, pitch, lx, ly = PACKAGES[package] |
| 36 | Rb, Rf = Db / 2, Df / 2 |
| 37 | z0 = stand |
| 38 | top = z0 + H |
| 39 | |
| 40 | model = Model() |
| 41 | # Body: the flange, the cylinder and the dome (a sphere of radius R meeting the cylinder), revolved about the axis. |
| 42 | dome = [(Rd * math.cos(math.radians(a)), top - Rd + Rd * math.sin(math.radians(a))) for a in range(0, 90, 10)] |
| 43 | section = [(0, z0), (Rf, z0), (Rf, z0 + tf), (Rb, z0 + tf), (Rb, top - Rd)] + ([(Rd, top - Rd)] if Rd < Rb else []) + dome[1:] + [(0, top)] |
| 44 | with model.sketch("body_sketch", on="XZ", name="Body") as sk: |
| 45 | sk.polyline("body_section", section, closed=True) |
| 46 | model.revolve("body", "body_sketch", axis="Z", op="new", body="body_body", name="Body") |
| 47 | if 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. |
| 53 | leads = [] |
| 54 | for 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. |
| 62 | model.material("pmma", bodies=["body_body"], color=COLORS[color]) |
| 63 | model.material("copper", bodies=leads, color="#c9ccd1") |
| 64 | result = model.result() |
| 65 |
| 1 | name = "steve/tht-led" |
| 2 | version = "1.0.0" |
| 3 | runtime = "steve" |
| 4 | license = "MIT" |
| 5 | summary = "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." |
| 6 | description = """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.""" |
| 7 | tags = ["led", "through-hole", "t-1", "t-1-3-4", "vishay", "electronics"] |
| 8 | |
| 9 | [parameters.package] |
| 10 | type = "choice" |
| 11 | default = "5mm" |
| 12 | choices = ["5mm", "3mm"] |
| 13 | label = "Package" |
| 14 | |
| 15 | [parameters.color] |
| 16 | type = "choice" |
| 17 | default = "red" |
| 18 | choices = ["red", "yellow", "green"] |
| 19 | label = "Lens colour" |
| 20 | |
| 21 | [parameters.tail] |
| 22 | type = "number" |
| 23 | default = 3.0 |
| 24 | min = 0.5 |
| 25 | max = 30 |
| 26 | unit = "mm" |
| 27 | label = "Leads below the board" |
| 28 | |
| 29 | [[presets]] |
| 30 | id = "5mm-red" |
| 31 | title = "Vishay TLHR5400, 5 mm (T-1 3/4) round LED, red, tinted diffused" |
| 32 | params = { package = "5mm", color = "red" } |
| 33 | aliases = ["Vishay TLHR5400", "TLHR5400", "5 mm (T-1 3/4) red LED", "5mm red LED", "5 mm (T-1 3/4) LED", "LED_D5.0mm"] |
| 34 | standard = "Vishay TLHR54" |
| 35 | |
| 36 | [[presets]] |
| 37 | id = "5mm-yellow" |
| 38 | title = "Vishay TLHY5400, 5 mm (T-1 3/4) round LED, yellow, tinted diffused" |
| 39 | params = { package = "5mm", color = "yellow" } |
| 40 | aliases = ["Vishay TLHY5400", "TLHY5400", "5 mm (T-1 3/4) yellow LED", "5mm yellow LED", "5 mm (T-1 3/4) LED", "LED_D5.0mm_Yellow"] |
| 41 | standard = "Vishay TLHY54" |
| 42 | |
| 43 | [[presets]] |
| 44 | id = "5mm-green" |
| 45 | title = "Vishay TLHG5400, 5 mm (T-1 3/4) round LED, green, tinted diffused" |
| 46 | params = { package = "5mm", color = "green" } |
| 47 | aliases = ["Vishay TLHG5400", "TLHG5400", "5 mm (T-1 3/4) green LED", "5mm green LED", "5 mm (T-1 3/4) LED", "LED_D5.0mm_Green"] |
| 48 | standard = "Vishay TLHG54" |
| 49 | |
| 50 | [[presets]] |
| 51 | id = "3mm-red" |
| 52 | title = "Vishay TLHR4400, 3 mm (T-1) round LED, red, tinted diffused" |
| 53 | params = { package = "3mm", color = "red" } |
| 54 | aliases = ["Vishay TLHR4400", "TLHR4400", "3 mm (T-1) red LED", "3mm red LED", "3 mm (T-1) LED", "LED_D3.0mm"] |
| 55 | standard = "Vishay TLHR44" |
| 56 | |
| 57 | [[presets]] |
| 58 | id = "3mm-yellow" |
| 59 | title = "Vishay TLHY4400, 3 mm (T-1) round LED, yellow, tinted diffused" |
| 60 | params = { package = "3mm", color = "yellow" } |
| 61 | aliases = ["Vishay TLHY4400", "TLHY4400", "3 mm (T-1) yellow LED", "3mm yellow LED", "3 mm (T-1) LED", "LED_D3.0mm_Yellow"] |
| 62 | standard = "Vishay TLHY44" |
| 63 | |
| 64 | [[presets]] |
| 65 | id = "3mm-green" |
| 66 | title = "Vishay TLHG4400, 3 mm (T-1) round LED, green, tinted diffused" |
| 67 | params = { package = "3mm", color = "green" } |
| 68 | aliases = ["Vishay TLHG4400", "TLHG4400", "3 mm (T-1) green LED", "3mm green LED", "3 mm (T-1) LED", "LED_D3.0mm_Green"] |
| 69 | standard = "Vishay TLHG44" |
| 70 |
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.
Vishay's data sheets, from Vishay's own site:
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.
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. Measured on the reference models (2026-11-06):
LED_D5.0mm, LED_D5.0mm_Green and LED_D5.0mm_Yellow are the same model: body Ø 4.9, flange Ø 5.8 with a flat on the cathode side, 8.6 from the flange's underside to the top, 1.0 flange; leads 0.4 square, 2.54 apart. Against Vishay's 5 mm: 5 ±0.15, 5.8, 8.7 and 1.0, so they map to TLHR5400, TLHG5400 and TLHY5400. The leads differ (0.4 against 0.5), as post sizes differ between makers of the same part, and the old model's flange sits 3.0 above the board where Vishay's kink seats it 3.8 above.LED_D3.0mm and its colour variants: flange Ø 3.8 and the body about 5.3 high above the flange's underside. Vishay's 3 mm is Ø 3.2 and 4.4, and Kingbright's WP710A10 (Spec No. DSAL0505, V.12A, 08/11/2023, kingbrightusa.com) Ø 3.2 and 4.6, so they aren't mapped. The 3 mm package is offered all the same.| 1 | # Through-hole LED |
| 2 | |
| 3 | 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. |
| 4 | |
| 5 | `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. |
| 6 | |
| 7 | | Package | Parts | Body Ø | Flange Ø | Flange | Top above the flange's underside | Dome | Kink below the flange | Leads | |
| 8 | |---|---|---|---|---|---|---|---|---| |
| 9 | | 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. | |
| 10 | | 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. | |
| 11 | |
| 12 | 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. |
| 13 | |
| 14 | ## Source |
| 15 | |
| 16 | Vishay's data sheets, from Vishay's own site: |
| 17 | |
| 18 | - "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. |
| 19 | - "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. |
| 20 | |
| 21 | **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. |
| 22 | |
| 23 | 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. |
| 24 | |
| 25 | ## Catalogue models |
| 26 | |
| 27 | 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. Measured on the reference models (2026-11-06): |
| 28 | |
| 29 | - `LED_D5.0mm`, `LED_D5.0mm_Green` and `LED_D5.0mm_Yellow` are the same model: body Ø 4.9, flange Ø 5.8 with a flat on the cathode side, 8.6 from the flange's underside to the top, 1.0 flange; leads 0.4 square, 2.54 apart. Against Vishay's 5 mm: 5 ±0.15, 5.8, 8.7 and 1.0, so they map to TLHR5400, TLHG5400 and TLHY5400. The leads differ (0.4 against 0.5), as post sizes differ between makers of the same part, and the old model's flange sits 3.0 above the board where Vishay's kink seats it 3.8 above. |
| 30 | - `LED_D3.0mm` and its colour variants: flange Ø 3.8 and the body about 5.3 high above the flange's underside. Vishay's 3 mm is Ø 3.2 and 4.4, and Kingbright's WP710A10 (Spec No. DSAL0505, V.12A, 08/11/2023, kingbrightusa.com) Ø 3.2 and 4.6, so they aren't mapped. The 3 mm package is offered all the same. |
| 31 | - 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 5 mm models (Vishay's sheet has red, yellow and green tinted lenses only), the infrared emitters (another part), and the other sizes and shapes. |
| 32 |
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.
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.
Vishay's data sheets, from Vishay's own site:
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.
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. Measured on the reference models (2026-11-06):
LED_D5.0mm, LED_D5.0mm_Green and LED_D5.0mm_Yellow are the same model: body Ø 4.9, flange Ø 5.8 with a flat on the cathode side, 8.6 from the flange's underside to the top, 1.0 flange; leads 0.4 square, 2.54 apart. Against Vishay's 5 mm: 5 ±0.15, 5.8, 8.7 and 1.0, so they map to TLHR5400, TLHG5400 and TLHY5400. The leads differ (0.4 against 0.5), as post sizes differ between makers of the same part, and the old model's flange sits 3.0 above the board where Vishay's kink seats it 3.8 above.LED_D3.0mm and its colour variants: flange Ø 3.8 and the body about 5.3 high above the flange's underside. Vishay's 3 mm is Ø 3.2 and 4.4, and Kingbright's WP710A10 (Spec No. DSAL0505, V.12A, 08/11/2023, kingbrightusa.com) Ø 3.2 and 4.6, so they aren't mapped. The 3 mm package is offered all the same.Axial leaded metal film resistor, Vishay Beyschlag MBA/SMA 0204, MBB/SMA 0207 and MBE/SMA 0414, with colour rings, horizontal or vertical.
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.
Axial leaded diodes in Vishay's DO-35, DO-41, DO-15, DO-201AD and P600 packages, with the cathode band, horizontal or vertical.
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.