Pages: [1] 2   Go Down
Author Topic: "Phantom Power" to Arduino via input pin???  (Read 2950 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I just had an interesting thing happen which perhaps somebody could explain in terms of electrical properties of the ATMega328P in my Uno...  It reminds me of "phantom power" for one-wire devices, except in involves a whole Uno running successfully without power except via one input port.

This is not about something not working; it's about something working just fine when it should be inactive.

I have two Uno's (master and slave), separately powered, and connected to each other by only 3 wires:
* Ground to Ground
* Master D9 to Slave D8
* Slave D9 to Master D8 (this was not really neccessary for the phenomenon)

On both, D8 is configured as input, D9 and D13 (for the LED) as outputs.  Both powered by separate USB supplies (two laptops actually).

The master was toggling D9 out every 500ms, the slave was watching for that transition on its D8 and signaling back to the master on its D9.  The Slave would also toggle its D13 every cycle.  I was testing timing and synchronization.  D8 out from the master was mostly on, dipping low briefly.

Then I removed power from the Slave.  And it kept running, at fulll speed (the timing of the signal going back to the master did not change).  The Master was still receiving its handshake from the Slave; the power LED on the slave was on, and the D13 LED was toggling normally.  The LEDs were a bit dimmer tho.  I could successfully remove the Slave D9 to Master D8 wire but not the Master D9 to Slave D8 wire - really the Slave only needed 2 wires, Ground plus D8 connected to Master's D9.

I figure that the Slave AVR microcontroller was being powered via its D9 input from the Master's D8 output.  Successfully enough to keep the Slave running at 16 MHz and sending its own output signal back to the master.  Plus enough power to run D13's blinking LED.  Not only that, but it must have been "sharing" that power back out the 5V power inputs, and powering the rest of the board, including the power-status LED.  There must have been enough capacitance to hold up during the brief time that the Master's D8 was low.

Does that make any sense to those that know the microcontroller hardware better?  Other explanation?  Have you ever seen this?  (It's easy to reproduce if you are curious or dubious).  

I didn't leave it connected long (tho I verified it a couple more times the next day), as I was concerned that the power path incoming from D8 might be going through paths not meant to handle power, at least not "flowing uphill" as it were.

I searched here before posting, but could not find any successful keywords to search the Forum for a similar occurrence.  It's not easy to guess the right keywords for an anomoly like this!

I wonder if this could be deliberately used?  I did found a thread here from somebody who wanted to supply power and data to an Arduino with fewer wires; he was getting suggestions like POE and AC coupled power/data.  But it looks like for some purposes one might be able to power and signal an ATMega328P with only 1 data wire and ground, almost like a (write only) OneWire device.

And - it's something to be aware of.  Suppose the unpowered Uno controlled a motor via another output; despite being unpowered when one of the inputs received 5v, it could continue to function and to control the motor, even send SPI or I2C commands to a controller so this is not like a static zap.

This may qualify as a type of schrödinbug.
« Last Edit: April 24, 2012, 01:17:03 am by Zeph » Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 524
Posts: 26486
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The datasheet says IO pins should not have voltage applied that is higher then VCC + 0.5V to avoid damage.
That said, the oddities of current leaking past IO pins to power other parts of the chip has been discussed here before.

29.1 Absolute Maximum Ratings*
Voltage on any Pin except RESET with respect to Ground ...-0.5V to VCC+0.5V

*NOTICE: Stresses beyond those listed under “Absolute
Maximum Ratings” may cause permanent damage
to the device. This is a stress rating only and
functional operation of the device at these or
other conditions beyond those indicated in the
operational sections of this specification is not
implied. Exposure to absolute maximum rating
conditions for extended periods may affect
device reliability.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I have two Uno's (master and slave), separately powered ...

When you say that, do you mean one of them is unpowered? Or, this happens after you disconnect the power?

I just connected together two Unos and did not observe this, but perhaps the duty cycle on the pin is important? As CrossRoads says, this is probably going outside specifications. For example, the noise from the "power" supply, being interrupted, may cause unwanted behaviour.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Both were (separately) powered to start; then power was removed from the Slave, so that its only connections were Ground and the two data pins (in and out) connected to the other (still powered) Arduino.

Yes, the duty cycle is probably important.  The master's D9 (going to the slave's D8) was on (1) most of the time - probably off (0) less than a dozen microseconds about twice a second.  So the capacitive holdup is not needed for long.

As for an IO line being above VCC, it's an interesting case when there is no VCC (the vcc input is not powered).  My guess is that it's only a protection diode's drop higher.  My (perhaps naive) concern is less about voltage than current - I'm guessing that the io pin's protection diodes are conducting power to the rest of the microcontroller, but they were probably not intended to conduct much current...

"That said, the oddities of current leaking past IO pins to power other parts of the chip has been discussed here before."

Could you help me find that?  I haven't yet find the magical keywords (just tried some from your description, too).
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 524
Posts: 26486
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'd just look for the same kinds of terms. Discussions were not much more than what you've asked.
Might have been in the Old forum too.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 603
Posts: 33387
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
it's an interesting case when there is no VCC (the vcc input is not powered).
There is nothing special here, so the Vcc is zero volts, the rules still apply!
This is a well known way of frying your chip, don't do it.
It happens will all sorts of chips, it is not new or extraordinary. The protection diodes should only be asked to carry 1mA.
Logged

Washington
Offline Offline
God Member
*****
Karma: 38
Posts: 790
Firefox & Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Basically its powering the chips through the internal protection diodes.
You could probably "get away" with it if you were driving light loads and not using LEDS but if you continue to do that as you are, you may end up blowing up the diodes and rendering those pins nonfunctional.
Logged

Avoid throwing electronics out as you or someone else might need them for parts or use.
Solid state rectifiers are the only REAL rectifiers.
Resistors for LEDS!

Offline Offline
Newbie
*
Karma: 0
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Regarding cautions: Well, I am not continuing to power it this way pending more knowledge, but thanks for the warnings.

The 1ma limit mentioned for protection diodes is the kind of info I did not have, tho, so I'm glad I asked.

I would disagree somewhat about VCC.  VCC input is floating, not grounded at 0V.  This is not a case where there's a power supply trying hard to keep the other end of the diode at a fixed voltage.  In fact the floating VCC rail is being raised via that same diode to about one diode drop below the D8 digital input; still apparently within the chip's operating voltage so the rest of the chip seems to be woking. 

The current limit (cited above as 1ma) for the protection diode is a larger concern, especially if off-chip LEDs are being powered.

The main lesson here is what I said last time - it's something for us to be aware of, that a chip could actually operate (and accidentally actuate some output) if some input pin is driven to 5v from a different supply.  I did  not know that.
Logged

Anchorage, AK
Offline Offline
Edison Member
*
Karma: 42
Posts: 1176
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That begs the question:  What's the accepted form of input protection one should build into their circuits, then, to keep outside sources from reverse-powering the micro?  I expect it would be quite common for signal sources to be alive and present while the sensing IC is otherwise unpowered.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I would have thought it was quite common for, say, an I2C bus to be active even though a device connected to it was not powered up.

Again, I haven't reproduced this phenomena personally.

But it would be rather strange would it not, if you queried devices (eg. via I2C) to see if they are switched on, and the query itself switched them on?
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 603
Posts: 33387
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I would disagree somewhat about VCC.  VCC input is floating, not grounded at 0V
You might disagree but would be wrong. Vcc is NOT floating there are internal connections in the chip that connect it to ground.

In the case of I2C the current is limited by the pull up resistors so the damage done is less. It is still very bad practice however.
Logged

Anchorage, AK
Offline Offline
Edison Member
*
Karma: 42
Posts: 1176
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is really rocking my world right now.  I wonder what horrors I've done leaving a USB CD-ROM plugged in via USB, while being disconnected from power, for instance.  I never thought to care.

The one thing I've learned while designing electronics is how little I know about electronics.  Usually, this occurs when I'm starting to feel proud of myself for something.  It sure explains why, when I see an experienced designer's schematic, I think, "that looks awfully complicated for what it does."
Logged

Washington
Offline Offline
God Member
*****
Karma: 38
Posts: 790
Firefox & Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is really rocking my world right now.  I wonder what horrors I've done leaving a USB CD-ROM plugged in via USB, while being disconnected from power, for instance.  I never thought to care.

The one thing I've learned while designing electronics is how little I know about electronics.  Usually, this occurs when I'm starting to feel proud of myself for something.  It sure explains why, when I see an experienced designer's schematic, I think, "that looks awfully complicated for what it does."
Many commercial products are already protected against this sort of fault.
Logged

Avoid throwing electronics out as you or someone else might need them for parts or use.
Solid state rectifiers are the only REAL rectifiers.
Resistors for LEDS!

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8473
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
What's the accepted form of input protection one should build into their circuits,
I don't think there's a generic protection method, it depends on the application.

You could for example drive a signal through a diode with a pullup on the "slave" side. Or use buffer chips like the TXBxxxx that shuts the buffers off if one or other VCC pins are floating. You can tri-state any outputs from the master chip or just drive them low when you detect that the slave is not powered. etc etc.

Straight series resistors may appear to work because there may not be enough current to start the slave chip, but there will still be current flowing.

_____
Rob
« Last Edit: April 26, 2012, 05:21:33 am by Graynomad » Logged

Rob Gray aka the GRAYnomad www.robgray.com

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 603
Posts: 33387
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I wonder what horrors I've done leaving a USB CD-ROM plugged in via USB, while being disconnected from power, for instance.
How can a USB device be plugged in and not powered?

Quote
I expect it would be quite common for signal sources to be alive and present while the sensing IC is otherwise unpowered.
No it is not common at all. Driving a signal into a device that is not powered is hardly ever encountered. The only common case I can think of is plugging an RS232 cable into an unpowered device, but the buffer chips protect the rest of the circuit.

The best form of protection is to use an opto isolator. Next best is to use catching diodes to the rails and series resistors like here:-
http://www.thebox.myzen.co.uk/Tutorial/Protection.html

Logged

Pages: [1] 2   Go Up
Jump to: