Electronic – Arduino getting supply from digital pin

arduinopower supply

I'm having a weird problem: my Arduino seems (in my far-from-expert interpretation) to be getting supply voltage from a digital pin.

This is my setup:

  • Arduino is using external supply voltage. I've connected the power supply's GND and positive outputs to Arduino's GND and Vin inputs, respectively.

  • I have a simple program using digital pin 3 as an input. I read the value on pin 3 and use it to set the value on pin 13, which then powers on or off an external LED.

Now, I thought that if I unplugged the Vin pin, the LED would go off, but it doesn't. Am I missing something?

Thanks!

Best Answer

Yes, this is possible. See this AVR-as-RFID project for an example, which explains:

The coil actually powers the AVR through two of its I/O pins. Nearly every chip out there has clamping diodes on its I/O pins, which prevent voltages on that pin from rising above the chip’s supply voltage or sinking below ground. These diodes are useful for arresting static discharge.When you first hold the RFID tag up to a reader, the chip has no power- the supply voltage is zero. When the coil starts to pick up power from the RFID reader, these two I/O pins are presented with a sine wave, a few volts in amplitude. Anywhere that sine wave exceeds the supply voltage, some energy is diverted from the coil to the chip’s supply rails, via the clamping diode. The end result is that the chip is powered, and the coil’s sine wave is truncated. The top and bottom of the sine have been chopped off, and it looks a lot more like a square wave now.

So the clamping diodes, intended to protect your AVR from overvoltage, are conducting current from the input pin to the supply rail, powering the rest of the AVR.