Momentary vs Latching Switches: Choosing and Wiring a Push Button

Two push buttons can look identical and behave differently. A momentary switch returns when released; a latching switch keeps its selected state. Choose the action first, then check the contacts, mounting and electrical requirements.

In this guide
  1. Momentary vs latching
  2. NO, NC, SPST and SPDT
  3. Check a switch with a meter
  4. Wire a controller input
  5. A debounced Arduino button test
  6. Choose a switch that fits
  7. Common wiring symptoms

What happens when you let go?

Momentary describes a spring-return action. The contacts change while you press the button, then return when you release it. A reset button or a menu-select control commonly works this way.

Latching, also called maintained, self-locking or alternate action, holds its new state after release. A typical push-on/push-off button needs a second press to return. The mechanical switch remembers its position even when the circuit loses power. These terms describe the action; the Omron push-button technical guide illustrates the difference.

Two-terminal normally-open example Initially First press Release Second press
Momentary Open Closed Open again Closed while held
Push-on/push-off latching Open Closed Stays closed Returns to open

The cap colour does not identify the action. NZN's DS228 and DS429 families offer separate momentary and latching choices, so check the selected variant before ordering. A click you can hear or feel is also not proof that a switch latches.

Can a momentary button turn something on and leave it on?

Yes, if the controller remembers a state in software. For example, each valid press can toggle a display mode. That does not turn the physical contact into a latching contact, and the programme must define what happens after a restart. A mechanically latched switch and a software toggle are different choices for the whole product.

Action and contacts answer different questions

Action describes how the mechanism behaves. Contacts describe which electrical paths it connects. A momentary button can have normally-open contacts, normally-closed contacts or both.

Marking Meaning What to look for
NO Normally open The contact is open in its normal, unoperated state and closes when operated.
NC Normally closed The contact is closed in its normal state and opens when operated.
COM Common The shared contact that transfers between NO and NC on a changeover switch.
SPST Single pole, single throw One circuit path that opens or closes.
SPDT Single pole, double throw One common contact selects between two paths.
DPDT Double pole, double throw Two changeover contact sets operated together.

These contact terms follow Omron's NO/NC explanation and its basic-switch terminology. They do not establish the rating or pin order of an unbranded switch.

Terminal count alone is not enough: an illuminated switch can have lamp terminals as well as contact terminals. Likewise, a tactile button may have duplicate legs connected internally. Confirm the contact diagram or test the actual part.

ON-ON and ON-OFF-ON

An SPDT ON-ON toggle selects one of two connections in its stable positions. ON-OFF-ON adds a stable centre position with neither path connected. It is useful for choosing between two control signals with an off state.

One ordinary SPDT switch does not reverse both wires of a motor. For direction control, choose an appropriate motor driver or a correctly designed reversing circuit. A centre-off position is a switching function, not a safety isolation system.

Check the actual switch before wiring it

  1. Disconnect power and isolate the switch. Do continuity tests on the switch by itself. Other circuit paths can produce misleading results.
  2. Check the meter first. Select continuity or resistance and touch the probes together to confirm a beep or a low resistance reading.
  3. Measure the resting contacts. On a simple two-terminal switch, place one probe on each terminal. Record whether the path is open or closed.
  4. Press, hold and release. A normally-open momentary switch closes while held and opens on release. A latching version remains in its new state.
  5. Operate it again. Confirm that a second press returns a push-on/push-off switch to its starting state. For changeover contacts, map each terminal pair separately.

This check is especially useful for mixed drawers and replacement parts. Write the action and contact arrangement on the bag after testing. A familiar-looking cap is a poor substitute for an identified part.

A simple button input for Arduino or ESP32

For a basic controller input, use the button as a contact between an input and ground. An internal pull-up holds the open input HIGH; closing the contact pulls it LOW. The switch does not need a separate positive supply in this arrangement.

Connection or setting Classic Uno R3 test
First switch terminal Digital pin D2
Second switch terminal GND
Pin mode INPUT_PULLUP
Contact open HIGH
Contact closed LOW

The Arduino input pull-up example explains this arrangement. For the following test, use a two-terminal momentary switch, an Uno R3 or compatible ATmega328P board, two suitable leads and a USB data cable. Power off while connecting the leads and insulate exposed connections.

On an ESP32, the same contact-to-ground principle works with a suitable GPIO. Choose a free pin from the exact board's pinout and change the pin number in the sketch. Avoid pins reserved for flash, USB or boot configuration, and confirm the chosen pin supports an internal pull-up. The Espressif GPIO reference explains the input modes. Keep external 5 V signals away from ESP32 GPIO.

Read one clean press with software debounce

Mechanical contacts can make and break several times during one movement. Debounce waits for the reading to remain stable before accepting it. The original example below uses a 50 ms starting interval and reports only accepted state changes, so holding the button does not fill the monitor with repeated messages. Adjust the interval for your switch and response requirements.

const byte buttonPin = 2;  // Uno R3: D2
const unsigned long debounceMs = 50;

int lastRaw;
int stableState;
unsigned long changedAt;

void setup() {
  Serial.begin(115200);
  pinMode(buttonPin, INPUT_PULLUP);
  lastRaw = digitalRead(buttonPin);
  stableState = lastRaw;
  changedAt = millis();
  Serial.println(stableState == LOW
    ? "Initial: closed" : "Initial: open");
}

void loop() {
  const int raw = digitalRead(buttonPin);
  const unsigned long now = millis();

  if (raw != lastRaw) {
    lastRaw = raw;
    changedAt = now;
  }

  if (now - changedAt >= debounceMs
      && raw != stableState) {
    stableState = raw;
    Serial.println(stableState == LOW
      ? "Pressed / closed" : "Released / open");
  }
}

Select your Uno board and port, upload, then open Serial Monitor at 115200 baud. With the button released, expect Initial: open. Press and hold: expect one Pressed / closed message. Release: expect one Released / open message. With a latching switch, the contact stays closed after release, and the second press opens it.

The sketch reports contact state only; it does not switch a motor, lamp or other load. Compare the timing approach with Arduino's debounce tutorial if you want to extend it into a counter or menu control.

Choose a switch that fits the panel and circuit

Check the cut-out, usable panel thickness, rear clearance and terminal style before drilling. The name used to describe a switch is not always its hole diameter. NZN's DS228 is sold as a 12 mm family, but its current technical sheet specifies a 13 mm panel hole. The DS429 has conflicting lookalike dimensions, so measure the supplied part and make a trial opening before cutting a finished panel.

For controller inputs, check suitability for small signal loads as well as mechanical fit. For switching a load directly, match the declared AC or DC rating and load type. An AC current marking is not the same DC current rating; motors and other inductive loads bring additional requirements. The basic-switch selection guidance explains why contact loading matters.

Keep this beginner test to the USB-powered controller input. Do not connect mains, a motor supply or a battery pack directly to a GPIO. Use a suitable driver for loads and a properly assessed design for safety-related controls.

Common symptoms and what to check

Symptom Check
The input changes by itself Confirm INPUT_PULLUP, ground continuity and sound leads.
The input is always LOW Look for a short to ground, a latched contact or the wrong terminal pair.
The input is always HIGH Check that the contact actually closes and both leads reach D2 and GND.
One press gives several counts Debounce the contact and count the accepted closing transition, not every loop while LOW.
It stays closed when released Check whether the selected variant is latching. That may be its intended action.

Push-button options at NZN

Select the required action on the product page. Current variant availability, price and technical documents are shown there.

If you are building your first controller circuit, our breadboard basics guide explains the connections underneath the holes.

Choose by behaviour, then fit

Decide what should happen on release, confirm the contacts, and check the actual mounting dimensions before making the panel.

Browse push buttons

Practical help from New Zealand

Still stuck? Send us a photo.

Tell us what you’re building and what the circuit is doing. Our small NZ team knows these parts and can help you spot a wiring problem or choose what you need next.

Ask NZN for help Browse more guides