Introduction: Arduino Simple Debounce

Picture of Arduino Simple Debounce

This instructable is about how to make easy debounce with 2 push buttons.All you need is basic knowledge in electronics and arduino programming.


If you have any questions or problems you can contact me on my

So let's begin.

Step 1: Materials

Picture of Materials

Everything you need for this project you can get on ebay or amazon.

You need:

-2 push buttons

-Arduino Mega 2560 or Uno


-Some wires

-2 LED´s(green and red) if you want you can choose other colors

-two 10k ohm resistors

-and of course computer.

Step 2: Watch a Video

You can also see how this project is working

Step 3: Wiring

Picture of Wiring

This project is very easy to connect because there isnt a lot of electronics components.

-push button (ON) is connected to digital pin 2

-push button (OFF) is connected to digital pin 3

-green LED is connected to digital pin 5

-red LED is connected to digital pin 4

You just need to be careful that you connect 10k ohm resistors between GND and push button pin.(look circuit picture)

Step 4: Code

This code is very easy to make and understand.

It is working like that.

-When you hit ON push button, variable x state change to 1, stays there until you hit OFF button and green LED turn on.

-When you hit OFF push button, variable x state change back to 0, stays there until you hit ON button again and red LED turn on.

Just download it, plug in Arduino and upload code.


Jesper K.P (author)2016-07-21

Not a de-bounced button, more similar to making a set/reset PAIR of buttons.
Do not use this as a source for learning about de-bouncing.

About This Instructable




More by iwoox:Controlling DC motors with Arduino and L293Make your own development board with microcontrollerArduino simple debounce
Add instructable to: