Project tutorial
Arduino Basic Project-#6

Arduino Basic Project-#6 © MIT

In this project I am going to discuss about how we can turn on a LED light using Push Button.

  • 3 views
  • 0 comments
  • 0 respects

Components and supplies

Apps and online services

About this project

Introduction

Here I am going to make a project that can turn on a led light using push button by the help of Arduino UNO. That means we can turn ON a led by pressing a push button.

Required Hardware

  • Arduino UNO
  • Breadboard
  • Resistor (1)
  • 5mm LED (1)
  • Push button (1)
  • Jumper wire (5)

Circuit Analysis

1. Arduino Digital Pin 11 to Push button

2. Arduino +5V to Push button

3. Arduino Digital Pin 7 to Led Anode

4. Arduino GND to Led Cathode

Working Principle

This project is all about to turn on a led by pressing push button. So, here when we press the push button Arduino will read the value using Digital pin 11. If button is pressed Arduino will return the button state value as HIGH or 1. After taking the HIGH value for the button it will turn ON the LED light according to our code. Because we write the code as our led light will lit up when we press the push button or when the state of the push button is HIGH or 1.

Push Button

Procedure

Step-1

Complete the circuit according to the Circuit Diagram.

Step-2

Plug in the Arduino with the computer or Laptop using the data cable.

Step-3

Open the Arduino IDE in your PC/Laptop. Then write the code according to the code attachment section or copy paste the code from the attachment section.

Step-4

Test the Project according to the demonstration video.

Demonstration Video

Github Project Link: https://github.com/KAST-Tech/arduino-basics-projects/tree/main/Project-%236

Tinkercad Project Link: https://www.tinkercad.com/things/lcB7RRqpNqp

Code

Arduino-Basic-Project-#6-CodeArduino
// Date: 23/11/21
// Khaled Md. Saifullah
// KastTech

int button = 10;
int led = 11;
int buttonState;

void setup()
{
  pinMode(button, INPUT);
  pinMode(led, OUTPUT);
}

void loop()
{
  buttonState = digitalRead(button);
  if (buttonState == HIGH)
  {
    digitalWrite(led, HIGH);
    delay(2000);
  } 
  else{
    digitalWrite(led, LOW);
  }
}

Custom parts and enclosures

Arduino-Basic-Project-#6-fritzing-file
arduino-basic-project-6-fritzing-file_dklqgy1rhm.fzz

Schematics

Arduino-Basic-Project-#6-Circuit-Diagram
Arduino basic project 6 circuit diagram crcosiokru

Comments

Similar projects you might like

Basic Arduino + JavaScript (Workshop)

by Alex Glow

  • 21,866 views
  • 1 comment
  • 32 respects

Buzzer Alarm System With Help Of Arduino

by ONYX

  • 101,364 views
  • 14 comments
  • 53 respects

Morse Code Communication Using Arduino

Project tutorial by Jalal Mansoori

  • 37,242 views
  • 22 comments
  • 55 respects

Play Polyphonic Tones!

by nathan_ramanathan

  • 20,188 views
  • 19 comments
  • 30 respects

LED Dice

Project showcase by ONYX

  • 15,312 views
  • 1 comment
  • 20 respects

Unravel Preset Piano Easy Arduino (Even a Ghoul Can Make It)

Project in progress by ExeCuteLi

  • 33,189 views
  • 29 comments
  • 56 respects
Add projectSign up / Login