Input pin powering Arduino!

Hi,

I have a project with an RTC board which has A6 connected to monitor the backup battery voltage (CR2032) when the system is active. When I remove power from the project the Arduino draws power though the A6 pin and illuminates the onboard LEDs although not very brightly. This was not a behaviour I was expecting and quickly drains the battery, can anybody shed any light on my issue as I'm a Arduino noob but with 30+ years of electronics experience.

Thanks, Graham.

Sure, it's powering the circuit through the input protection diode on the pin.

Hmmm, well that's bad news. Any suggestions on how to overcome the problem?

Use a resistor between +battery and analogue pin.
The resistor can be any value between 0 and 10Megohm.
If the value is >10kohm, you have to add a 100n capacitor from A-in to ground.

Try a 1Megohm resistor and a 100n cap.
That will still drain the battery, but it might take months to do so.
Leo..

10K is a reasonable minimum value. Lower than that, you risk damaging the Arduino. Some people use 47K.

jremington:
10K is a reasonable minimum value. Lower than that, you risk damaging the Arduino. Some people use 47K.

Depends on the offending voltage.
In this case a 3volt backup battery.
If you calculate 1mA as being safe, then ~2.5k is the minimum resistor value (battery + diode drop).
Leo..

ght on my issue as I'm a Arduino noob but with 30+ years of electronics experience.

Amazed that you have never encountered parasitic powering before. In electronics you should never connect a signal into an unpowered chip. This can cause latch up and damage the chip. Resistors are only a sticking plaster, simply do not do this.

Grumpy_Mike:
Amazed that you have never encountered parasitic powering before

I didn't say I was a design engineer did I? :slight_smile:

Thanks to everybody for the info and advice given. It looks like using a mosfet to switch it may be one option if the resistor is not a viable solution.

Graham.

It may be more convenient, rather than a MOSFET, to use a 74HC4066 with its Vcc supplied by two diodes from both the backup battery and the Arduino so that it is powered by whichever is the higher at any moment. It uses essentially no current to power it.

Just use an open-collector drive to/from external signals if you can, solves the problem nicely.
An inline diode and a pull-up resistor can do the trick if the external signal is push-pull.

MarkT - This is an analogue input not a digital one so an open collector drive will not cut it.

Paul__B - Not sure how putting this signal from an analogue input through a data switch solves the parasitic powering problem, unless the data switch is made to switch to a channel connected to ground when not being driven by the Arduino, by say using a pull down resistor on one of the data select lines.

A relay if nothing else.

Grumpy_Mike:
Not sure how putting this signal from an analogue input through a data switch solves the parasitic powering problem, unless the data switch is made to switch to a channel connected to ground when not being driven by the Arduino, by say using a pull down resistor on one of the data select lines.

A 74HC4066 is just four switches, three of which could be purposed for something else.

The control input is from the Arduino - when the Arduino is off, its parasitic diodes pull all outputs low which switches the 74HC4066 OFF; any potential current draw through said diodes is irrelevant as the control input of the 74HC4066 is ultra-high impedance. The voltage from the battery is not switched to any “alternate channel”, it is simply disconnected.

That is after all, the elegance of CMOS.

Gremlins.
A 4066 has to be powered from the battery when the Arduino is off, otherwise you have the same parasitic power situation.
The NXP 74HC4066 uses ~15-20uA. About the same as a 150Kohm resistor.
The TI CD4066 uses ~250nA. About the same as a 10Megohm resistor.
Diode power selection won’t work, because the voltage to switch can’t be higher than the IC’s supply.
The only clean way is a (reed) relay.
That (with kickback diode), could be powered directly from an Arduino pin.
Leo…

Any solution that has the potential to drain the backup battery because you want to monitor the backup battery seems like the wrong one.

I would be checking the battery status very seldom and may consider employing a very low current supping miniature reed relay to perform a true isolation switch to connect the batt voltage to the sense pin.

Wawa:
Gremlins.
A 4066 has to be powered from the battery when the Arduino is off, otherwise you have the same parasitic power situation.
...
Diode power selection won't work, because the voltage to switch can't be higher than the IC's supply.

Yeah, I thought of that.

Doesn't matter.

At the current levels here (i.e., negligible - absolute max. 20.0 µA under very worst conditions which I very much doubt would ever be approached ), even the parasitic diodes in the 74HC4066 chip will be fine.