Pages: [1]   Go Down
Author Topic: Question about Digital pins voltage max on INPUT  (Read 651 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Sr. Member
****
Karma: 1
Posts: 415
MEGA_Stick_II is here
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This all happened my my own account, but I am curious as to why I didn't fry my Arduino, or at least that input pin. Let me see if I can explain.

I am reading an input pin, pin 11 and it is set to; (I know it's defined as an OUTPUT, part of my mistake, but reading an output pin yeilds the same results)

pinMode(ATF_Ind,OUTPUT);
digitalWrite(ATF_Ind,HIGH);

I want to know when that pin goes to ground and it is connected to something else. Forgetting about voltage difference, I forgot that the wire connected to pin 11 is at +16 volts. I realized this after a while of it working. Now I am curious as to why it didn't fry pin 11.

The pin was set as an OUTPUT and set to HIGH, so that is 5v - 16v = 11v going somewhere? I assume passed to the internal zeners.?.?
I checked the wire I am connected to and it is coming from an indicator LED through a 5K resistor connected to a FET, so when the FET is ON, the LED indicator gets a ground - thus sending a ground to my Arduino Pin 11, which I am monitoring. When the FET is OFF their is +16 volts on that wire and the indicator LED is off.

My guess is that the 5K and the internal resistance on the Arduino to the Zener was enough to prevent overheating and ultimately taking out that pin. It's my understanding that the IO pins should only see a MAX of +5v, but I guess that depends on how much current is flowing through the internal protection circuit.

Logged

Offline Offline
Edison Member
*
Karma: 32
Posts: 1286
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

if you look at the specs for a chip, you'll see "absolute maximum ratings".    This means that the chip is ALWAYS SAFE below these voltages/currents.   The ATmega chip is rated for up to 6V operating voltage, and the input pins can go 1/2V over the operating voltage, or as low as -1/2V.   

Typically you are operating at 5V, so you can safely apply up to 5.5V on a pin.  That does NOT mean that you will automatically fry the chip if you put 6V on an input...   It means that you MIGHT fry the chip, so  you should NEVER do it.     smiley-wink

Where I work, we make a board that operates from 5V, and of course it has lots of 5V chips on it.   One of the configurations has the same barrel-connector as our 12V products...   So once in awhile, we accidenly plug 12V into it...   Usually, that frys the board...   But usually just the RAM gets fried, and sometimes the CPU chip.   Everything else survives, and we can repair the board by changing one or two chips.
Logged

0
Offline Offline
Sr. Member
****
Karma: 1
Posts: 415
MEGA_Stick_II is here
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I was just surprised that it didn't fry. But after getting my meeter out, I measure 5v on the input pin but if I disconnect the pin and measure the wire, I get 16v.

Anyways, to correct the issue I set the pin to an INPUT, HIGH and now have a Diode between the pin and the wire, so the input pin only sees the ground. smiley-wink
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33371
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

No the diode will have a forward leakage current, therefore your pin will see the voltage on the other side. You should use a zenner or rail clamping diodes and a seriese resistor to protect your pin.
Logged

0
Offline Offline
Sr. Member
****
Karma: 1
Posts: 415
MEGA_Stick_II is here
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No the diode will have a forward leakage current, therefore your pin will see the voltage on the other side. You should use a zenner or rail clamping diodes and a seriese resistor to protect your pin.

This is what I have, (oops, the vertical Diode is an LED)


When the FET is ON, I have 0v at both point a and b. With the FET OFF, I have 16v at point b and 4.948 at point a.

I guess I'm not understanding forward leakage current in this instant. Is it being drawn from the Arduino when the FET is OFF?

Thanks, your always a help.
« Last Edit: May 02, 2012, 04:55:39 pm by Jassper » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33371
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

No it is being provided through the diode from the 16V supply. The internal protection diodes are clamping the input that is why you don't see 16V.
What is the diode in the 16V line doing? I can't see the point in that.
Logged

0
Offline Offline
Sr. Member
****
Karma: 1
Posts: 415
MEGA_Stick_II is here
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No it is being provided through the diode from the 16V supply. The internal protection diodes are clamping the input that is why you don't see 16V.
What is the diode in the 16V line doing? I can't see the point in that.

Sorry, that is an LED.

So eventually it is going to burn out the internal protection diodes.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33371
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
So eventually it is going to burn out the internal protection diodes.
Probably not, they are good for about 1mA which is much less than you are giving them. Personally I don't like relying on them, but I don't have any solid reason. If it were me I would have used a transistor into the input pin, but you should be fine. 
Logged

0
Offline Offline
Sr. Member
****
Karma: 1
Posts: 415
MEGA_Stick_II is here
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
So eventually it is going to burn out the internal protection diodes.
Probably not, they are good for about 1mA which is much less than you are giving them. Personally I don't like relying on them, but I don't have any solid reason. If it were me I would have used a transistor into the input pin, but you should be fine.  

So I want to understand this correctly then, With the FET off, I have 16v on the wire, and 5v on pin 11 (set to HIGH in the code).
So I have 16 - 5 = 11 volts shunting to ground through the internal protection diodes. There is 5K and I believe the internal resistors are 20k? or is that just the pullups? plus nominal resistance from the LED. So that is roughly 11v/25000 =0.00044 amps flowing through the protection diodes.

With the FET on, everything is grounded and all is good.

Is that right?

Thanks
 
Final layout I may add external protection.

Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33371
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Is that right?
Not quite.

Quote
I believe the internal resistors are 20k? or is that just the pullups?
That only applies when the pull up resistor is enabled. Normally an input is a much higher impedance. The data sheet specifies this as leakage current with 5.5V on the pin, at 1uA. You also have a diode so you need to take into account the reverse bias leakage current as well, so in total I would be surprise at more than a few uA.
Logged

0
Offline Offline
Sr. Member
****
Karma: 1
Posts: 415
MEGA_Stick_II is here
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK, makes sense. Thanks.
Logged

Pages: [1]   Go Up
Jump to: