Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO Controlled LED with Pushbutton

View and Edit Project In Cirkit DesignerImage of Arduino UNO Controlled LED with Pushbutton

Circuit Documentation

Summary of the Circuit

This circuit is designed around an Arduino UNO microcontroller and includes a pushbutton and a red two-pin LED. The functionality of the circuit is straightforward: when the pushbutton is pressed, the LED is turned on; when the button is released, the LED turns off. The Arduino UNO is programmed to monitor the state of the pushbutton and control the LED accordingly.

Component List

Arduino UNO

LED: Two Pin (red)

Pushbutton

Wiring Details

Arduino UNO

LED: Two Pin (red)

Pushbutton

Documented Code

#define LED_PIN 8
#define BUTTON_PIN 7

void setup() {
  pinMode(LED_PIN, OUTPUT);
  pinMode(BUTTON_PIN, INPUT);
}

void loop() {
  if (digitalRead(BUTTON_PIN) == HIGH) {
    digitalWrite(LED_PIN, HIGH);
  }
  else {
    digitalWrite(LED_PIN, LOW);
  }
}

File Name: sketch.ino

Description: This Arduino sketch is written to control an LED using a pushbutton. The LED is connected to pin D8, and the pushbutton is connected to pin D7. In the setup() function, the LED pin is set as an output, and the button pin is set as an input. The loop() function continuously checks the state of the button. If the button is pressed (logic HIGH), the LED is turned on; otherwise, the LED is turned off.