TK04DIGITALbeginner

Push Button

A 12 mm momentary push button with its 10 kΩ pull-down and a red press light already fitted: SIGNAL reads HIGH while the button is down. The first input in the kit, and the module that teaches debouncing.

Comes in this kit — not sold separately

Specifications

TypeMomentary push button, normally open, active high
Switch12 × 12 mm SMD tactile switch (USAKRO UK-B0262), 0.3 mm travel, 12 mm blue cap; 14.35 mm tall overall
Pull-down10 kΩ from SIGNAL to GND, on the board. Released reads LOW, pressed reads HIGH
Press lightRed LED with a 1 kΩ resistor on SIGNAL. Lights while the button is down, about 3 mA from 5 V
Supply3.3 V or 5 V on VCC. Pressed, SIGNAL is at VCC, so use 3V3 beside an ESP32, ESP32-S3 or Pico and 5V beside an Uno
Pins to wire3 of the 4: GND, VCC and SIGNAL. NC is connected to nothing on the board
Header4-pin right-angle male, 2.54 mm pitch: GND, VCC, NC, SIGNAL, with GND on the square pad
Switch rating12 V DC, 50 mA; contact resistance 100 mΩ max; rated for 70 000 to 100 000 presses depending on force
Board22.4 × 30.4 mm, two 4.8 mm mounting holes 16 mm apart
In the box1 × TK04 block. It also ships inside the TinkerBlock kits

What it is

A 12 mm tactile switch, a 10 kΩ pull-down resistor, and a red LED that lights while the button is down. Released, the pull-down holds SIGNAL at 0 V and your board reads LOW. Pressed, the switch connects SIGNAL to VCC and your board reads HIGH. The front of the board says ACTIVE HIGH, and the back says WORKS ONLY WHILE PRESSED: let go and it is LOW again.

The TK04 at an angle: a black board with a gold-plated border, a tall round blue cap on a square black switch near the top, two small resistors and a tiny LED in front of it, two big mounting holes, lonely binary along the left edge, a boxed ACTIVE HIGH along the right, and a right-angle header whose four pins point out past the bottom edge.
The TK04. The header is right-angled, so the board lies flat.

Reading it is one call to digitalRead. Reading it correctly takes one more idea. A mechanical contact does not close once: it bounces, making and breaking a few times in the first milliseconds of a press, and a sketch reading the pin in a fast loop sees every one. A counter wired naively to this button goes up by two or three now and then, which is exactly the kind of bug that looks like bad hardware. The handbook below fixes it in a few lines.

VCC is the voltage your pin sees

The switch joins SIGNAL straight to VCC, so whatever is on VCC is what your pin receives when the button is down:

Your boardVCC toPressed, SIGNAL isPress light
Arduino Uno5V5 Vabout 3 mA, bright
ESP32, ESP32-S3, Pico3V33.3 Vabout 1.3 mA, a little dimmer

Never 5V beside a 3.3 V board. With VCC unconnected, the button does nothing and the light never comes on. The LED currents are worked out from a red LED's typical forward voltage, about 2.0 V, rather than measured.

Which pin is which

Button side up, header at the bottom, reading left to right:

GNDto your board's GNDthe square pad: count from here
VCCto 3V3 or 5Vyour board's logic voltage
NCnothingnot connected on the board
SIGNALto a digital inputHIGH while pressed

The back prints TK04 PUSH BUTTON and WORKS ONLY WHILE PRESSED instead of pin names. Turned over, the square pad is on the right, and it is still GND.

Wiring, in three lines

  1. GND to your board's GND.
  2. VCC to 5V on an Uno, 3V3 on an ESP32, ESP32-S3 or Pico.
  3. SIGNAL to a digital pin: D2 on an Uno, GPIO 25 on an ESP32, GPIO 4 on an ESP32-S3, GP15 on a Pico.

Leave NC unconnected. Set the pin to INPUT, not INPUT_PULLUP: the pull-down is already on the board.

Example

// The GPIO number SIGNAL is wired to.
// Uno: 2. ESP32: 25. ESP32-S3: 4. Pico: 15.
const int BUTTON_PIN = 4;

void setup() {
  Serial.begin(115200);
  pinMode(BUTTON_PIN, INPUT);   // the block has its own pull-down
}

void loop() {
  if (digitalRead(BUTTON_PIN) == HIGH) {   // HIGH is pressed
    Serial.println("pressed");
  } else {
    Serial.println("released");
  }
  delay(200);
}
The push button on an Arduino Uno

Where to start

The handbook below is nine short articles, each with a working figure. The first read is the whole build in three wires and a few lines.

If your counter goes up by more than one per press, read why one press counts as several and then debouncing with millis().

And before plugging it into an ESP32, VCC sets the voltage is the one page that protects the board.

When it doesn’t work

Does it read HIGH or LOW when pressed?
HIGH. The board has a 10 kΩ pull-down, not a pull-up: released, SIGNAL sits at 0 V and reads LOW; pressed, the switch connects it to VCC and it reads HIGH. The front of the board says ACTIVE HIGH. Sketches written for pull-up button boards test for LOW and get this block backwards.
Should VCC go to 3V3 or 5V?
To your board's logic voltage: 3V3 on an ESP32, ESP32-S3 or Pico, 5V on an Uno. Pressed, the switch connects SIGNAL straight to VCC, so the voltage on VCC is the voltage your pin receives. 5V on a 3.3 V board's pin is past its rating on every press.
INPUT or INPUT_PULLUP?
INPUT. The block brings its own pull-down. The chip's internal pull-up would fight it and leave the released level somewhere around a volt, which no datasheet promises to read as LOW. In MicroPython, Pin(pin, Pin.IN) with no pull argument.
One press counts as several.
Contact bounce, and it is not a fault: the metal contacts make and break a few times in the first few milliseconds of every press. Believe a change only once the pin has held still for about 20 ms. The handbook's debounce sketch does it with millis() and no library.
It never reads pressed.
Press and look at the red LED. If it stays dark, VCC or GND is not connected, or the cable is one pin over. If it lights, the block is fine and SIGNAL is on a different pin from the one your sketch reads.
It reads presses nobody made.
SIGNAL is not reaching your pin, so the pin is floating: check the SIGNAL wire. Then check the sketch uses INPUT, not INPUT_PULLUP.

The push button handbook

9 articles · about 40 minutes

This page is the reference: what the part is, what it is made of, and the questions people arrive already asking. The handbook is the walk — the same part in the order somebody actually meets it.

What is on the board

2 articles

Four pins of which three are wired, a 12 mm switch, and the one rule a beginner has to learn before plugging it in: whatever goes on VCC is what your pin sees when the button is down.

How a press becomes HIGH

2 articles

Why an input with nothing on it reads nonsense, what the 10 kΩ pull-down does about it, and the red light that tells you a press arrived before any code runs.

Reading it

2 articles

Three wires and a sketch that prints what the pin says, then a counter that goes up by three when you pressed once, and the reason it does.

One press, one action

3 articles

Debouncing with millis(), a button that switches something on and off, and the short list of reasons a press does nothing.

Lessons using TK04

Each one is a working build, not a snippet.

Every project using this

ProjectBoardsTime
43. Project: EEPROM SettingsGuideadvancedArduino45 min
5. Serial Monitor DebuggingGuidebeginnerArduino20 min

Edit this page — content/modules/push-button.mdx

Community

Questions about this product

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

Ask a question ↗

Push 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