steve/rotary-dip-switch-tht
Through-hole 10-position rotary coded DIP switch from Nidec's SH-7000 catalogue: SH-7010C (real code) and SH-7030C (complementary code).
Through-hole side-actuated (piano) DIP switches, CTS Series 194/195, 2 to 10 and 12 positions, from CTS's data sheet.
| 1 | """Through-hole DIP switch, CTS Series 194/195 (side-actuated, "piano" keys). Pin 1 is at the origin, the switches' pins 1 to N along +X |
| 2 | in the row nearest the keys, their other pins in the row 7.62 towards +Y; the keys stick out of the body's -Y face. The body stands on the |
| 3 | board (XY plane) and the pins go down through it. Dimensions from CTS's data sheet; see the README.""" |
| 4 | from steve import Model |
| 5 | |
| 6 | series = "194" # CTS series: 194 (gold-plated contacts) or 195 (tin-plated); the same size |
| 7 | positions = 4 # number of switches: 2 to 10, or 12 |
| 8 | |
| 9 | # series: (pitch, rows apart, body depth across the rows, height above the board, pin length below it, pin across X, pin across Y, |
| 10 | # key width, key out of the body's face). |
| 11 | # CTS Series 194/195 Data Sheet, Through Hole DIP Switch, 06/14/17, page 2-2 (Chip and Dip's copy, static.chipdip.ru DOC040834963): |
| 12 | # 2.54 typ., 7.62 +0.38/-0.13, 9.78 +-0.25, 7.90 from the mounting surface, 3.81 +0.25/-0.51, terminals 0.48 +-0.08 and 0.20 +-0.08, |
| 13 | # keys 1.52 wide, 1.14 REF (M, medium height actuator). |
| 14 | SERIES = { |
| 15 | "194": (2.54, 7.62, 9.78, 7.90, 3.81, 0.48, 0.20, 1.52, 1.14), |
| 16 | "195": (2.54, 7.62, 9.78, 7.90, 3.81, 0.48, 0.20, 1.52, 1.14), |
| 17 | } |
| 18 | # Overall length "A" by number of positions, the same page's table (194/195-2MS to -12MS). |
| 19 | LENGTH = {2: 7.26, 3: 9.80, 4: 12.34, 5: 14.88, 6: 17.42, 7: 19.96, 8: 22.50, 9: 25.04, 10: 27.58, 12: 32.66} |
| 20 | # Proportions, for looks (the sheet doesn't dimension them): the keys' height, from the body's top down, as drawn in the front view. |
| 21 | KEY_H = 3.2 |
| 22 | |
| 23 | if positions not in LENGTH: |
| 24 | raise ValueError(f"CTS 194/195 come with {', '.join(map(str, LENGTH))} positions, not {positions}") |
| 25 | pitch, rows, depth, height, tail, pin_x, pin_y, key_w, key_out = SERIES[series] |
| 26 | length = LENGTH[positions] |
| 27 | # The body is centred on the pins both ways. |
| 28 | x_mid = (positions - 1) * pitch / 2 |
| 29 | y_mid = rows / 2 |
| 30 | front = y_mid - depth / 2 |
| 31 | model = Model() |
| 32 | model.box("body", length, depth, height, at=(x_mid, y_mid, height / 2), op="new", body="body_body", name="Body") |
| 33 | keys = [] |
| 34 | for i in range(positions): |
| 35 | x = i * pitch |
| 36 | model.box(f"key_{i + 1}", key_w, key_out, KEY_H, at=(x, front - key_out / 2, height - KEY_H / 2), op="new", body=f"key_{i + 1}_body", |
| 37 | name=f"Key {i + 1}") |
| 38 | keys.append(f"key_{i + 1}_body") |
| 39 | pins = [] |
| 40 | for i in range(positions): |
| 41 | for row, number in ((0.0, i + 1), (rows, 2 * positions - i)): |
| 42 | model.box(f"pin_{number}", pin_x, pin_y, tail, at=(i * pitch, row, -tail / 2), op="new", body=f"pin_{number}_body", |
| 43 | name=f"Pin {number}") |
| 44 | pins.append(f"pin_{number}_body") |
| 45 | # Materials, for looks and a rough mass: the sheet names UL 94V-0 plastics (pa6 here) and tin-plated terminals (copper here). |
| 46 | model.material("pa6", bodies=["body_body", *keys], color="#1d1e20") |
| 47 | model.material("copper", bodies=pins, color="#c9cbc8") |
| 48 | result = model.result() |
| 49 |
| 1 | name = "steve/dip-switch-tht" |
| 2 | version = "1.0.0" |
| 3 | runtime = "steve" |
| 4 | license = "MIT" |
| 5 | summary = "Through-hole side-actuated (piano) DIP switches, CTS Series 194/195, 2 to 10 and 12 positions, from CTS's data sheet." |
| 6 | description = """Through-hole DIP switch with side-actuated piano keys: body, keys and pins at 2.54 x 7.62 mm DIP centres, sized from CTS's Series 194/195 data sheet. See the README.""" |
| 7 | tags = ["switch", "dip-switch", "piano", "through-hole", "cts", "electronics"] |
| 8 | |
| 9 | [parameters.series] |
| 10 | type = "choice" |
| 11 | default = "194" |
| 12 | choices = ["194", "195"] |
| 13 | label = "CTS series" |
| 14 | description = "194: gold-plated contacts; 195: tin-plated. The same size." |
| 15 | |
| 16 | [parameters.positions] |
| 17 | type = "integer" |
| 18 | default = 4 |
| 19 | min = 2 |
| 20 | max = 12 |
| 21 | label = "Positions" |
| 22 | description = "2 to 10, or 12." |
| 23 | |
| 24 | [[presets]] |
| 25 | id = "194-2" |
| 26 | title = "CTS 194-2MS, piano DIP switch, 2 positions" |
| 27 | params = { series = "194", positions = 2 } |
| 28 | aliases = ["CTS 194-2MS", "194-2MS", "194-2MST", "194-2MSN", "194-2MSTN"] |
| 29 | standard = "CTS" |
| 30 | |
| 31 | [[presets]] |
| 32 | id = "194-3" |
| 33 | title = "CTS 194-3MS, piano DIP switch, 3 positions" |
| 34 | params = { series = "194", positions = 3 } |
| 35 | aliases = ["CTS 194-3MS", "194-3MS", "194-3MST", "194-3MSN", "194-3MSTN"] |
| 36 | standard = "CTS" |
| 37 | |
| 38 | [[presets]] |
| 39 | id = "194-4" |
| 40 | title = "CTS 194-4MS, piano DIP switch, 4 positions" |
| 41 | params = { series = "194", positions = 4 } |
| 42 | aliases = ["CTS 194-4MS", "194-4MS", "194-4MST", "194-4MSN", "194-4MSTN"] |
| 43 | standard = "CTS" |
| 44 | |
| 45 | [[presets]] |
| 46 | id = "194-5" |
| 47 | title = "CTS 194-5MS, piano DIP switch, 5 positions" |
| 48 | params = { series = "194", positions = 5 } |
| 49 | aliases = ["CTS 194-5MS", "194-5MS", "194-5MST", "194-5MSN", "194-5MSTN"] |
| 50 | standard = "CTS" |
| 51 | |
| 52 | [[presets]] |
| 53 | id = "194-6" |
| 54 | title = "CTS 194-6MS, piano DIP switch, 6 positions" |
| 55 | params = { series = "194", positions = 6 } |
| 56 | aliases = ["CTS 194-6MS", "194-6MS", "194-6MST", "194-6MSN", "194-6MSTN"] |
| 57 | standard = "CTS" |
| 58 | |
| 59 | [[presets]] |
| 60 | id = "194-7" |
| 61 | title = "CTS 194-7MS, piano DIP switch, 7 positions" |
| 62 | params = { series = "194", positions = 7 } |
| 63 | aliases = ["CTS 194-7MS", "194-7MS", "194-7MST", "194-7MSN", "194-7MSTN"] |
| 64 | standard = "CTS" |
| 65 | |
| 66 | [[presets]] |
| 67 | id = "194-8" |
| 68 | title = "CTS 194-8MS, piano DIP switch, 8 positions" |
| 69 | params = { series = "194", positions = 8 } |
| 70 | aliases = ["CTS 194-8MS", "194-8MS", "194-8MST", "194-8MSN", "194-8MSTN"] |
| 71 | standard = "CTS" |
| 72 | |
| 73 | [[presets]] |
| 74 | id = "194-9" |
| 75 | title = "CTS 194-9MS, piano DIP switch, 9 positions" |
| 76 | params = { series = "194", positions = 9 } |
| 77 | aliases = ["CTS 194-9MS", "194-9MS", "194-9MST", "194-9MSN", "194-9MSTN"] |
| 78 | standard = "CTS" |
| 79 | |
| 80 | [[presets]] |
| 81 | id = "194-10" |
| 82 | title = "CTS 194-10MS, piano DIP switch, 10 positions" |
| 83 | params = { series = "194", positions = 10 } |
| 84 | aliases = ["CTS 194-10MS", "194-10MS", "194-10MST", "194-10MSN", "194-10MSTN"] |
| 85 | standard = "CTS" |
| 86 | |
| 87 | [[presets]] |
| 88 | id = "194-12" |
| 89 | title = "CTS 194-12MS, piano DIP switch, 12 positions" |
| 90 | params = { series = "194", positions = 12 } |
| 91 | aliases = ["CTS 194-12MS", "194-12MS", "194-12MST", "194-12MSN", "194-12MSTN"] |
| 92 | standard = "CTS" |
| 93 |
A through-hole DIP switch with side-actuated "piano" keys, CTS Series 194/195. The body stands on the board, and the keys stick out of one long face. Pin 1 is at the origin. The switches' pins 1 to N run along +X in the row nearest the keys, and their other pins run in the row 7.62 towards +Y (switch 1 joins pins 1 and 2N). The keys stick out of the body's -Y face.
series: 194 (gold-plated contacts) or 195 (tin-plated). The sheet gives both the same size.positions: 2 to 10, or 12.| Positions | Part number | "A" (length) | Depth across the rows | Height above the board | Keys |
|---|---|---|---|---|---|
| 2 | 194-2MS | 7.26 | 9.78 | 7.90 | 2 |
| 3 | 194-3MS | 9.80 | 9.78 | 7.90 | 3 |
| 4 | 194-4MS | 12.34 | 9.78 | 7.90 | 4 |
| 5 | 194-5MS | 14.88 | 9.78 | 7.90 | 5 |
| 6 | 194-6MS | 17.42 | 9.78 | 7.90 | 6 |
| 7 | 194-7MS | 19.96 | 9.78 | 7.90 | 7 |
| 8 | 194-8MS | 22.50 | 9.78 | 7.90 | 8 |
| 9 | 194-9MS | 25.04 | 9.78 | 7.90 | 9 |
| 10 | 194-10MS | 27.58 | 9.78 | 7.90 | 10 |
| 12 | 194-12MS | 32.66 | 9.78 | 7.90 | 12 |
All sizes: pins 2.54 apart, the rows 7.62 apart, pins 0.48 along the row and 0.20 across it, 3.81 below the board. Keys are 1.52 wide and stick out 1.14 (the M, medium height, actuator). The suffixes don't change the size: T (top tape seal) and N (shipped in the ON position).
CTS Electrocomponents, Series 194/195 Data Sheet, Through Hole DIP Switch, dated 06/14/17 (© 2017 CTS Corporation), read from Chip and Dip's copy (static.chipdip.ru/lib/834/DOC040834963.pdf, a copy as downloaded from Arrow). Page 2-2 has the drawing and the table: 9.78 ±0.25 deep; "A" ±0.25 by positions (2 to 10 and 12); 7.90 from the mounting surface; terminals 3.81 +0.25/-0.51 long, 0.48 ±0.08 wide and 0.20 ±0.08 thick; 2.54 typ. pitch; rows 7.62 +0.38/-0.13 apart; keys 1.52 wide and 1.14 REF out; 0.38 standoff. Page 1-2 says the plastics are UL 94V-0 and the terminals tin-plated. The sheet gives no weight.
Proportions. The body is centred on the pins both ways. The keys are 3.2 high from the body's top, as the front view draws them. The 0.38 standoffs aren't modelled: the body stands on the board. The body is one solid block. The materials are pa6 for the body and keys (the sheet names only UL 94V-0 plastics) and copper for the pins, both chosen for density. That gives 0.67 g (2 positions), 2.1 g (8) and 3.06 g (12). The sheet gives no weight to compare with.
The body and keys are black, as in the sheet's pictures.
SW_DIP_SPSTx02_Piano_CTS_Series194-2MSTN_W7.62mm_P2.54mm, measured 2026-11-06: 7.26 long, the pins at the sheet's places (the first 0.03 off the body's centre line), 0.48 x 0.20 and 3.81 below. Its body is 9.78 deep, and its keys stick out 0.9 against the sheet's 1.14 REF. It is 8.05 high against 7.90. The catalogue's 2- to 10- and 12-position CTS 194 models map to these presets. Its 11-position model is left out, because the sheet has no 11-position switch.
The catalogue's generic piano switches (Piano_10.8x...) name no maker. The 2-position one measures 12.2 deep with its keys and 10.2 high, so it isn't the CTS part. The generic slide switches are top-actuated, so they are another kind of part. See COVERAGE.md.
| 1 | # DIP switch, through-hole, side-actuated |
| 2 | |
| 3 | A through-hole DIP switch with side-actuated "piano" keys, CTS Series 194/195. The body stands on the board, and the keys stick out of one long face. Pin 1 is at the origin. The switches' pins 1 to N run along +X in the row nearest the keys, and their other pins run in the row 7.62 towards +Y (switch 1 joins pins 1 and 2N). The keys stick out of the body's -Y face. |
| 4 | |
| 5 | ## Parameters |
| 6 | |
| 7 | - `series`: `194` (gold-plated contacts) or `195` (tin-plated). The sheet gives both the same size. |
| 8 | - `positions`: 2 to 10, or 12. |
| 9 | |
| 10 | ## Sizes |
| 11 | |
| 12 | | Positions | Part number | "A" (length) | Depth across the rows | Height above the board | Keys | |
| 13 | |---|---|---|---|---|---| |
| 14 | | 2 | 194-2MS | 7.26 | 9.78 | 7.90 | 2 | |
| 15 | | 3 | 194-3MS | 9.80 | 9.78 | 7.90 | 3 | |
| 16 | | 4 | 194-4MS | 12.34 | 9.78 | 7.90 | 4 | |
| 17 | | 5 | 194-5MS | 14.88 | 9.78 | 7.90 | 5 | |
| 18 | | 6 | 194-6MS | 17.42 | 9.78 | 7.90 | 6 | |
| 19 | | 7 | 194-7MS | 19.96 | 9.78 | 7.90 | 7 | |
| 20 | | 8 | 194-8MS | 22.50 | 9.78 | 7.90 | 8 | |
| 21 | | 9 | 194-9MS | 25.04 | 9.78 | 7.90 | 9 | |
| 22 | | 10 | 194-10MS | 27.58 | 9.78 | 7.90 | 10 | |
| 23 | | 12 | 194-12MS | 32.66 | 9.78 | 7.90 | 12 | |
| 24 | |
| 25 | All sizes: pins 2.54 apart, the rows 7.62 apart, pins 0.48 along the row and 0.20 across it, 3.81 below the board. Keys are 1.52 wide and stick out 1.14 (the M, medium height, actuator). The suffixes don't change the size: T (top tape seal) and N (shipped in the ON position). |
| 26 | |
| 27 | ## Source |
| 28 | |
| 29 | CTS Electrocomponents, *Series 194/195 Data Sheet, Through Hole DIP Switch*, dated 06/14/17 (© 2017 CTS Corporation), read from Chip and Dip's copy (static.chipdip.ru/lib/834/DOC040834963.pdf, a copy as downloaded from Arrow). Page 2-2 has the drawing and the table: 9.78 ±0.25 deep; "A" ±0.25 by positions (2 to 10 and 12); 7.90 from the mounting surface; terminals 3.81 +0.25/-0.51 long, 0.48 ±0.08 wide and 0.20 ±0.08 thick; 2.54 typ. pitch; rows 7.62 +0.38/-0.13 apart; keys 1.52 wide and 1.14 REF out; 0.38 standoff. Page 1-2 says the plastics are UL 94V-0 and the terminals tin-plated. The sheet gives no weight. |
| 30 | |
| 31 | **Proportions.** The body is centred on the pins both ways. The keys are 3.2 high from the body's top, as the front view draws them. The 0.38 standoffs aren't modelled: the body stands on the board. The body is one solid block. The materials are `pa6` for the body and keys (the sheet names only UL 94V-0 plastics) and `copper` for the pins, both chosen for density. That gives 0.67 g (2 positions), 2.1 g (8) and 3.06 g (12). The sheet gives no weight to compare with. |
| 32 | |
| 33 | The body and keys are black, as in the sheet's pictures. |
| 34 | |
| 35 | ## The old catalogue's models |
| 36 | |
| 37 | `SW_DIP_SPSTx02_Piano_CTS_Series194-2MSTN_W7.62mm_P2.54mm`, measured 2026-11-06: 7.26 long, the pins at the sheet's places (the first 0.03 off the body's centre line), 0.48 x 0.20 and 3.81 below. Its body is 9.78 deep, and its keys stick out 0.9 against the sheet's 1.14 REF. It is 8.05 high against 7.90. The catalogue's 2- to 10- and 12-position CTS 194 models map to these presets. Its 11-position model is left out, because the sheet has no 11-position switch. |
| 38 | |
| 39 | The catalogue's generic piano switches (`Piano_10.8x...`) name no maker. The 2-position one measures 12.2 deep with its keys and 10.2 high, so it isn't the CTS part. The generic slide switches are top-actuated, so they are another kind of part. See `COVERAGE.md`. |
| 40 |
Through-hole DIP switch with side-actuated piano keys: body, keys and pins at 2.54 x 7.62 mm DIP centres, sized from CTS's Series 194/195 data sheet. See the README.
A through-hole DIP switch with side-actuated "piano" keys, CTS Series 194/195. The body stands on the board, and the keys stick out of one long face. Pin 1 is at the origin. The switches' pins 1 to N run along +X in the row nearest the keys, and their other pins run in the row 7.62 towards +Y (switch 1 joins pins 1 and 2N). The keys stick out of the body's -Y face.
series: 194 (gold-plated contacts) or 195 (tin-plated). The sheet gives both the same size.positions: 2 to 10, or 12.| Positions | Part number | "A" (length) | Depth across the rows | Height above the board | Keys |
|---|---|---|---|---|---|
| 2 | 194-2MS | 7.26 | 9.78 | 7.90 | 2 |
| 3 | 194-3MS | 9.80 | 9.78 | 7.90 | 3 |
| 4 | 194-4MS | 12.34 | 9.78 | 7.90 | 4 |
| 5 | 194-5MS | 14.88 | 9.78 | 7.90 | 5 |
| 6 | 194-6MS | 17.42 | 9.78 | 7.90 | 6 |
| 7 | 194-7MS | 19.96 | 9.78 | 7.90 | 7 |
| 8 | 194-8MS | 22.50 | 9.78 | 7.90 | 8 |
| 9 | 194-9MS | 25.04 | 9.78 | 7.90 | 9 |
| 10 | 194-10MS | 27.58 | 9.78 | 7.90 | 10 |
| 12 | 194-12MS | 32.66 | 9.78 | 7.90 | 12 |
All sizes: pins 2.54 apart, the rows 7.62 apart, pins 0.48 along the row and 0.20 across it, 3.81 below the board. Keys are 1.52 wide and stick out 1.14 (the M, medium height, actuator). The suffixes don't change the size: T (top tape seal) and N (shipped in the ON position).
CTS Electrocomponents, Series 194/195 Data Sheet, Through Hole DIP Switch, dated 06/14/17 (© 2017 CTS Corporation), read from Chip and Dip's copy (static.chipdip.ru/lib/834/DOC040834963.pdf, a copy as downloaded from Arrow). Page 2-2 has the drawing and the table: 9.78 ±0.25 deep; "A" ±0.25 by positions (2 to 10 and 12); 7.90 from the mounting surface; terminals 3.81 +0.25/-0.51 long, 0.48 ±0.08 wide and 0.20 ±0.08 thick; 2.54 typ. pitch; rows 7.62 +0.38/-0.13 apart; keys 1.52 wide and 1.14 REF out; 0.38 standoff. Page 1-2 says the plastics are UL 94V-0 and the terminals tin-plated. The sheet gives no weight.
Proportions. The body is centred on the pins both ways. The keys are 3.2 high from the body's top, as the front view draws them. The 0.38 standoffs aren't modelled: the body stands on the board. The body is one solid block. The materials are pa6 for the body and keys (the sheet names only UL 94V-0 plastics) and copper for the pins, both chosen for density. That gives 0.67 g (2 positions), 2.1 g (8) and 3.06 g (12). The sheet gives no weight to compare with.
The body and keys are black, as in the sheet's pictures.
SW_DIP_SPSTx02_Piano_CTS_Series194-2MSTN_W7.62mm_P2.54mm, measured 2026-11-06: 7.26 long, the pins at the sheet's places (the first 0.03 off the body's centre line), 0.48 x 0.20 and 3.81 below. Its body is 9.78 deep, and its keys stick out 0.9 against the sheet's 1.14 REF. It is 8.05 high against 7.90. The catalogue's 2- to 10- and 12-position CTS 194 models map to these presets. Its 11-position model is left out, because the sheet has no 11-position switch.
The catalogue's generic piano switches (Piano_10.8x...) name no maker. The 2-position one measures 12.2 deep with its keys and 10.2 high, so it isn't the CTS part. The generic slide switches are top-actuated, so they are another kind of part. See COVERAGE.md.
Through-hole 10-position rotary coded DIP switch from Nidec's SH-7000 catalogue: SH-7010C (real code) and SH-7030C (complementary code).
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.