Nov 13, 2024

Arduino Project 2: Controlling an LED with a Button

Introduction

In this experiment, we use a push button as an input to control an LED as the output. With the button, we can determine when the LED should emit light and when it should turn off.

Materials Needed

  • Arduino UNO
  • Breadboard
  • Wires
  • 10K Resistor (1 piece)
  • 1K Resistor (1 piece)
  • Button (1 piece)
  • LED (1 piece)

Picture

Objectives

  1. To light up an LED using a button. The LED will illuminate when the button is pressed and will turn off when the button is released.
  2. To become familiar with the functionality of buttons and LEDs.
  3. To learn how to program the button input in Arduino to control an output.

Methodology

  1. Arrange the components on the breadboard.
  2. Follow the circuit based on the fritzing layout diagram.

Conclusion

The push button does not have a direct connection between its two pins. The pin is connected to 5 volts through a resistor to read a HIGH state. When the button is pressed, it establishes a connection between its two pins, linking to the ground to read a LOW state.

The LED (Light-Emitting Diode) is a small light source that can be turned on or off using the button. In this experiment, the button serves as an input to control the output, which is the LED's light. The brightness of the LED indicates the output state, making it a practical demonstration of how input devices like buttons can be used to manage outputs in an Arduino setup.

OTHER POSTS

Use npm scripts to Simplify Daily Tasks

Running long terminal commands over and over? Automate them with simple npm scripts in your package.json.

Read more →

Learn Faster with Browser DevTools Tricks

Your browser is more powerful than you think. Chrome/Edge/Firefox DevTools can save you tons of time debugging and experimenting directly in the browser.

Read more →

Fix "Email in this signature doesn't match the committer email" on GitHub

Pushed a signed GPG commit only to get a warning that the signature is unverified because of an email mismatch? Here is how to sync your GPG identity with Git.

Read more →

How to Set Up Verified GPG Commit Signing on GitHub

Tired of seeing the "Unverified" badge on your GitHub commits? Setting up a GPG key signs your commits cryptographically, proving to your team (and future employers) that the code actually came from you.

Read more →