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
- 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.
- To become familiar with the functionality of buttons and LEDs.
- To learn how to program the button input in Arduino to control an output.
Methodology
- Arrange the components on the breadboard.
- 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
Arduino Project 1: Button State Detection
In this beginner-level Arduino project, we will utilize a simple push button to interact with the Arduino UNO board. The goal is to detect whether the button is pressed or not, with the state displayed on the Serial Monitor. This project serves as an introduction to reading digital input signals using an Arduino and understanding the basic concepts of input-output mechanisms in electronics.
Read more →How to Build and Publish NPM Package step-by-step.
Building and publishing an NPM package is a great way to share your code with others. Here's a step-by-step guide on how to create, build, and publish your package.
Read more →How to Publish Package to NPM – Step by Step
Publishing your package to NPM (Node Package Manager) allows you to share your code with the developer community. It’s a simple process that can take your open-source contribution to the next level. This guide will walk you through publishing your first NPM package.
Read more →