latching button/Why on reads HIGH/04. Which supply to use
Why on reads HIGH · 04 of 9

Which supply to use

When the switch is on, SIGNAL is VCC, so the voltage you feed the block is the voltage your input pin sees. Feed it your board's own logic supply: 3V3 beside an ESP32, an ESP32-S3 or a Pico, 5V on an Uno.

SIGNAL is VCC

Which supply to use
Your board
VCC wired to
Wire VCC to
3V3
SIGNAL when on
3.3 V
LED
1.3 mA
Right. SIGNAL is 3.3 V when the switch is on, the ESP32-S3's own logic voltage, so it reads HIGH with all the margin there is and never goes above what the pin is rated for. The LED gets about 1.3 mA.

Pick your board, then try both supplies. With the switch on, SIGNAL is joined to VCC through a closed contact, so it carries whatever VCC carries. The block has no regulator and no level shifting. Choosing VCC is choosing the voltage your input pin will see.

3V3 beside a 3.3 V board

An ESP32, an ESP32-S3 and a Pico all run their pins at 3.3 V, and none of them is rated for much above it: each chip's datasheet allows only a few tenths of a volt over its own supply. Feed the block from 5V and every time the switch is on, 5 V sits on the pin.

It will read HIGH and it will seem to work, which is what makes it expensive. The damage builds up inside the pin and does not announce itself. The fix costs nothing: wire VCC to the board's 3V3 pin. The input reads 3.3 V as HIGH with room to spare, and the LED still lights, a little dimmer.

5V on an Uno

An Uno runs its pins at 5 V, so 5V is right. 3V3 also works, narrowly: the Uno's chip, the ATmega328P, guarantees to read anything above 0.6 × 5 V = 3.0 V as HIGH, and 3.3 V clears that by 0.3 V. There is no reason to take the narrow option.

Not wired at all

The one wiring that never works is no VCC. The switch closes onto a pin that carries nothing, the pull-down holds SIGNAL at 0 V, and it reads LOW in both positions. The LED stays dark too, because it is fed through the switch. If the block seems completely dead, VCC is the first wire to look at.

The TK01 XL LED has no VCC pin, and it is easy to carry that habit over. This block needs all three: GND, VCC and SIGNAL.

When it does not work

I ran it from 5V on my ESP32 and it worked.

It will seem to. The pin reads 5 V as HIGH like any other HIGH, so nothing looks wrong. But the chip is rated for no more than a few tenths of a volt above its own 3.3 V supply, and the harm to the pin is not visible. Move VCC to 3V3 and carry on.

My Pico has two supply pins. Which one?

The one marked 3V3, the Pico's 3.3 V output. Not VBUS or VSYS, which carry the USB or battery voltage, around 5 V from USB. The Pico's pins are 3.3 V pins and are not rated for 5 V.

Can I use 3V3 on an Uno?

It works, narrowly. The Uno's chip is guaranteed to read anything above 3.0 V as HIGH, so 3.3 V clears it by 0.3 V, and the LED drops to well under a milliamp. Nothing is harmed. There is no reason to choose it when 5V is on the next pin.

What if VCC is not wired at all?

The switch then connects SIGNAL to a pin that carries nothing, the pull-down holds it at 0 V, and it reads LOW in both positions. The LED stays dark because it is powered through the switch. It looks exactly like a broken switch.

Where this goes next

Three wires and a sketch that prints the switch's position twice a second.

The first read

Edit this page — content/books/latching-button/which-supply-to-use.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