Arduino Simple Debounce

by iwoox in Circuits > Arduino

4989 Views, 6 Favorites, 0 Comments

Arduino Simple Debounce

IMG_3841.JPG

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

Video:

https://youtu.be/Iw6rA0cduWg

If you have any questions or problems you can contact me on my mail:iwx.production@gmail.com

So let's begin.

Materials

IMG_3844.JPG

You need:

-2 push buttons

-Arduino Mega 2560 or Uno

-Breadboard

-Some wires

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

-two 10k ohm resistors

-and of course computer.

Watch a Video

You can also see how this project is working

https://www.youtube.com/watch?v=Iw6rA0cduWg

Wiring

debounce.jpg
IMG_3842.JPG
IMG_3843.JPG

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)

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.