arcade kit/Power/04. Why pressed reads HIGH
Power · 04 of 11

Why pressed reads HIGH

Every button sits between V(MCU) and one input, with a 10 kΩ resistor from the input to ground. Released reads LOW, pressed reads HIGH, and the HIGH is the development board's own supply, which is why no level shifter is needed.

One input, drawn out

Why pressed reads HIGH
Pico · released
Adapter
Button
Input reads
0.0 V
Current while pressed
330 µA
Released, nothing drives the input except the 10 kΩ resistor to ground, so it reads LOW. That resistor is why the code does not need a pull-up, and why an unplugged button reads as released rather than as noise.

All fourteen switch inputs are this circuit. The button's two wires go to V(MCU) and to the input. A 10 kΩ resistor goes from the input to ground.

Released, the button is open and the resistor holds the input at 0 V: LOW. Pressed, the button joins the input straight to V(MCU): HIGH. A resistor that holds a line down like this is called a pull-down.

Where V(MCU) comes from

V(MCU) is header position 3, and the adapter decides what is on it. The ESP32-S3, Pico and Zero 2 W adapters join it to the development board's 3.3 V pin. The Nano adapter joins it to 5 V.

So a pressed button always reads exactly the supply of the board reading it. That is what the listing calls automatic logic-level switching. Nothing on the mainboard switches anything: the HIGH is borrowed from the board that is going to read it, so it cannot be too high for that board.

What it costs

A pressed button passes current from V(MCU) to ground through the resistor: 0.33 mA at 3.3 V, 0.5 mA at 5 V. Holding all fourteen down at once is 7 mA at most, which any development board's supply can spare.

The coin lines are the other way up

COIN and COUNTER are not buttons. They idle HIGH, through a 10 kΩ pull-up to V(MCU), and the acceptor pulls them LOW. The code watches for the opposite edge on those two, and Connect the acceptor shows why.

When it does not work

Every button reads pressed and never releases

Check the switch terminals. An arcade microswitch has three, COM, NO and NC, and the cable belongs on COM and NO. On COM and NC the switch is closed until you press it, so the input reads HIGH at rest and drops when you push.

Should I turn on the pin's internal pull-up?

No. The input already has a 10 kΩ pull-down on the mainboard, and a pull-up fights it: the pin idles at a voltage somewhere in between. The examples set INPUT, INPUT_PULLDOWN or PULL_DOWN, which either agrees with the resistor or leaves it alone.

A button on the Nano reads 5 V

It should. The Nano adapter joins V(MCU) to 5 V because a classic Nano is a 5 V board. On the ESP32-S3, Pico and Zero adapters V(MCU) is the board's 3.3 V pin, and a pressed button reads 3.3 V.

Where this goes next

The input monitor on your board, and what the 30 ms in it is for.

Press a button

Edit this page — content/books/arcade/why-pressed-reads-high.mdx

Community

Questions about this product

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

Ask a question ↗

HotSwap Arcade Kit: Buttons, Joystick and Coin Acceptor for ESP32-S3, Nano, Pico and Zero 2 W

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