NodeMcu and Buttons

Introduction: NodeMcu and Buttons

About: IoT Developer

Hello Makers,

In this instructable we will see the easiest way to connect the Push Button to NodeMCU.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Push Button Basics

  • The PushButton is a electronic component that connects two points in a circuit when you press it. We use these little buttons on everything!
  • These Miniature Single Pole Single Throw (SPST) switches are breadboard friendly. Perfect as a tactile reset switch. These buttons are rated up to 50mA.

Step 2: How Push Button Work's

  • When the pushbutton is open (unpressed) there is no connection between the two legs of the pushbutton, so the pin is connected to 3.3v (through the pull-up resistor) and we read a HIGH.
  • When the pushbutton is closed (pressed), there is a connection between its two legs, connecting the pin to the ground, so that we read a LOW.

Step 3: Circuit

  • Download the "Button_NodeMCU.ino" file and open it up in the Arduino IDE.
  • Then Create a new sketch and paste the code below in the Arduino IDE and hit Upload. You can tinker with it if you like based on the application, or just use it as it is.

Be the First to Share


    • Trash to Treasure Contest

      Trash to Treasure Contest
    • Raspberry Pi Contest 2020

      Raspberry Pi Contest 2020
    • Wearables Contest

      Wearables Contest