switches
mechanical ways to connect or select circuits. two axes: poles (how many circuits) and throws (positions).
type | expands to | use |
---|---|---|
spst | single-pole single-throw | on/off |
spdt | single-pole double-throw | choose a or b |
dpdt | double-pole double-throw | flip two lines at once (e.g., polarity reverse) |
mom. | momentary | returns when released |
spdt contact map
no vs nc (what “normal” means)
label | expands to | at rest | when actuated | common uses |
---|---|---|---|---|
NO | normally open | open (off) | closes (on) | doorbell, keyboard keys, most pushbuttons |
NC | normally closed | closed (on) | opens (off) | e-stop, tamper loops, hold-to-break safety |
COM | common | the wiper. in an spdt, COM connects to NO or NC depending on lever position. |
fact
“normal” = unpressed/unflipped; for relays, coil not energized. momentary = returns when released. toggle = stays where you leave it.
try this
wire an LED to NO and another to NC (with resistors). move the lever and watch which one lights. debounce
mechanical contacts bounce for a few ms. in code, debounce 10–50 ms or hardware RC + schmitt trigger.