"Phantom Power" to Arduino via input pin???

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.

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.

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.

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.

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?

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.

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."

SirNickity:
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.

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

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?

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

Grumpy_Mike:
No it is not common at all. Driving a signal into a device that is not powered is hardly ever encountered.

Well as a few examples:

  • A DVD player with digital output plugged into an amplifier (or TV) which is turned off at the power point.
  • An Ethernet cable plugged into a Ethernet switch which hasn't been powered up.
  • You plug your iPhone (via USB) into a PC, and then turn the PC off when you go to bed

A DVD player with digital output plugged into an amplifier

Digital output plugged into an analogue audio amplifier!

These examples are not at all the same as sending an input into a powered chip. In consumer electronics there is all sorts of protection on inputs and outputs, you never connect them directly into a chip. Most have at least catching diodes in like I said. Audio amplifiers are invariably AC coupled.

I'm not trying to argue with you Mike. And no doubt consumer electronics is designed to be idiot proof.

However modern amplifiers have digital inputs (co-ax sockets in some cases). I have no idea what's inside the box, but theoretically you can be putting a digital signal into the amp, where - possibly after navigating some protection circuits - it hits a digital processor chip.

I suppose with things like I2C you might expect that both ends would be powered, and on a single board that would certainly be the case. But once you start talking about "cable runs" for I2C/SPI and how it is a 2-Wire protocol (SDA+SCL+GND) then one presumes that each end is individually powered. And therefore one end powers up before the other one.

As people seem to be agreeing, the plug and play cables of consumer electronics are going to tend to be somewhat protected from common scenarios, in various ways. For the most part (due to static and EMI consideration as well), they are not going to connect a microcontroller pin directly to some jack on the exterior of the device; if they do, it will be specially designed for that.

This situation arose when connecting one naked microcontroller output to to the input of another microcontroller (no special protection except what is built into the chip), with separate power supplies such they won't both be turned on or off at the same millisecond. Since I was connecting both ways (master out to slave in and slave out to master in), there was not way I could power down both at the exactly the same time.

Basically, such situations can and often will occur any time you are jumpering microcontroller based electronics together in some circuit with more than one power supply. So if your Arduino is powered by USB but connected to a breadboard circuit with its own power supply (say a sensor or actuator of some sort), can you turn the two supplies on and off at exactly the same time? What if one side is battery powered?

One concern is damaging a microcontroller. My suspicion is that while it's not a good idea, it probably isn't super sensitive to this because most people who have ever used two power supplies while prototyping have probably run into it without noticing. Using a resistor between the microcontroller might help some.

If one accepts Grumpy_Mike's model that an unconnected VCC in the slave is effectively at 0V, then no input to an unpowered microcontroller should ever be above 0.5v, period. In addition to two processor situatins, think of something like in analog input connected via voltage divider to a battery or solar panel, used for voltage monitoring when operating normally. I suspect we have a bit more slack than that model (and that there is a difference between leaving the VCC input unpowered and actually tying it to ground), but you can decide for yourself and caution is wise. I would certainly not advise deliberately using phantom power, but I'm not going to say "never, ever use two power supplies that cannot be powered or unpowered within milliseconds of each other".

Total current is another aspect. In my case, the slave ATmega328P was powering itself, two small on-board LEDs, and the output that returned to the master. If it was in a circuit to put out 40ma on several pins, obviously it would have attempted to draw more current from the 40ma output of the Master (from which it was drawing phantom power). Maybe that would have been more problem for the protection diodes, or even the Master's output. So the more power your controller might draw via an input, the more you might want to be concerned.

(Since I'm using DIP based Arduinos, I may order another ATMega328P from Mouser for $2.50 next time I have an order, and keep a spare around).

The new caution I learned was that we should be aware that the "unpowered" microcontroller might actually begin or continue operating. It could even send out well formed commands over SPI or I2C or RF; in a few situations that could be problematic - you think a system is off but it continues to function. Probably not often a concern, but if we are ever working with systems where having the microcontroller operate when we think it's unpowered could be a problem, it's good to be aware of the possibility of it operating under "phantom power" supplied via an input pin.

And no doubt consumer electronics is designed to be idiot proof.

No it is not that, it is the ESD specification that any consumer product has to meet. The components for that will protect the circuits from this situation.

If the two sub systems can be independently powered then a seriese resistor and catching diodes to each rail are a must.

Grumpy_Mike:
If the two sub systems can be independently powered then a seriese resistor and catching diodes to each rail are a must.

Is that considered ESD protection? I thought the inputs already had this anyway? (Honest question -- I'm not that advanced of an engineer, and would love to know what would make for good design practices.)

Grumpy_Mike:
How can a USB device be plugged in and not powered?

Well... How many desktop-sized drive enclosures have you found that are bus powered? :smiley: (In my case, I'm talking about -- for e.g. -- a Plextor half-height optical drive in a USB-to-IDE enclosure.)

Is that considered ESD protection

Yes it is a start, you sometimes add inductors and ferrite beads as well.
The ESD protection built into this device is minimul and needs supplementing if it is going to do a proper job.
You need to withstand between 2 to 5 KV discharges depending on what standard you are trying to meet.

Grumpy, could you explain further what circuit you are suggesting? Suppose you have two ATmega's connected to each other, with separate power supplies, such that it's not possible to power and unpower them at exactly the same time. What series resister would you use, and what kind of diodes connected to what, to allow them to communicate at maximum speed when connected, but to keep any input from ever being above 0.5 volts when a microcontroller was unpowered?

I am imagining something like 1K resistor in between, with schottky diodes on each input connected with the anode on the digital input and the cathode on the VCC input of the microcontroller. Is that what you mean?

The real voltage difference involved compared to the "naked" inputs (ie: besides the current limiting) would be due to the Schottky diode voltage drop being less than that of the internal protection diodes which it would be paralleling. With a regular diode, the voltage difference between the input and VCC on the unpowered microcontroller would be about the same as the naked situation, right?

So in that scenario, it would be essential to use a low forward drop diode paralleling the protection diodes if you intend to protect the inputs of an unpowered processor from ever rising above 0.5 volts over the processor's VCC.

If you have something like that in mind, the interesting thing is that the unpowered processor might still operate on phantom power and the LEDs on the unpowered processor board might still light up - depending the resistor size and the loads being driven - this is due to the wide VCC range.

Given how easily this "input still above 0.5v while VCC unpowered" situation can occur (eg: a processor monitoring a battery or solar panel, or connected to a peripheral device running from a separate regulator with different capacitors), I would think this required resistor and diode protection must be documented in many application notes. Can anybody reference one to help us all? Thanks.

Look at the circuit here with the clamping diodes, make it a 220R resistor between them and have the diodes on the input side.
http://www.thebox.myzen.co.uk/Tutorial/Protection.html