top of page

How to control an LED using Push button and Arduino?

Updated: Mar 25

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
All Hardware components required


  1. Arduino UNO Board


Arduino UNO
Arduino UNO

#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
Jumper Wires


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
LED

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
Breadboard

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
PUSH Button

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.
When the circuit is OFF.

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.
When the circuit is ON.

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:

847 views2 comments
bottom of page