We all know that #LED can be controlled by various methods, based on Light intensity readings from LDR, based on readings from Motion sensors, controlling through Telegram App, etc. For all this, we need to understand the basics of controlling an LED through a switch or a Push Button.
This article describes how to control an LED using a #Push button and Arduino code. So let's get started, first with the Hardware Components required.
Hardware requirements
The image here shows all the components required to build the circuit.
![All Hardware components required](https://static.wixstatic.com/media/59035a_c1bd0f6f11a14d1e9d4003252c506164~mv2.jpg/v1/fill/w_147,h_66,al_c,q_80,usm_0.66_1.00_0.01,blur_2,enc_auto/59035a_c1bd0f6f11a14d1e9d4003252c506164~mv2.jpg)
Arduino UNO Board
![Arduino UNO](https://static.wixstatic.com/media/59035a_2e0c5fb3a1d94efa9435cf5075502037~mv2.jpeg/v1/fill/w_147,h_127,al_c,q_80,usm_0.66_1.00_0.01,blur_2,enc_auto/59035a_2e0c5fb3a1d94efa9435cf5075502037~mv2.jpeg)
#Arduino board is a microcontroller that is used to accept inputs from sensors connected and provide an output action on the desired device connected to it. The sensor inputs can be from light-detecting sensors, motion sensors (Ultrasonic or IR), temperature sensors, etc. The output function done on the devices can be turning on an LED, the sound of a buzzer, or a Serial monitor display.
Buy Arduino UNO from here.
2. Jumper Wires
![Jumper Wires](https://static.wixstatic.com/media/a27d24_69a93ba585fb4bf5abf1a2a60c62992c~mv2.jpg/v1/fill/w_142,h_107,al_c,q_80,usm_0.66_1.00_0.01,blur_2,enc_auto/a27d24_69a93ba585fb4bf5abf1a2a60c62992c~mv2.jpg)
These are the main components that are used to establish the connections between different devices of the circuit.
Buy Jumper Wires from here.
3. LED
![LED](https://static.wixstatic.com/media/a27d24_d0982b04e8974f24a94250a8f945ef7f~mv2.jpg/v1/fill/w_147,h_63,al_c,q_80,usm_0.66_1.00_0.01,blur_2,enc_auto/a27d24_d0982b04e8974f24a94250a8f945ef7f~mv2.jpg)
Light Emitting Diode is a commonly used light source. It is a semiconductor. LED emits light when current flows through it.
Buy LED from here.
4. Breadboard
![Breadboard](https://static.wixstatic.com/media/a27d24_95f41a5dbd79493fb3e7ad441d50a9af~mv2.jpg/v1/fill/w_147,h_73,al_c,q_80,usm_0.66_1.00_0.01,blur_2,enc_auto/a27d24_95f41a5dbd79493fb3e7ad441d50a9af~mv2.jpg)
The breadboard is the basic component of any circuit building process. All components, be it input sensors or output display devices are connected to the #Arduino or any other microcontrollers using wired connections through a breadboard. The holes in the breadboard are in series. There are various sizes like full-sized, half-sized, and mini breadboards.
Buy Breadboard from here.
5. Push-button.
![PUSH Button](https://static.wixstatic.com/media/10da4b_6aed12e1e66041fe98698f0c95a359ee~mv2.png/v1/fill/w_60,h_60,al_c,q_85,usm_0.66_1.00_0.01,blur_2,enc_auto/10da4b_6aed12e1e66041fe98698f0c95a359ee~mv2.png)
PUSH Buttons are simple devices used for switching control. It is easy to use and starts or stops the function when connected in a #circuit.
Buy Pushbuttons from here.
Circuit Connections
The circuit connection, on the whole, can be divided into two parts.
First the connection between the Push Button and the Arduino board. One terminal of the Pushbutton is connected to PIN 2 of the Arduino board and the other terminal can be connected to the Ground (GND) pin of the UNO board or to the common Ground in the Breadboard.
Secondly, the Connections between the LED and the Arduino board. The positive terminal of the LED is connected to PIN 12 of the UNO board and the negative terminal is connected directly to the Ground (GND) of the board or to the common ground in the breadboard.
Finally, the Arduino Board is interfaced with the system in which the #IDE is present and the code is written.
Code
Working
The working of this circuit is simple. The LED receives the Supply voltage from the Arduino board. Initially, LED is OFF and is controlled using a Switch/Pushbutton.
![When the circuit is OFF.](https://static.wixstatic.com/media/59035a_e1cf709a514747bab08625886be314d4~mv2.jpg/v1/fill/w_147,h_66,al_c,q_80,usm_0.66_1.00_0.01,blur_2,enc_auto/59035a_e1cf709a514747bab08625886be314d4~mv2.jpg)
The Pushbutton is the element that establishes the connection between the LED and Power supply through the Arduino board indirectly. That is, on pressing the Pushbutton, the switch is closed, the voltage (5V) is supplied, and the LED is switched ON. On taking the hand off the Pushbutton, the LED is OFF. The switch is open. Hence the switching ON and OFF of the LED can be controlled using Pushbutton and Arduino.
![When the circuit is ON.](https://static.wixstatic.com/media/59035a_7df6e64fb5104428849e742291ea3ec7~mv2.jpg/v1/fill/w_147,h_66,al_c,q_80,usm_0.66_1.00_0.01,blur_2,enc_auto/59035a_7df6e64fb5104428849e742291ea3ec7~mv2.jpg)
Check the Project working video here - How to control an LED using a Push button and Arduino? | LED Interfacing using Arduino & Push Button
Project Video By - Abhishek Goud
Take the first step today to design your circuit, learn to control the LED using #Pushbutton. With the help of this article and circuit, build your own circuit, develop it further with different and creative #code combinations.
SEE ALSO: