1
\$\begingroup\$

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!

\$\endgroup\$
  • \$\begingroup\$ post a circuit diagram. How is the LED connected? \$\endgroup\$ – Mark Aug 13 '11 at 23:10
  • \$\begingroup\$ Hmm I did have a similar incident...my system was grounded but the power was disconnected and I was wiring up the circuit when one of the wires (connected to an input) accidentally fell into the battery's positive terminal and powered up the entire system (which ended up frying one of the components because I was regulating down from a 12v battery. Strangely the mcu was perfectly fine but the motor controller toasted). \$\endgroup\$ – Faken Aug 14 '11 at 0:05
  • 2
    \$\begingroup\$ is the USB cable connected as well? \$\endgroup\$ – NickHalden Aug 14 '11 at 1:12
  • \$\begingroup\$ @JGord: No, and neither is the other power jack. \$\endgroup\$ – dsetton Aug 14 '11 at 11:49
3
\$\begingroup\$

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.

\$\endgroup\$
  • 1
    \$\begingroup\$ I referred to this project in a previous answer, but only now I see it's a gal's project, not a guy's :-). Edited my answer accordingly. \$\endgroup\$ – stevenvh Aug 14 '11 at 6:45
  • \$\begingroup\$ Wow, good find Nick! \$\endgroup\$ – NickHalden Aug 14 '11 at 16:50

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.