• 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 30 October 2025 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 the button is pressed the LED turns ON.

And when released the LED turns OFF.

It helps beginners to 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.
  • If condition checks if 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:

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

When button is not pressed then pin 2 is LOW.

And LED stays OFF.

When button is pressed then pin 2 gets 5V.

Arduino reads HIGH and LED turns ON.

When button released then pin 2 goes LOW again.

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

LED needs around 20ma, so 220 ohm resistor used here is suitable.

10k resistor is used to keep input low when button not pressed.

How to Build:

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

  • Collect all parts same as circuit diagram
  • Join LED positive leg (anode) to pin 13 using 220 ohm resistor
  • Join LED negative leg (cathode) to ground pin.
  • Connect one side of push button to pin 2 of Arduino
  • Connect other side of push button to 5V pin
  • Put 10k resistor between button pin 2 and ground

Conclusion:

This project if for Push Button LED Circuit using Arduino

It shows how to control an led with a push button using Arduino.

Circuit is simple and helps to learn digital input and output basics easily

References:

ON/OFF system using 2 pushbuttons 2 LEDs

Filed Under: Arduino Projects, LED and Lamps

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

  • Alarm Circuits (35)
  • Amplifier Circuits (67)
  • Arduino Projects (63)
  • Audio Circuits (101)
  • Automobile Circuits (19)
  • Battery Charger Circuits (54)
  • Free Energy (13)
  • Heater and Temperature Controllers (10)
  • High Voltage (1)
  • Indicator Circuits (43)
  • Inverter Circuits (16)
  • LDR Circuits (19)
  • LED and Lamps (127)
  • Meters and Testers (30)
  • Motor Controllers (18)
  • Oscillator Circuits (35)
  • Power Supply Circuits (94)
  • Remote Control Circuits (7)
  • Security and Protection (26)
  • Sensors and Detectors (99)
  • Solar Circuits (23)
  • Timer Circuits (32)
  • Transistor Circuits (65)
  • Transmitter Circuit (14)
  • Tutorials (8)
  • Water Level Controller (4)

Recent Posts

  • Chirping Sound Buzzer Circuit
  • Make Sound with Arduino using Buzzer Circuit
  • Adjust LED Glow with Potentiometer Circuit
  • Arduino Based Control LED Light Circuit with Potentiometer
  • Push Button LED Circuit using Arduino

Recent Comments

  1. Henrik Arboe Jensen on Adjustable Voltage, Current Power Supply Circuit using Transistor 2N3055
  2. Admin-Lavi on FM Transmitter Circuit (100 meters range)
  3. DEVINDER SINGH on FM Transmitter Circuit (100 meters range)
  4. Admin-Lavi on Constant Voltage, Constant Current Battery Charger Circuit
  5. Bill on Constant Voltage, Constant Current Battery Charger Circuit

Copyright © 2025 | New Circuit Ideas