tactile button switch
Signal Type:
Binary (on/off)
tactile button switch, momentary, breadboard compatible
Jump to section:
tactile button switch
About

Push-button switches are the classic momentary switch, as they only remain in their "on" state as long as they’re being actuated (pressed, held, etc). (adapted from Sparkfun)

When pressed, the tactile button switches connect two points in a circuit by allowing electricity to flow through. Tactile Button Switches have four pins, which can be a little confusing, but because pins B and C are connected together as well as A and D, there are only really two electrical connections. (adapted from Adafruit)

Tactile Button Switch Interior
The interior wiring of a Tactile Button Switch | Image from Adafruit

When wiring a breadboard, the convention is for the positive and negative power lines to lie on opposite sides of the board. Therefore, the standard set-up is to place the push-button running across the middle of the breadboard, and connect the electrical leads to A and C, or B and D.

Button wired across the valley of the breadboard
Button wired across the valley of the breadboard
Getting started

The below code and schematic sets up a circuit where pressing the button turns the LED on, and leaving the button off turns the LED off.

schematic for code below
schematic for code below
const int LEDPIN = 5;
const int BUTTONPIN = 11;

void setup()
{
  pinMode(BUTTONPIN, INPUT);
  pinMode(LEDPIN, OUTPUT);
}

void loop()
{
  if (digitalRead(BUTTONPIN) == LOW)
  {
    digitalWrite(LEDPIN, LOW);
  }
  else
  {
    digitalWrite(LEDPIN, HIGH);
  }
}
Resources
  • https://learn.adafruit.com/adafruit-arduino-lesson-6-digital-inputs?view=all
What we stock
Part Location On floor Backstock
0344 switch, pushbutton, latching, DPDT (double-pole double-throw), 6-pin, breadboard compatible Input: Buttons & Switches 125 100
0346 switch, pushbutton, momentary, DPDT (double-pole double-throw), 6-pin, breadboard compatible Input: Buttons & Switches 0 0
0355 pushbutton switch, momentary, tactile, SPST, normally open, long straight legs for easy use in solderless breadboard, 50mA max current Input: Buttons & Switches 300 0
0356 tactile button switch, momentary, breadboard compatible Input: Buttons & Switches 500 650
0358 pushbutton switch, momentary, normally open, red, panel mount Input: Buttons & Switches 23 65
0360 pushbutton switch, momentary, SPST, normally open, 1A, panel mount Input: Buttons & Switches 0 0
Related parts