Interfacing Push Button and Led with Arduino:

interfacing

Instructions

Objective:

Learn how a push button works as a digital input to control an LED output.

Steps to Perform:

  1. Click "Start Simulation" to power up the Arduino circuit.
  2. Click on the push button to press it.
  3. Observe how the LED turns ON when button is pressed.
  4. Click the button again to release it.
  5. The LED will turn OFF when button is released.

Key Concepts:

  • Digital Input: Button provides HIGH (pressed) or LOW (released) signal
  • Pull-down Resistor: 10kΩ resistor keeps input LOW when button not pressed
  • Digital Output: Arduino writes HIGH/LOW to LED pin to control it
  • digitalRead(): Reads button state from digital pin 2
  • digitalWrite(): Sets LED pin HIGH (ON) or LOW (OFF)
Arduino Code - main.ino