Quick Answer
A switch is two conductors mechanically brought together or parted. Closing is messy — the contacts bounce for a few milliseconds — and opening is where the damage happens, because whatever energy the circuit holds has to go somewhere as the gap forms.
Intuition
Making and breaking are two different problems
A switch looks like the simplest component in the box. Two terminals, a lever, and a piece of metal that either bridges them or does not. There is no physics to explain and no formula to learn.
The trouble is that a switch is not a circuit element at all. It is a piece of machinery, and machinery does things in time.
Closing one is not an instant. Two pieces of springy metal come together at speed, and springy things bounce. The contacts touch, part, touch again, part again, and settle after a few milliseconds — during which the circuit has been made and broken several times. A person sees one press. A microcontroller sees a burst.
Opening one is a different problem, and a nastier one. As the contacts separate the gap starts at nothing, so the current has to keep flowing across a distance measured in atoms. It does, through an arc, and if the circuit is holding any energy — a coil, a motor, a length of cable — that energy has nowhere to go except across that gap. It burns the contact metal a little each time.
So the two operations of a switch fail in two unrelated ways. Closing gives you signals you did not ask for. Opening slowly destroys the switch. Almost everything else in this lesson is about one or the other.
Practitioner
What one press does to a logic pin
The intervals shrink geometrically, and the model says by how much.
Worked example — Twelve edges from one finger
Take a declared bounce model: a first interval of 2.0 ms shrinking by 0.65 each time, over 6 bounces.
That geometric series totals 5.28 ms and produces 12 edges where the circuit was asked for one.
A program polling at 1.0 MHz takes 5.28 k samples across that window, so it sees every one of them. It will count a single press as several unless something stops it.
The bounce model here is an invented illustration. Real switches vary from well under a millisecond to tens of milliseconds depending on their mechanism, their size and their age, and the only way to know a particular part's figure is to measure it or to read what the manufacturer measured.
Two cures exist and they are not equivalent. A hardware filter — a resistor and a capacitor, or a Schmitt-triggered gate — turns the burst into one clean edge before the logic ever sees it. A software debounce ignores further changes for a fixed time after the first one, which costs nothing in components and requires the code to be doing something at the right moment.
The filter has to outlast the bouncing, and that is the delay.
Worked example — Sizing a filter, and what it costs
Put 47 kΩ and 220 nF across the contact. That is 10.3 ms of time constant.
On a 3.3 V rail with a logic threshold at 1.65 V, the filtered voltage reaches the threshold after 7.17 ms.
The last bounce ended at 5.28 ms, so the filter clears the whole train with 1.88 ms to spare — and the press is not registered until 7.17 ms after the finger touched the button. That delay is the price, and for anything a human presses it is invisible.
Engineer
Poles, throws, and the resistance nobody specifies
A double-throw never has both ends open at once.
Two words describe every switch ever made. Poles are how many separate circuits it switches, all moved by the same actuator. Throws are how many places each pole can connect to.
A single-throw switch makes or breaks; a double-throw always connects to one of two places and never to neither, which matters whenever a floating input would be a problem. A double-pole part gives two electrically separate sets of contacts operated together, which is how a switch breaks both conductors of a supply at once, or switches a signal and its return together.
Momentary or latching is the third choice, and it is about the mechanism rather than the contacts: a pushbutton returns when released, a toggle stays. Normally-open and normally-closed describe what a momentary contact does when nobody is touching it.
The same contact, three currents.
Worked example — The resistance you did not ask for
A closed contact is a resistor. Take an illustrative 30 mΩ.
At 100 mA it drops 3.0 mV and makes 300 µW, which nothing anywhere notices.
At 5.0 A the same contact drops 150 mV and makes 750 mW — a switch warm to the touch, and warm contacts oxidise faster than cool ones, which raises the resistance, which makes more heat.
Contact resistance is not stable and low-level switching is its own discipline. A contact that has never carried much current develops an oxide or sulphide film, and a film that a hundred milliamps punches straight through can block a microamp entirely. Gold plating exists for exactly that case; a plain silver or tin contact in a low-level signal path is a switch that works intermittently after a year in a drawer. The rule of thumb is that a contact needs some minimum current to keep itself clean, and switches intended for signal-level work say so.
Professional
The rating, and the load that ignores it
The number on the body answers only the first of these.
A switch marked with a current and a voltage is telling you one thing about a resistive load at a stated number of operations, and nothing about anything else.
Direct current is harder than alternating current. An AC arc is extinguished for free a hundred times a second when the current passes through zero; a DC arc has no such help and has to be pulled apart until it starves. That is why a switch rated for several amps at mains AC may be rated for a fraction of an amp at a far lower DC voltage — a difference of a factor rather than a percentage, though the exact figures belong to the part and are not published here, and why substituting one for the other is a real mistake rather than a conservative one.
A load that stores energy is harder still, and it is where switches die.
Closing it is a mechanical problem; opening it is an energy problem.
Worked example — What the contacts have to absorb
Switch a coil of 250 mH carrying 133 mA. The field holds 2.21 mJ.
When the contacts part, that energy does not stop existing. The coil raises whatever voltage it needs to keep its current flowing, and what it finds in the way is a gap a few atoms wide.
2.21 mJ deposited into a contact face, a few thousand times, is what pits and welds contacts. A diode across the load gives the energy somewhere else to go, and the flyback diode lesson works through what happens to it there.
Note where that diode sits. Across the load, not across the switch. Across the switch it would do nothing useful and, one way round, would short the supply.
Choosing and using one
Match the mechanism to the job, then check the electrical rating. Tactile pushbuttons for a panel, toggles where a state has to be visible from across a room, rockers for mains appliances, slide switches for something set once and forgotten, rotary and DIP switches for configuration. The feel of a switch is most of what a user thinks of the product it is on.
Never switch a mains load with a signal-rated part, and never assume a part is mains-rated because it is physically large. Approval marks on the body are the evidence, and a switch on a mains circuit is doing a safety job.
Wetting current, sealing and travel are the specifications people skip. A sealed switch survives a workshop; an unsealed one fills with flux, dust and finger grease. Long travel feels deliberate; short travel feels cheap and is easier to press by accident.
Debounce even if the input is not going to logic. A relay coil driven straight from a bouncing contact chatters, and a counter counts.
A switch is a wear item. The rating is quoted for a number of operations, and that number assumes the rated load. Halve the load and it lasts longer; add an inductive load with no snubbing and it will not reach a tenth of it.
Where this arrives next
The same contacts, closed by a coil instead of a finger, are a relay — which inherits every problem in this lesson and adds a coil of its own to the far side.
Common mistakes
- Assuming one press means one edge — this bounce model gives 12 edges over 5.28 ms, and a 1.0 MHz polling loop takes 5.28 k samples across them.
- Debouncing with too short a time constant — a filter that reaches the 1.65 V threshold before 5.28 ms lets some of the bouncing through. 47 kΩ and 220 nF cross at 7.17 ms, with 1.88 ms of margin.
- Reading a switch's AC rating as its DC rating — an alternating current extinguishes its own arc at every zero crossing and a direct current does not, so the DC figure is a different and lower number.
- Ignoring contact resistance at high current — 30 mΩ costs 300 µW at 100 mA and 750 mW at 5.0 A, and a hot contact oxidises faster, which makes it hotter.
- Switching an inductive load with no snubbing — 250 mH at 133 mA holds 2.21 mJ, and every time the contacts part that energy is deposited into the contact faces.
- Putting the snubbing diode across the switch — it belongs across the load. Across the switch it protects nothing, and one way round it shorts the supply.
Frequently asked questions
Why does one button press register as several?
Because the contacts bounce. On this illustrative model the first interval is 2.0 ms and each one after is 0.65 of the last, so the contacts settle after 5.28 ms having produced 12 edges. A program polling at 1.0 MHz sees all of them as separate events.
How big should a debounce filter be?
Big enough that its output has not reached the logic threshold when the last bounce ends. Here 47 kΩ and 220 nF give 10.3 ms, so a 3.3 V rail reaches the 1.65 V threshold at 7.17 ms against a 5.28 ms bounce — 1.88 ms of margin. Larger is safer and slower.
Why is a switch's DC rating lower than its AC rating?
Because an alternating current goes through zero a hundred times a second and puts the arc out for free. A direct current does not, so the contacts have to open far enough to starve the arc. The voltage at which that stops being possible is lower, and by how much is a property of the particular switch rather than a general figure.
What is wetting current and do I need to care?
It is the minimum current a contact needs to punch through the film that grows on its surface. Below it a switch works when new and behaves intermittently later. If you are switching microamps, use a part specified for low-level work, usually gold plated.
Why does switching a relay coil or a motor destroy switches?
Because of the energy in the field. A 250 mH coil at 133 mA holds 2.21 mJ, and when the contacts part that energy is dumped into an arc across a gap a few atoms wide. A diode across the load — not across the switch — gives it somewhere else to go.