0

So can I put a voltage from 0v to 5v on an analog Arduino pin before actually turning the Arduino on? And still read the analog pin correctly when turned on?

1
  • internal logic can be also configured as high impedance (High Z) - did you consider that? – user37795 Aug 31 '17 at 11:03
6

All the GPIO pins have protection diodes in them. The are arranged, effectively, like this:

schematic

simulate this circuit – Schematic created using CircuitLab

The internals of the ATMega chip can be visualised for this purpose as a small resistor:

schematic

simulate this circuit

If you apply a voltage to the input without anything applied to Vcc you effectively connect the input to ground through the diode and the internals:

schematic

simulate this circuit

That means that too much current flows through the diode and potentially breaks it. And that's the least of your worries. The rest of the circuitry in the chip is subject to the same rules - any voltages that can flow back up to the Vcc rail the wrong way through parts of the circuitry in order to get down to ground risk breaking things.

It's almost as bad as connecting the power to the chip backwards. In effect your GPIO pin is acting as Vcc and powering the chip - badly.

3
  • If you add a large value resistor between the analog pin an the analog voltage source, not enough current can flow to cause damage. You have to be careful that the resistor doesn't influence the reading. Another option is to have a lower value resistor, but add an external clamping diode that can handle a lot more current. – Gerben Dec 7 '16 at 15:35
  • The resistor increases the output impedance of whatever you are reading the value from - and yes, if too high it can affect the accuracy of your reading. It does provide some protection though. A better diode will protect the internal diode, but it won't stop the problem of back-powering through the internal logic. The proper solution is to use a MOSFET to isolate the input when there is no power applied. – Majenko Dec 7 '16 at 15:37
  • An example and explanation can be found here: electronics.stackexchange.com/questions/134157/… – Majenko Dec 7 '16 at 15:40
0

So can I put a voltage from 0v to 5v on an analog Arduino pin before actually turning the Arduino on? And still read the analog pin correctly when turned on?

yes and yes.

1
  • Every AVR datasheet I've read gives the absolute maximum input voltage to a pin as something like Vcc + 0.5V - which in this case would be 0.5V. – PeterJ Aug 31 '17 at 12:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.