Instructables

Arduino Pins

Hi,

I am wondering if someone can explain these to me..  My main problem is that I have no idea the difference between the Digital and the Analogue pins.. I know both these types can be used for Input and Output purposes, so what makes them different?.

Also, why are there Ground pins?.. I have read that you should use them, but I don't understand why and when to use them..

Appreciate any help..

Thanks.


guyfrom7up4 years ago
ground pins complete the circuit, read into electronics or ask more questions if this doesnt make sense.

The analogue pins are able to interpret a voltage applied to them (thats between 0 and 5 volts) and convert them into a digital signal.  The avr in the arduino has a built in analogue to digital (all microcontrollers are digital, of course) that is connected to those pins, but none of the others.
millie8508 (author)  guyfrom7up4 years ago
Hi,

Thanks for your reply.

About Ground pins, I have read a bit about it, but it isn't very clear to me yet (sorry)..  I read that it's used so that whatever you're working with (e.g. an LED) doesn't break, is this true?.. what if you're working with something else? would you be able to explain further?..

Thanks in advance.
well, there's 2 types of ground, electrical ground, and earth ground.  Usually people refer to electrical ground.  Electrical ground is a reference voltage of 0.  For example, lets take your average 9 volt battery.  there's 2 terminals, a + and a -.  People like everything to be positive, like +5 volts, or +12 volts, so they just call the negative terminal ground.  If we say the negative terminal of the battery is ground, it is 0 volts compared to it's self.  The positive terminal of the batttery emits 9 volts relative to ground.

Relating this to the arduino, a HI pin outputs 5 volts, a low pin outputs 0 volts.  Ground always outputs 0 volts.  So, if you put an LED between an I/O pin and ground, it will light up (assuming you have polarity correct) when you make the pin go HI.  if you have an led connected to an IO pin and the +5v of the arduino, it will light up when the IO pin goes low.

Ground is a reference voltage in which things are compared to.  The 5 volts of the arduino is only 5 volts compared to ground.  If we decided to call 5 volts ground, then the original ground would be really -5 volts.

Hi, I want to trigger 4 transistors giving digital pluses to the base of each transistor. the digital pulses should be isolated from each other. Can i do this in arduino so that i dont have to use optoisolator to separate them?

 digital is either on or off, high or low, 5 or 0 volts.  analog is from 0 to 1023(10 bit resolution) as a value.  analog is always an input(on the arduino), but those pins also function as digital input/output.  another kind of digital output is PWM, or pulse width modulation.  It turns between 0 and 5 volts at such high frequency that it can appear to be at many voltages in between( 8 bit resolution, or 256 possible values).  In simple terns power flows from high to low, ground is low.  If just your output is connected to, say, an led, it won't do anything, because the power has no way to flow through an LED to ground.  If you want to tell of a switch is on/off or to turn an led on/off use digital.  If you want to read a variable sensor(such as a light sensitive resistor or a potentiometer) use analog.  if you want to dim an led or change the speed of a motor, use PWM(aka analog out).

Hi, I want to trigger 4 transistors giving digital pluses to the base of each transistor. the digital pulses should be isolated from each other. Can i do this in arduino so that i dont have to use optoisolator to separate them?

Rustage3 years ago
Very helpful information - many thanks for posting this.