Code Monkey home page Code Monkey logo

-interfacing-digital-input-sensor-with-arduino-push-button-'s Introduction

INTERFACING DIGITAL INPUT SENSOR WITH ARDUINO PUSH BUTTON

DATE : 23.2.24

NAME : SACHIN.C

ROLLNUMBER : 22001187

DEPARTMENT : AI-DS

AIM:

To interface a digital input (push button) and blink and LED upon activation.

COMPONENTS REQUIRED:

  1. 1 KΩ Resistor
  2. Arduino Uno
  3. Bread board
  4. USB Interfacing cable
  5. Jumper wires
  6. LED of choice

THEORY :

Arduino UNO The Uno is a microcontroller board based on the ATmega328P. It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header and a reset button. It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get started. Technical specifications of Arduino UNO : Microcontroller ATmega168/328 Microcontroller ATmega168/328 Operating Voltage 5V Input Voltage (recommended) 7-12V Input Voltage (limits) 6-20V Digital I/O Pins 14 (of which 6 provide PWM output) Analog Input Pins 6 DC Current per I/O Pin 40 mA DC Current for 3.3V Pin 50 mA Flash Memory 16 KB (ATmega168) or 32 KB (ATmega328) of which 2 KB used by boot loader SRAM 1 KB (ATmega168) or 2 KB (ATmega328) EEPROM 512 bytes (ATmega168) or 1 KB (ATmega328) Clock Speed 16 MHz

PIN DIAGRAM FOR ATMEGA 328

image

FIGURE-01 image

FIGURE-02

PROCEDURE

Open tinker cad account

  1. Select Arduino uno , bread board , digital input and digital output
  2. Connect the circuit as given in the figure
  3. Develop the program and compile it for any errors
  4. .Execute the program
  5. Check the simulation

CIRCUIT DIAGRAM

image

FIGURE -03

PROGRAM

int led=4;
int pushbutton=3;
void setup()
{
pinMode(led,OUTPUT);
pinMode(pushbutton,INPUT);
}
void loop()
{
int pb;
pb=digitalRead(pushbutton);
if(pb==HIGH)
{
digitalWrite(led, HIGH);
delay(500);
digitalWrite(led,LOW);
delay(500);
}
else
{
delay(500);
digitalWrite(led,LOW);
}
}

OUTPUT OF SIMULATION :

image

image

RESULT :

Program for interfacing digital input sensor with arduino push buttonis successfully implemented.

-interfacing-digital-input-sensor-with-arduino-push-button-'s People

Contributors

vasanthkumarch avatar sachin-vlr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.