Switches, Connectors and Protection
Switch types and ratings, connector families, fuses, reverse-polarity and surge protection, and wiring good practice.
Switches
A switch opens or closes a connection by hand. Two numbers name its action: the poles (how many separate circuits it switches) and the throws (how many positions each pole can connect to). SPST is single pole, single throw (on/off); SPDT is a changeover; DPDT switches two circuits at once.
| Type | Use | Notes |
|---|---|---|
| Toggle, rocker, slide | Power on/off, mode selection | Stay in position; rocker switches often come with a lamp |
| Tactile (tact) button | User input to a microcontroller | Momentary; 12 V 50 mA is a typical rating; not for power |
| Push-button (panel) | Start, stop, emergency stop | Industrial types have N.O. and N.C. contacts and a latching or momentary action |
| Rotary / DIP switch | Settings, addresses | Rotary encoders turn into pulses; see Sensors |
| Limit / micro switch | Detecting position or a door | Lever or roller actuator; use the N.C. contact for fail-safe detection |
| Reed switch | Magnet detection | Sealed contacts in glass; no wear, limited current |
| Key switch, selector | Access control, mode | Panel mount; check the rating |
Switch ratings and contact bounce
- Current and voltage rating. Every switch has a maximum current at a given voltage, often two figures: “3 A 250 V AC / 6 A 125 V AC”. The DC rating is usually much lower than the AC rating because a DC arc does not go out by itself; if only the AC rating is given, derate heavily for DC.
- Inductive and lamp loads (motors, solenoids, relays, capacitive supplies, incandescent lamps) make arcs and surges when switched. Derate to half or less of the rating, add a flyback diode or snubber, and consider a relay or MOSFET.
- Low-level (“dry circuit”) contacts. A big power switch may not make a reliable contact at a few milliamps. For signals, use a switch rated for small currents (gold-plated contacts).
- Contact bounce. When a mechanical contact closes, it bounces for 1–10 ms, producing a burst of on/off transitions. A microcontroller reads each one as a separate press.
Debouncing
- In software: ignore further changes for 20–50 ms after the first edge, or require the same reading several times in a row. This is free and usually enough.
- In hardware: an RC filter across the switch (for example 10 kΩ and 100 nF, τ = 1.0 ms) with a Schmitt-trigger input (74HC14) smooths the bounce.
- Interrupt inputs are especially sensitive to bounce and need one of the above.
Connectors
| Connector | Pitch / size | Typical rating | Notes |
|---|---|---|---|
| Pin header / Dupont | 2.54 mm | 1 A per pin | Breadboards and hobby modules; no keying or lock, so mind the orientation |
| JST-PH | 2.0 mm | 2 A | Small LiPo batteries and sensors; polarized |
| JST-XH | 2.5 mm | 3 A | Keyed, secure; balance leads and boards |
| JST-SH / Qwiic / STEMMA QT | 1.0 mm | 1 A | I²C sensor cables |
| Molex KK | 2.54 mm | 3 A | Keyed, friction lock; widely used |
| Screw terminal | 3.5, 5.0, 5.08 mm | 8–16 A | No crimp tool; good for field wiring |
| XT30 / XT60 / XT90 | — | 15 A / 30 A / 40 A+ | Hobby batteries and motors; polarized; avoid arcing on connect |
| Barrel jack | 5.5 × 2.1 mm | 2–5 A | Center-positive is the common convention, but check: there is no standard |
| USB-A / micro / USB-C | — | 0.5–3 A (5 V); to 5 A with PD | Data and power; USB-C negotiates the voltage |
| Anderson Powerpole | — | 15–45 A | Genderless; any pairing, so label polarity |
- Polarity and keying. Choose connectors that cannot be plugged in backwards, or mark them clearly. A reversed power plug is a common way to destroy a board.
- Crimped, not soldered. A proper crimp is gas-tight and stronger than solder; use the crimp tool made for the terminal. Solder wicks up the wire and makes it brittle. See Soldering for wire and strain relief.
- Current rating is per contact and at a temperature rise; derate when many contacts carry current in a bundle or when the connector is warm.
- Locking. Use a latching connector where vibration or tugging is likely (motors, vehicles, robots).
- Wire gauge. Match the wire to the connector and to the current; see the AWG table in Soldering and System Integration for voltage drop.
Fuses and circuit breakers
A fuse is a deliberate weak link: a thin conductor that melts and opens the circuit when the current is too high for too long. It protects the wiring (so it does not overheat and start a fire) and limits the damage a fault can do.
| Type | Behavior | Notes |
|---|---|---|
| Fast-blow (F) | Opens quickly on overload | Protects delicate electronics |
| Slow-blow / time-delay (T) | Tolerates a short surge (motor start, supply inrush) | For loads with inrush current |
| Blade (automotive) | 32 V DC, 1–40 A | Standard in vehicles; color-coded by rating |
| Resettable polyfuse (PTC) | Resistance rises sharply when hot, resets when cool | Convenient for USB and small boards; slow and not for mains |
| Thermal fuse | Opens above a temperature, once | In heaters and transformers |
| Circuit breaker | Resettable switch that trips | Panels and larger supplies |
- Choose the current: above the normal running current (typically 125–150 % of it, or higher for loads with inrush), and always below the safe current of the wire and connectors. The fuse protects the weakest part of the path.
- Choose the voltage: the fuse’s voltage rating must be at least the circuit voltage (DC ratings are lower than AC ratings).
- Place it near the source (the battery or supply), so the whole run of wire is protected.
- Interrupt rating: a fuse must be able to break the maximum fault current the supply can deliver (a car or lithium battery can supply hundreds of amps). Use a fuse with a suitable breaking capacity.
- Replace a fuse with the same rating, never with a bigger one or a wire. Find out why it blew first.
Worked example: a 12 V, 3 A LED strip on AWG 18
- Running current is 3 A. A fuse of 125–150 % gives 3.75–4.5 A, so a standard 5 A fuse suits.
- AWG 18 chassis wire is commonly rated at about 7 A, so it is protected by a 5 A fuse. (Use the maker’s table for your insulation and bundle.)
- Place the fuse within 150 mm of the supply’s positive terminal.
Reverse-polarity protection
Connecting a battery or supply backwards destroys polarized parts in an instant. Where it can happen, add protection.
| Method | Loss | Comment |
|---|---|---|
| Series diode | 0.3–0.7 V | Simplest. At 1 A the loss is 0.5 W for a 0.5 V drop: poor for a low-voltage battery |
| Bridge rectifier | 1.4 V | Accepts either polarity (and AC) but wastes the most |
| P-channel MOSFET in the positive line (source toward the load; gate to ground through a resistor) | I² × RDS(on): 0.03 W at 1 A and 30 mΩ | The body diode conducts initially, then the gate turns the MOSFET on: almost no loss. Check the gate-source voltage limit (typically ±20 V) |
| Diode across the supply plus a fuse | None in normal use | A reversed supply blows the fuse; slower and needs replacing |
| Polarized connector | None | Prevents the mistake; always use as well |
Surge, static and spike protection
- TVS diode across the supply or a data line clamps spikes (long cables, motors, hot-plugging, mains-borne surges). Pick a standoff voltage above the normal voltage and a clamp voltage below the maximum the circuit can survive.
- ESD protection on exposed connectors (USB, buttons, headers) with low-capacitance TVS arrays. Static discharges of several kilovolts are common on a dry day.
- Inrush limiting. A large capacitor charges with a big surge when power is first applied. An NTC thermistor in series, or a soft-start circuit, limits it.
- Series resistors (100 Ω to 1 kΩ) on I/O lines limit the current that a spike or a mistaken connection can push into a pin.
- Clamp diodes. Two diodes (one to the supply, one to ground) catch any input that goes beyond the rails.
- Flyback diode across every relay and motor coil (see Inductors, Transformers and Relays).
Good practice
- Label polarity and voltage at every power connector, and use red for positive and black for ground.
- Power switch and fuse first. The path from the source goes: connector, fuse, switch, protection, then the circuit.
- Star grounding. Bring noisy grounds (motors) back to the supply separately from quiet analog grounds, rather than daisy-chaining.
- Strain relief at every connector and joint, so the wire cannot be pulled out or flexed where it is soldered.
- Test before connecting a load. Measure the supply voltage and polarity with a meter before plugging in a board (see Test Tools and Fault Finding).
- Enclose mains wiring and keep it separate from low-voltage wiring. Follow the electrical code for any mains work.
Related
- Electronics Fundamentals: the overview of this guide.
- Batteries and Power Supplies: power supplies, batteries and regulators.
- Soldering: wire, crimping, connectors and strain relief.
- Workshop Safety: electrical safety and fire.
FAQ
Why does my button press register several times?
The contacts bounce when they close, making a burst of transitions for a few milliseconds. Debounce in software by ignoring changes for 20–50 ms, or add an RC filter and a Schmitt-trigger input.
Can I use an AC-rated switch on a DC circuit?
Only with heavy derating. DC arcs do not extinguish at a zero crossing, so a switch rated 10 A at 250 V AC may handle only a fraction of that at 24 V DC. Use the DC rating, or a switch made for DC.
Which fuse should I use?
Choose one above the normal current (125–150 %) but safely below the rating of the wire and connectors; check the voltage rating and the interrupt rating; and use slow-blow if the load has inrush.
Is a series diode good enough for reverse protection?
It works, but it drops 0.3–0.7 V and dissipates heat. For a battery-powered circuit where every volt counts, use a P-channel MOSFET instead; for a simple mains adapter input, a diode is fine.
What is the difference between a TVS and a varistor?
Both clamp surges. A TVS clamps faster and more precisely and recovers; a varistor (MOV) handles bigger energy and is used across mains inputs, but degrades with repeated surges.
References
- Horowitz, P. and Hill, W., The Art of Electronics, 3rd ed., Cambridge University Press.
- Manufacturer datasheets and selection guides: JST, Molex, Amass (XT connectors), Littelfuse and Bussmann (fuses), Omron and C&K (switches).
- UL 248 and IEC 60127, fuse standards; NFPA 70 (NEC) for wiring and overcurrent protection.
- Ganssle, J., A Guide to Debouncing, The Ganssle Group (contact bounce measurements and fixes).
Last reviewed: October 2026. Values are typical: check the datasheets of the parts you use. Follow the electrical code for any mains work.
