What is on the board · 02 of 9

How it latches

Press it and it stays on. Press it again and it goes off. A latch inside the switch holds the contact where the last press left it, so the state lives in the switch, not in your sketch.

Press on, press off

How it latches
Presses
0
Switch
off
SIGNAL
LOW
Off. The contact is open, so nothing connects VCC to SIGNAL, and the board's pull-down holds SIGNAL at 0 V. Your sketch reads LOW and the LED is dark. Run it.

The switch has two pins and one contact between them. On its own a contact like that would close while you press and open when you let go, which is what a push button does. This one has a latch: every full press turns it a step, and alternate steps hold the contact closed after you let go.

So one press turns it on and it stays on. The next press turns it off and it stays off. The back of the board says exactly that: PRESS TO TURN ON, PRESS AGAIN TO TURN OFF.

The figure draws the latch as a wheel. That is a picture of what it does, not of how this switch is built inside: the switch's drawing shows only the outside. It also does not say at which point of the stroke the contact changes. For a sketch it does not matter. What your board sees is the level before the press and the level after it.

A firm press

The switch is a 12 × 12 mm body, 4.5 mm tall, with a 5.4 mm round button, and on the board its top stands 9 mm above the board. Its drawing gives the force to operate it as 700 ± 100 gf. That is roughly the weight of 0.7 kg resting on a fingertip: a deliberate press, not a tap.

The same drawing rates the contact for 30 V and 1 A DC and at least 50,000 cycles. On this board the contact carries a few milliamps at 3.3 or 5 V, a very small fraction of that rating.

Read the LED, not the button

The drawing gives the button one height, so don't expect to see whether it is on from the button itself. The red LED under the switch is wired to SIGNAL, so it lights exactly when the switch is on. It is the switch's own indicator and it works with no sketch at all, as long as VCC and GND are connected.

Against the push button

The TK04 push button is the block with a switch that springs back. It reports a press only while a finger is on it, so a sketch has to catch the press and remember it. This one does the remembering itself. That makes it the right block for a choice that should stay made, such as a mode, and the wrong one for anything you press often.

When it does not work

It takes a lot of force to press.

It does, by design. The switch's drawing gives an operating force of 700 ± 100 gf, about the weight of 0.7 kg on a fingertip. It is meant to be pressed on purpose and not knocked by accident. Press it straight down in the middle of the button, with the block held flat.

I can't tell from the button whether it is on or off.

The switch's drawing gives the button a single height, so do not rely on seeing it sit lower. Look at the red LED under the switch: it is wired to SIGNAL, so it is lit exactly when the switch is on, as long as VCC is connected.

A half-press does nothing.

That is normal. The latch only changes over when the button is pushed far enough, so press it all the way down and let go. If a full press does not change the LED, check that VCC is wired: the LED is powered through the switch.

How long will it last?

The switch's drawing rates it for at least 50,000 cycles. That is a lot of mode changes, and not many seconds of a game played by pressing it. For something you press all day, the TK04 push button is the better block.

Where this goes next

What holds SIGNAL at 0 V when the switch is off, and why on reads HIGH.

The pull-down and the light

Edit this page — content/books/latching-button/how-it-latches.mdx

Community

Questions about this product

See what other owners have asked, and read their solutions.

Ask a question ↗

Latching Button

Loading discussions…

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Modules and blocks on the forum