steve/dip-switch-tht
Through-hole side-actuated (piano) DIP switches, CTS Series 194/195, 2 to 10 and 12 positions, from CTS's data sheet.
Through-hole 10-position rotary coded DIP switch from Nidec's SH-7000 catalogue: SH-7010C (real code) and SH-7030C (complementary code).
| 1 | """Through-hole rotary coded DIP switch, Nidec SH-7000 series, SH-7010C (real code) and SH-7030C (complementary code), 10 positions, top |
| 2 | setting. The body is centred on the origin, its underside on the board's top face (the XY plane); the six pins are in two rows along X, |
| 3 | 2.54 apart, the rows across Y. Dimensions from Nidec's SH-7000 catalogue, in the README.""" |
| 4 | import math |
| 5 | |
| 6 | from steve import Model |
| 7 | |
| 8 | kind = "SH-7010C" # Type |
| 9 | position = 0 # Rotor setting, 0 to 9 (the arrow points at it) |
| 10 | |
| 11 | # Nidec Components "Rotary Coded Switches (SMD) SH-7000" catalogue (PDF of 2025-02-05, nidec-components.com/e/catalog/switch/ |
| 12 | # sh-7000.pdf), page 4, Outline Dimensions, SH-7010C (Real code) / SH-7030C (Complementary code), tolerance ±0.3 unless stated: |
| 13 | # body 7.3 along the rows and 7.1 across them, 3.7 high; rotor slot 0.7 W x 2.8 L x 1 D; pins 6 - 0.6 wide, t = 0.15, 2.54 apart, |
| 14 | # 7.62 ±0.5 between the two rows, 3.5 ±1 below the board. Page 5, P.C.B. dimensions (bottom view): 6 - 1 holes on a 2.54 ±0.1 grid, |
| 15 | # the rows three steps (7.62) apart. |
| 16 | TYPES = {"SH-7010C": "real code", "SH-7030C": "complementary code"} |
| 17 | BODY_L = 7.3 |
| 18 | BODY_W = 7.1 |
| 19 | HEIGHT = 3.7 |
| 20 | SLOT = (0.7, 2.8, 1.0) |
| 21 | PIN_W = 0.6 |
| 22 | PIN_T = 0.15 |
| 23 | PITCH = 2.54 |
| 24 | ROWS = 7.62 |
| 25 | TAIL = 3.5 |
| 26 | # Proportions, for looks only (the drawing doesn't dimension them; scaled from the page 4 views, README): the stainless steel cover's |
| 27 | # thickness, the rotor's diameter and depth, the gap round it in the cover, and where the pins leave the housing. |
| 28 | COVER_T = 0.2 |
| 29 | ROTOR_D = 3.3 |
| 30 | ROTOR_H = 1.4 |
| 31 | RIM_GAP = 0.15 # the cover's opening is this much wider than the rotor all round |
| 32 | PIN_TOP = 1.0 |
| 33 | |
| 34 | if kind not in TYPES: |
| 35 | raise ValueError(f"no type {kind!r}: {', '.join(TYPES)}") |
| 36 | if position not in range(10): |
| 37 | raise ValueError("position is 0 to 9") |
| 38 | housing_top = HEIGHT - COVER_T |
| 39 | |
| 40 | model = Model() |
| 41 | # Housing (polyphenylene sulfide), under the cover. |
| 42 | model.box("housing", BODY_L, BODY_W, housing_top, at=(0, 0, housing_top / 2), op="new", body="housing_body", name="Housing") |
| 43 | # Cover (stainless steel), with the rotor's opening. |
| 44 | model.box("cover", BODY_L, BODY_W, COVER_T, at=(0, 0, housing_top + COVER_T / 2), op="new", body="cover_body", name="Cover") |
| 45 | model.cylinder("cover_opening", ROTOR_D / 2 + RIM_GAP, COVER_T + 0.2, at=(0, 0, housing_top - 0.1), op="cut", body="cover_body", name="Rotor opening") |
| 46 | # Rotor (polyphenylene sulfide): ROTOR_H deep, flush with the cover, the setting slot 0.7 x 2.8, 1 deep, turned to the setting (36 degrees |
| 47 | # a step); the housing is cut away round it. |
| 48 | model.cylinder("rotor_seat", ROTOR_D / 2, ROTOR_H, at=(0, 0, HEIGHT - ROTOR_H), op="cut", body="housing_body", name="Rotor seat") |
| 49 | model.cylinder("rotor", ROTOR_D / 2, ROTOR_H, at=(0, 0, HEIGHT - ROTOR_H), op="new", body="rotor_body", name="Rotor") |
| 50 | model.plane("slot_plane", on="XY", offset=HEIGHT - SLOT[2], name="Slot floor") |
| 51 | angle = math.radians(36 * position) |
| 52 | c, s = math.cos(angle), math.sin(angle) |
| 53 | hw, hl = SLOT[0] / 2, SLOT[1] / 2 |
| 54 | with model.sketch("slot_sketch", on="slot_plane", name="Setting slot") as sk: |
| 55 | sk.polyline("slot_outline", [(x * c - y * s, x * s + y * c) for x, y in ((-hl, -hw), (hl, -hw), (hl, hw), (-hl, hw))], closed=True) |
| 56 | model.extrude("slot", "slot_sketch", distance=SLOT[2] + 0.1, op="cut", body="rotor_body", name="Setting slot") |
| 57 | # Pins (copper alloy, gold plated): six strips 0.6 x 0.15, a tab from the housing's side at PIN_TOP, then down outside it to the tip, the |
| 58 | # rows' centres 7.62 apart (on the page 5 hole grid, three 2.54 steps). |
| 59 | pins = [] |
| 60 | y_out = ROWS / 2 |
| 61 | for row, sy in enumerate((-1, 1)): |
| 62 | for col, x in enumerate((-PITCH, 0.0, PITCH)): |
| 63 | n = row * 3 + col + 1 |
| 64 | body = f"pin_{n}_body" |
| 65 | model.box(f"pin_{n}", PIN_W, PIN_T, PIN_TOP + TAIL, at=(x, sy * y_out, (PIN_TOP - TAIL) / 2), op="new", body=body, name=f"Pin {n}") |
| 66 | model.box(f"pin_{n}_tab", PIN_W, y_out - BODY_W / 2 + 0.01, PIN_T, at=(x, sy * (BODY_W / 2 + y_out) / 2, PIN_TOP - PIN_T / 2), |
| 67 | op="join", body=body, name=f"Pin {n} tab") |
| 68 | pins.append(body) |
| 69 | # Materials from page 1 (Internal Structure): housing and rotor polyphenylene sulfide (pet, the closest density on the list), cover |
| 70 | # stainless steel SUS 304 (stainless-304), pins copper alloy, gold plated (copper). |
| 71 | model.material("pet", bodies=["housing_body"], color="#2b2c2f") |
| 72 | model.material("stainless-304", bodies=["cover_body"], color="#c9ccd0") |
| 73 | model.material("pet", bodies=["rotor_body"], color="#f2f1ec") |
| 74 | model.material("copper", bodies=pins, color="#d8b25a") |
| 75 | result = model.result() |
| 76 |
| 1 | name = "steve/rotary-dip-switch-tht" |
| 2 | version = "1.0.0" |
| 3 | runtime = "steve" |
| 4 | license = "MIT" |
| 5 | summary = "Through-hole 10-position rotary coded DIP switch from Nidec's SH-7000 catalogue: SH-7010C (real code) and SH-7030C (complementary code)." |
| 6 | description = """Through-hole rotary coded DIP switch, 10 positions, top setting, Nidec SH-7010C (real code) and SH-7030C (complementary code), from Nidec's SH-7000 catalogue (page 4): body 7.3 x 7.1, 3.7 high, a stainless steel cover and a rotor with a 0.7 x 2.8 setting slot; six pins 0.6 x 0.15, 2.54 apart in two rows 7.62 over, 3.5 below the board. See the README.""" |
| 7 | tags = ["rotary-switch", "dip-switch", "coded-switch", "switch", "through-hole", "nidec", "copal", "electronics"] |
| 8 | |
| 9 | [parameters.kind] |
| 10 | type = "choice" |
| 11 | default = "SH-7010C" |
| 12 | choices = ["SH-7010C", "SH-7030C"] |
| 13 | label = "Type" |
| 14 | description = "SH-7010C: real code (BCD); SH-7030C: complementary code. The two are the same size." |
| 15 | |
| 16 | [parameters.position] |
| 17 | type = "integer" |
| 18 | default = 0 |
| 19 | min = 0 |
| 20 | max = 9 |
| 21 | label = "Setting" |
| 22 | description = "The rotor setting the slot's arrow points at, 0 to 9." |
| 23 | |
| 24 | [[presets]] |
| 25 | id = "sh-7010c" |
| 26 | title = "Nidec SH-7010C, 10-position rotary coded DIP switch, real code, through hole" |
| 27 | params = { kind = "SH-7010C" } |
| 28 | aliases = ["Nidec SH-7010C", "Copal SH-7010C", "SH-7010C"] |
| 29 | standard = "Nidec SH-7000" |
| 30 | |
| 31 | [[presets]] |
| 32 | id = "sh-7030c" |
| 33 | title = "Nidec SH-7030C, 10-position rotary coded DIP switch, complementary code, through hole" |
| 34 | params = { kind = "SH-7030C" } |
| 35 | aliases = ["Nidec SH-7030C", "Copal SH-7030C", "SH-7030C"] |
| 36 | standard = "Nidec SH-7000" |
| 37 |
A 10-position rotary coded DIP switch for through-hole mounting, set from the top: Nidec's SH-7000 series SH-7010C (real code, BCD) and SH-7030C (complementary code). It has a dark housing, a stainless steel cover, a light rotor with a setting slot, and six pins in two rows. The body is centred on the origin, with its underside on the board's top face (the XY plane). The pins lie along X, 2.54 apart, and the two rows are across Y.
kind is the type. The two types are the same size. position is the setting the slot points at, 0 to 9 (36 degrees a step).
Nidec Components, Rotary Coded Switches (SMD) SH-7000, catalogue PDF of 2025-02-05, from Nidec's own site, https://www.nidec-components.com/e/catalog/switch/sh-7000.pdf:
Proportions, for looks only. The drawing doesn't dimension the following. They are scaled from page 4's views:
Materials follow page 1: the housing and rotor polyphenylene sulfide, which isn't on the material list, so pet (the closest density) is used, dark for the housing and light for the rotor. The cover is stainless steel (stainless-304), and the pins copper alloy (copper), gold coloured. Mass check: as modelled, 0.24 g housing + 0.07 g cover + 0.01 g rotor + 0.02 g pins = 0.34 g, against the sheet's approx. 0.38 g.
The old Nidec Copal SH-7010 C model names this part, so it maps to SH-7010C. It was measured on the reference model (2026-11-06) and agrees with the drawing:
| Old model | Nidec drawing | |
|---|---|---|
| Body | 7.3 x 7.1, 3.7 high | 7.3 x 7.1, 3.7 high |
| Pins | 0.6 x 0.16, 2.54 apart, rows 7.62 apart (centres), 3.5 below the board | 0.6 x 0.15, 2.54 apart, rows 7.62 apart, 3.5 below |
The family's other switches (DIP switches, slide switches, tactile switches) are other parts. See COVERAGE.md.
| 1 | # Through-hole rotary coded DIP switch |
| 2 | |
| 3 | A 10-position rotary coded DIP switch for through-hole mounting, set from the top: Nidec's SH-7000 series SH-7010C (real code, BCD) and SH-7030C (complementary code). It has a dark housing, a stainless steel cover, a light rotor with a setting slot, and six pins in two rows. The body is centred on the origin, with its underside on the board's top face (the XY plane). The pins lie along X, 2.54 apart, and the two rows are across Y. |
| 4 | |
| 5 | `kind` is the type. The two types are the same size. `position` is the setting the slot points at, 0 to 9 (36 degrees a step). |
| 6 | |
| 7 | - The body is 7.3 along the rows and 7.1 across them, and 3.7 high. |
| 8 | - The setting slot is 0.7 wide, 2.8 long and 1 deep. |
| 9 | - The pins are 0.6 wide and 0.15 thick, 2.54 apart. The rows are 7.62 apart, and the pins reach 3.5 below the board. |
| 10 | - PCB holes: six, Ø1, on a 2.54 grid. |
| 11 | |
| 12 | ## Source |
| 13 | |
| 14 | Nidec Components, *Rotary Coded Switches (SMD) SH-7000*, catalogue PDF of 2025-02-05, from Nidec's own site, <https://www.nidec-components.com/e/catalog/switch/sh-7000.pdf>: |
| 15 | |
| 16 | - Page 4, Outline Dimensions, SH-7010C (Real code) and SH-7030C (Complementary code), tolerance ±0.3 unless otherwise specified: body 7.3 x 7.1, 3.7 high; slot 0.7 W x 2.8 L x 1 D; pins 6 - 0.6, t = 0.15, 2.54 apart, rows 7.62 ±0.5 apart, 3.5 ±1 below the board. |
| 17 | - Page 5, Terminal Connection / P.C.B. Through Hole Dimensions, top setting (through hole): six 1 mm holes on a 2.54 ±0.1 grid. The two rows are three steps (7.62) apart. |
| 18 | - Page 2, Part Number Designation and Standard Specifications: C is through-hole pins, 10 positions, real or complementary code; net weight approx. 0.38 g. |
| 19 | - Page 1, Internal Structure: marking cover, cover and spacer stainless steel (SUS 304); "O" ring silicone rubber; rotor and housing polyphenylene sulfide; contacts and terminal pins copper alloy, gold plated. |
| 20 | |
| 21 | **Proportions, for looks only.** The drawing doesn't dimension the following. They are scaled from page 4's views: |
| 22 | |
| 23 | - The cover, 0.2 thick. |
| 24 | - The rotor, Ø3.3 and 1.4 deep, flush with the cover, in an opening 0.15 wider all round. |
| 25 | - Where the pins leave the housing: a short tab 1.0 above the board, then straight down outside the housing's side. |
| 26 | |
| 27 | Materials follow page 1: the housing and rotor polyphenylene sulfide, which isn't on the material list, so `pet` (the closest density) is used, dark for the housing and light for the rotor. The cover is stainless steel (`stainless-304`), and the pins copper alloy (`copper`), gold coloured. **Mass check:** as modelled, 0.24 g housing + 0.07 g cover + 0.01 g rotor + 0.02 g pins = 0.34 g, against the sheet's approx. 0.38 g. |
| 28 | |
| 29 | ## Catalogue models |
| 30 | |
| 31 | The old `Nidec Copal SH-7010 C` model names this part, so it maps to SH-7010C. It was measured on the reference model (2026-11-06) and agrees with the drawing: |
| 32 | |
| 33 | | | Old model | Nidec drawing | |
| 34 | |---|---|---| |
| 35 | | Body | 7.3 x 7.1, 3.7 high | 7.3 x 7.1, 3.7 high | |
| 36 | | Pins | 0.6 x 0.16, 2.54 apart, rows 7.62 apart (centres), 3.5 below the board | 0.6 x 0.15, 2.54 apart, rows 7.62 apart, 3.5 below | |
| 37 | |
| 38 | The family's other switches (DIP switches, slide switches, tactile switches) are other parts. See `COVERAGE.md`. |
| 39 |
Through-hole rotary coded DIP switch, 10 positions, top setting, Nidec SH-7010C (real code) and SH-7030C (complementary code), from Nidec's SH-7000 catalogue (page 4): body 7.3 x 7.1, 3.7 high, a stainless steel cover and a rotor with a 0.7 x 2.8 setting slot; six pins 0.6 x 0.15, 2.54 apart in two rows 7.62 over, 3.5 below the board. See the README.
A 10-position rotary coded DIP switch for through-hole mounting, set from the top: Nidec's SH-7000 series SH-7010C (real code, BCD) and SH-7030C (complementary code). It has a dark housing, a stainless steel cover, a light rotor with a setting slot, and six pins in two rows. The body is centred on the origin, with its underside on the board's top face (the XY plane). The pins lie along X, 2.54 apart, and the two rows are across Y.
kind is the type. The two types are the same size. position is the setting the slot points at, 0 to 9 (36 degrees a step).
Nidec Components, Rotary Coded Switches (SMD) SH-7000, catalogue PDF of 2025-02-05, from Nidec's own site, https://www.nidec-components.com/e/catalog/switch/sh-7000.pdf:
Proportions, for looks only. The drawing doesn't dimension the following. They are scaled from page 4's views:
Materials follow page 1: the housing and rotor polyphenylene sulfide, which isn't on the material list, so pet (the closest density) is used, dark for the housing and light for the rotor. The cover is stainless steel (stainless-304), and the pins copper alloy (copper), gold coloured. Mass check: as modelled, 0.24 g housing + 0.07 g cover + 0.01 g rotor + 0.02 g pins = 0.34 g, against the sheet's approx. 0.38 g.
The old Nidec Copal SH-7010 C model names this part, so it maps to SH-7010C. It was measured on the reference model (2026-11-06) and agrees with the drawing:
| Old model | Nidec drawing | |
|---|---|---|
| Body | 7.3 x 7.1, 3.7 high | 7.3 x 7.1, 3.7 high |
| Pins | 0.6 x 0.16, 2.54 apart, rows 7.62 apart (centres), 3.5 below the board | 0.6 x 0.15, 2.54 apart, rows 7.62 apart, 3.5 below |
The family's other switches (DIP switches, slide switches, tactile switches) are other parts. See COVERAGE.md.
Through-hole side-actuated (piano) DIP switches, CTS Series 194/195, 2 to 10 and 12 positions, from CTS's data sheet.
Surface-mount slide DIP switches in the Omron A6S (2.54 mm, 1 to 10 poles) and A6H (1.27 mm, 2 to 10 poles) sizes.
6 x 6 mm through-hole tactile switches from Omron's B3F data sheet: flat plungers 4.3 to 9.5 mm high, projected 7.3 mm, with or without a ground terminal.
Right-angle 6 x 6 mm through-hole tactile switches, C&K PTS645V: round actuators 3.15 to 8.35 mm from the front leads, or the 6.15 mm square actuator.