Arduino's most important input-output pins are general-purpose input-output pins these are the things that you see on the headers on both sides of the headers that allow you to interact with an external device like LEDs and buttons

in this article, we are going to talk about the digital input-output pins. the long header contains 14 digital pins you can see them here number from 0 to 13 some of them have got a wiggly line here that, as a sign(~).  All of these pins are numbered and they are equally in functionality.

what this pin allows you to do is to read or write a digital signal

What is a digital signal?

 A computer device is a digital device and that means that a computer can understand only two words essentially, one and zero. it's a binary device. the real world of course is not a binary place, it's an analog place.
So that you can describe many more words for many more values that can describe things like how bright a light is. it doesn't normally say that light is turned on and off but if it has a dimmer, for example, it could have much different value in between if it could be very bright or not very bright or turned at a low setting and so on.

As far as a computer is concerned of course there are only two possible values 1 and 0 as far as, human are concerned a one has to represent a real value inside the microcontroller, and that real value tends to be a voltage level 

when we say one for a microcontroller such as the Arduino UNO what we really mean is that the microcontroller perceives a voltage, 5 volts. that's what one really means 

and when we say zero then what the microcontroller really sees is from a physical point of view is low voltage or zero volts. reality is a little bit front again as always nothing is black and white when the microcontroller sees is a one what it really sees for a range of voltage not just fine but typically anything that says about 3.3 volts all the way to 5 volts that tends to be a 1.

 when they are talking about 0 or 0 volts as mentioned earlier, in reality when the microcontroller sees is in a range of voltage from zero volts to 3.0

programming again we can use yet another way to describe the one and the zero or the 5 volts and 0 volts and we use keywords. when we want to convey one or 5 volts or a voltage within this range to one of the digital pin or output of the order then we used the keyword high  and when we want to convey  zero or zero volts or in the range of 0 volt 3 volts then the keyword which is used is low 

you will see me using this keyword letter on a lot more things and therefore from now on when I say high it means the digital input or output is at high voltage and when it is saying low then it means it is low voltage.




  

How this information can be used to understand the functionality of the digital input and output pin of Arduino Unos digital output pins and we will start with digital outputs

digital output


In the large header their numbers from 0 to 13, So, in total we have 14 digital inputs and outputs.
to explain how a digital output works let's have a look at a LED.

An LED is an output device. The Arduino can change the state led by changing the voltage of the digital pin where the led is connected.

Now we will connect an LED at any digital I/O pins to turn on and off led. we can select any pin. 
let us connect led at pin number 7. and connect a resistor of 100 ohms in series with led and another leg of the resistor to ground pins. (Arduino got many ground pins)


in order to turn on and off led we need to pass current toled through pin number 7.

SO when we have a high state at digital pin 7 then we will get 5volts at led and led will glow.
And when digital pin 7 is at low then across led the voltage will be 0 volts and led will not glow.

                                           digital pin 7              LED
                                                
                                                HIGH                    ON
                                                LOW                     OFF

to perform this we need to write Arduino code in Arduino IDE. So we will perform this later.

Post a Comment

Previous Post Next Post