• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Circuit Ideas for You

Get free circuit ideas online.

  • Home
  • Privacy Policy
  • About
Home » Push Button LED Circuit using Arduino

Push Button LED Circuit using Arduino

Last updated on 29 June 2026 by Admin-Lavi Leave a Comment

This simple Push Button LED Circuit using Arduino shows how to turn an LED ON and OFF using a push button switch.

When we press the button, the LED turns ON, and when you release it, the LED turns OFF; furthermore, this project helps beginners learn about digital input and output in Arduino.

Arduino Coding:

int led = 13;
int button = 2;
int buttonstate = 0;

void setup() {
pinMode(led, OUTPUT);
pinMode(button, INPUT);
}

void loop() {
buttonstate = digitalRead(button);
if (buttonstate == HIGH) {
digitalWrite(led, HIGH);
} else {
digitalWrite(led, LOW);
}
}

Code Explanation:

  • Pinmode sets LED as output and button as input.
  • Digitalread reads button state.
  • The if condition checks whether the button is pressed (HIGH).
  • if pressed LED turns ON using digitalwrite high.
  • Else, LED turns OFF using digitalwrite low.

Circuit Working:

Push Button LED Circuit Diagram using Arduino

Parts List:

ComponentsValuesQuantity
Resistors220Ω 1/4 watt1
10k 1/4 watt1
SemiconductorsArduino UNO Board1
LED 5mm any color1
Push Button Switch1

When we do not press the button, pin 2 stays LOW and the LED remains OFF; when we press the button, it supplies 5 V to pin 2.

After that, Arduino reads HIGH and LED turns ON and when button released then pin 2 goes LOW again and and LED turns OFF.

Formula:

Below is the formula for Push Button LED Circuit:

Current through LED = V / R = 5V / 220 ohm = 0.022a = 22ma

The circuit uses a 220Ω resistor for the LED, which requires about 20ma of current and additionally, the circuit uses a 10kΩ resistor to keep the input low when no one presses the button.

How to Build:

To build a Push Button LED Circuit using Arduino follow the below steps for connection:

  • First, collect all parts same as circuit diagram
  • Next, join LED positive leg (anode) to pin 13 using 220 ohm resistor and join LED negative leg (cathode) to ground pin.
  • Then connect one side of push button to pin 2 of Arduino and connect other side of push button to 5V pin
  • Now put 10k resistor between button pin 2 and ground

Conclusion:

Overall, this project if for Push Button LED Circuit using Arduino, as it shows how to control an led with a push button using Arduino; also circuit is simple and helps to learn digital input and output basics easily

Filed Under: Arduino Projects, LED and Lamps, Mini Projects

About Admin-Lavi

Lavi is a B.Tech electronics engineer with a passion for designing new electronic circuits. Do you have questions regarding the circuit diagrams presented on this blog? Feel free to comment and solve your queries with quick replies

Previous Post: « Arduino Based Smart Traffic Light Circuit for Beginners
Next Post: Arduino Based Control LED Light Circuit with Potentiometer »

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar




Categories

  • 555 Timer Projects (137)
  • Alarm Circuits (81)
  • Amplifier Circuits (94)
  • Arduino Projects (103)
  • Audio Circuits (189)
  • Automation Circuits (150)
  • Automobile Circuits (40)
  • Battery Charger Circuits (88)
  • DIY Projects (435)
  • Free Energy (12)
  • Heater and Temperature Controllers (32)
  • High Voltage (24)
  • Hobby Circuits (241)
  • Indicator Circuits (63)
  • Inverter Circuits (17)
  • IoT projects (12)
  • LDR Circuits (47)
  • LED and Lamps (201)
  • Meters and Testers (44)
  • Mini Projects (390)
  • Motor Controllers (26)
  • Oscillator Circuits (70)
  • Power Supply Circuits (244)
  • Radio Frequency (8)
  • Remote Control Circuits (12)
  • Renewable energy (20)
  • Security and Protection (128)
  • Sensors and Detectors (236)
  • Solar Circuits (31)
  • Timer Circuits (63)
  • Transistor Circuits (178)
  • Transmitter Circuit (19)
  • Tutorials (33)
  • Voltage Regulator (55)
  • Water Level Controller (10)

Recent Posts

  • Low Current Controlled Battery Charger Circuit using LM723 IC
  • 741 Op-Amp Treble Booster Circuit
  • Simple Diode and Transistor Based Audio Limiter Circuit
  • Simple 500mW Speaker Driver Circuit
  • Easy DIY LM386 Audio Amplifier Circuit

Recent Comments

  1. Admin-Lavi on High Voltage Fence Charger Circuit
  2. etere on High Voltage Fence Charger Circuit
  3. Admin-Lavi on High Voltage Fence Charger Circuit
  4. egidio grzinic on High Voltage Fence Charger Circuit
  5. Logic OR Gate Circuit using Transistors - Circuit Ideas for You on Automatic Street Light Circuit using LDR

Copyright © 2026 | New Circuit Ideas