Controlling Motor || LED Blinking using Button with Arduino||TinkerCad Simulation 



Description:
                       This Experiment is based on the different component integrated to blink the LED using Button. we also look on how voltage flow from the digital pins and use voltmeter to measure the flowing current through the digital pin as the below picture described. 


Peepgram fig 1

 Circuit of the Experiment :
                        Below the Circuit of the Experiment perform in this very lecture. we have connected different components using Red & Black wires for instant Red is given to the Power wires and Black given to the Ground Wires. LED is used is Green light Button is also connected. Pins we have used for input we configure digital pin 2 and for output we have configured digital pin 13 as shown below you can see the Resistance connected to the ground of the button it called Push Down Resistance which save our pins form over flow in a simple words:


Peepgram fig 2

Voltmeter connected to check our output of the button how much current from when i press the button:

Peepgram fig 3
 This is the testing of the circuit we i press button current start following from the circuit and it make digital pin 2 High so we read from the pin 2 state using digitalRead function if its in HIGH state we make HIGH pin 13 and if not we make pin 13 LOW:
Peepgram fig 4
 After the button is pressed as you can see the flowing current from the button is 5v as the real input of the digital pin:

Peepgram fig 5
Code for the Experiment circuit:

int state=0;
void setup()
{
  pinMode(13, OUTPUT);
  pinMode(2,INPUT);
}

void loop()
{
   state=digitalRead(2);
  if(state==HIGH)
  {
  digitalWrite(13, HIGH);
 
  }
  else
  {
  digitalWrite(13, LOW);
 
  }
}

click for more help:

                               click for more 









Post a Comment

Previous Post Next Post