2-Pin Push Button Switch Wiring Diagram: Pull-Ups and Debounce
A 2-pin push button switch wiring diagram connects a single two-terminal contact pair to a low-voltage logic input—alongside a pull-up or pull-down resistor so the input never floats when the button is open. Unilluminated 2-pin mechanical contacts are nonpolar, yet choosing between normally open (NO), normally closed (NC), momentary, and latching suffixes—plus sizing the pull resistor against input leakage and debounce—determines whether an MCU registers clean presses in production.
Wiring a 2-pin switch: Active-Low pull-up vs. Active-High pull-down
Every open mechanical contact leaves a high-impedance CMOS pin floating and vulnerable to noise or phantom triggers. Most PCB designs prefer Active-Low (pull-up to +3.3 V, switch to GND) because routing ground to an off-board front-panel switch avoids exposing the regulated +3.3 V rail to accidental chassis shorts. Note that these examples apply strictly to energy-limited SELV logic inputs—never mains or safety interlocks. Do not confuse a 2-pin SPST contact with a 3-terminal changeover switch (see our SPDT switch arrangement guide).
Distinguish NO, NC, momentary, and latching contact actions
Identical actuator caps and footprints can hide completely different switching actions—lock the exact orderable suffix per our PCB switch action & package guide:
Sizing a 3.3 V pull-up resistor against leakage & logic thresholds
Assume a 3.3 V MCU rail spanning 3.0–3.6 V, logic thresholds of VIH ≥ 2.0 V and VIL ≤ 0.8 V, maximum open-state pin sink leakage of 20 µA, and worst-case closed switch + trace resistance of 100 Ω:
Closed-State Worst Low (9.5 kΩ min): 3.6 V × 100 / (9,500 + 100) = 0.0375 V (+0.76 V margin)
| Pull-Up R1 (±5%) | Worst Open Vin | Nominal Pressed I | DC Logic Verdict & Trade-Off |
|---|---|---|---|
| 4.7 kΩ | 2.901 V | 0.70 mA | Pass Strong noise immunity & contact wetting; higher pressed current |
| 10 kΩ | 2.790 V | 0.33 mA | Pass Balanced default for general MCU logic inputs |
| 100 kΩ | 0.900 V | 0.033 mA | Fail Drops 2.1 V under 20 µA leakage—violates 2.0 V VIH! |
Two practical design details matter here: (1) an external resistor guarantees a known idle state during MCU boot/reset before internal pull-ups enable—and ensures the pin isn’t briefly driven HIGH as an output while pressed; and (2) verify the switch datasheet’s minimum wetting current, because heavy power contacts can oxidize when switching only 0.33 mA. Compare resistor technologies in our PCB resistor types guide.
Contact bounce, 100 nF RC filtering & firmware debounce
Mechanical switch contacts chatter for 1–20 ms on make and break. Adding a 100 nF filter capacitor across an active-low input with a 10 kΩ pull-up yields τ = 1.0 ms, charging from 0 V to the 2.0 V threshold in −1.0 ms × ln(1 − 2.0/3.3) ≈ 0.93 ms after release—but repeated bounces can still reset the cap and slow edges can chatter non-Schmitt inputs:
Separating ICT continuity from powered functional testing
Board-Level ICT (Unpowered)
- Verify resistor R1 value, pad-to-net continuity, and absence of shorts on a de-energized PCB per our in-circuit testing (ICT) guide.
- Expose dedicated test pads for the switch input and local GND without disturbing signal capacitance via our PCB test-point design rules.
Functional Press & Release Test (Powered)
- Measure idle voltage (confirm ≥ 2.0 V), actuated low level (≤ 0.8 V), and post-release return to idle.
- Verifying the return to idle catches an accidental latching-switch substitution that a press-only test misses.
Frequently asked questions
Does a 2-pin push button switch have polarity?
An unilluminated mechanical 2-pin switch is nonpolar and works identically in either direction. Illuminated push buttons (with an integrated LED) or diode-protected switches are polarized—always check the manufacturer schematic.
Why is a 10 kΩ pull-up safer than 100 kΩ on a 3.3 V logic input?
Under a 20 µA worst-case input leakage, a 100 kΩ ±5% pull-up drops up to 2.1 V, pulling a 3.0 V rail down to 0.9 V (failing a 2.0 V VIH threshold). A 10 kΩ ±5% pull-up stays at 2.79 V with 0.79 V margin while drawing only 0.33 mA when pressed.
Is a 100 nF capacitor enough to debounce a push button by itself?
Usually not alone. While 10 kΩ × 100 nF creates a 1 ms time constant, heavy switch bounce can re-discharge the capacitor repeatedly, and slow rising edges require a Schmitt-trigger input or a firmware debounce interval (typically 10–20 ms) to guarantee single-event detection.
Review your push-button input & test-point layout before PCBA
As a PCB manufacturing and PCB assembly factory, Highleap Electronics verifies exact switch MPN contact actions (NO/NC/latching), footprint clearances, and ICT/functional test-point access before production.
- Exact switch MPN & momentary/latching suffix
- 3.3 V / 5 V rail, VIH/VIL & leakage limits
- Pull-up/pull-down value & debounce timing
- PCB Gerbers, test-point map & assembly drawing
Recommended Posts
2k Resistor Color Code: Axial Bands, SMD Marks, and Tolerance
A 2 kΩ resistor (2,000 Ω, also written 2k, 2K0, or 2000R)...
2N2222 Pinout Across TO-18, TO-92, and SOT-23 Packages
There is no universal 2N2222 or 2N2222A transistor pinout....
Ceramic PCB Thick-Film Metallization: Qualifying the Fired Print
Release ceramic PCB thick-film metallization strictly...
2N3055 Power Transistor: TO-3 Pinout, SOA, and Heatsink Design
The 2N3055 is an NPN silicon power transistor in the...
How to get a quote for PCBs
Let‘s run DFM/DFA analysis for you and get back to you with a report. You can upload your files securely through our website. We require the following information in order to give you a quote:
-
- Gerber, ODB++, or .pcb, spec.
- BOM list if you require assembly
- Quantity
- Turn time
In addition to PCB manufacturing, we offer a comprehensive range of electronic services, including PCB design, PCBA, and turnkey solutions. Whether you need help with prototyping, design verification, component sourcing, or mass production, we provide end-to-end support to ensure your project’s success.
For PCBA services, please provide your BOM (Bill of Materials) and any specific assembly instructions. We also offer DFM/DFA analysis to optimize your designs for manufacturability and assembly, ensuring a smooth production process.
