optimistx

In my bicycle project there was the need to measure battery voltage, around 40 Volts, and the current, up to 14 Ampere.I was worried to burn some valuable parts and therefore made very simple test circuits an a breadboard together with one Arduino nano connected to a pc. The whole test in a living room on a stand.

To measure voltage there was a voltage divider with 20k resistor connected to 40 Volts, middle point voltage to analog input A3 in Arduino nano, and lower side of the voltage divider being 1k and connected to ground.

The analog conversion value was about level 410 ( out of 1023) , when the results were viewed at Arduino monitor window in a windows pc. The connection was with the usual usb-cable.

The current was measured on the same nano, the same breadboard with Acs712T (hall effect sensor ). Its 5 V logic power was fed to it from the 5 V pin of the same arduino nano, and the analog signal was connected to analog pin A2. The analog conversion value made sense.

The measurements above were made so that first the usb cable was connected to nano, and thereafter the 40 volt battery.

But then I left the 40V battery connected to nano and disconnected the usb cable. The nano was supposed to be without power, in my understanding.

I reconnected the usb cable between my pc and nano (the battery 40 V was still connected). Windows XP complained that the usb connection was invalid or the device defective and asked to disconnect/reconnect or replace the device.

Disconnectin/connecting the usb-cable did not help.

The next day I connected the usb cable first, then the battery, and the Arduino monitor showed good values for current and voltage. Sigh of relief.

But in the next test session there was faint smell of something hot: the cpu of the nanoboard was too hot to touch and pc could not communicate correctly with it. Even without any breadboard wires the nano became very hot in 10-20 seconds.

To make the circuit simple I had omitted all the customary(?) protection diodes and all the capacitors. The only protection for the analog inputs of A2 and A3 was a 10 k resistor in series.

Is it possible or probable that in the above circuit the 40 V battery causes damaging voltages or currents, when Arduino nano is without power? (provided the components ACS712T and resistors are not at fault).

Never ever connect any voltage to the input of ANY chip when that chip is not powered. As you have found out this is a great way of killing a chip.I would try and power everything off the same source, even if it means several stages of step down.Another option is to connect the input through to the arduino through a reed relay and have the arduino power the relay, so that when the relay drops out the input is disconnected.

Never ever connect any voltage to the input of ANY chip when that chip is not powered. As you have found out this is a great way of killing a chip.I would try and power everything off the same source, even if it means several stages of step down.Another option is to connect the input through to the arduino through a reed relay and have the arduino power the relay, so that when the relay drops out the input is disconnected.

Thanks for the prompt and clear answer, Grumpy_Mike. This has taught me an important lesson, and I am willing to learn about it very thoroughly. Could you or somebody of the other readers give me keywords or links to learn more about this? I had wrongly believed that one could connect different microprocessors to each other without worrying where and when they get their power. (not out of range voltage or out of range current had been my only concern...)

I would have used 200k and 10k for the voltage divider, ten times your values, since then the max currentfrom the divider would be 200uA rather than 2mA.

With the supply disconected that 2mA would flow through one of the input protection diodeswhich might be enough to put the chip into CMOS latch-up (to be avoided since the whole chip thenconducts between Vcc and ground).

Of course some other failure mode might have been involved.

[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

optimistx

I would have used 200k and 10k for the voltage divider, ten times your values, since then the max currentfrom the divider would be 200uA rather than 2mA.

With the supply disconected that 2mA would flow through one of the input protection diodeswhich might be enough to put the chip into CMOS latch-up (to be avoided since the whole chip thenconducts between Vcc and ground).

Of course some other failure mode might have been involved.

Is there any safe level of current or energy, which Arduino Mega2560 would tolerate in its pin when not powered? E.g. a voltage divider with 10 megaohm legs?

Is there any safe level of current or energy, which Arduino Mega2560 would tolerate in its pin when not powered?

Any chip will not be able to take more than 0.5V without power. This is because an unpowered chip just looks like a bunch of diodes.One way of getting round this is to have a transistor buffer in front of the input. But this would only be any good for a digital signal not an analogue one.You can also use an opto isolator but again it is not good at transferring analogue voltages.

optimistx

Is there any safe level of current or energy, which Arduino Mega2560 would tolerate in its pin when not powered?

Any chip will not be able to take more than 0.5V without power. This is because an unpowered chip just looks like a bunch of diodes.One way of getting round this is to have a transistor buffer in front of the input. But this would only be any good for a digital signal not an analogue one.You can also use an opto isolator but again it is not good at transferring analogue voltages.

Thanks! I'll acquire optoisolators, and suitable transistors.

0.5 V limit with analog input might be only a minor nuisance, if I use 1.1V internal reference (or even about 0.7V-0.8V aref reference voltage) and arrange the voltage divider to never(?!) give above 0.5V. Should there be a low limit for power (or current) at the same time to be on the safe side? What about having 10K resistors in front of (slowly changing ) analog inputs, or would it be significantly safer to use e.g. 1-10 megaohm resistors?

optimistx

Is there any safe level of current or energy, which Arduino Mega2560 would tolerate in its pin when not powered?

Any chip will not be able to take more than 0.5V without power. This is because an unpowered chip just looks like a bunch of diodes.One way of getting round this is to have a transistor buffer in front of the input. But this would only be any good for a digital signal not an analogue one.You can also use an opto isolator but again it is not good at transferring analogue voltages.

I assume "a transistor buffer" is like this:http://hyperphysics.phy-astr.gsu.edu/hbase/electronic/buffer.html#c2

Is an operational amplifier (to the right of the previous page) also suitable as a buffer, eg. lm324? If lm324 or a transistor is without power (but input has power) , they do not overheat? An when their input circuit is without its power, that circuit does not overheat?

Electronic Technician, Electronic Engineering Technician
I love to build things. Test equipment, replica and original sci fi props and costume pieces, and whatever else I feel like at the time. I have an Ultimaker and a 3D engraver. I rarely put a kit tog

I like connecting a couple of schottky diodes in as a protection circuit on signals such as this. Then the input can never go about 400mV above Vcc (even when it is off) or below ground.

So signal >> 200k >> 10k >> groundThe node between the 200k and 10k resistor connects to:The Arduino input pinA schottky diode with the other end connected to ground, reverse biased in normal opeation (anode to ground)A schottky diode with the other end connected to the Arduino's power supply line, reverse biased in normal operation (cathode to Vcc)

That goes for the LM324 or any other Op Amp that does not specifically have protection against voltage on an input when the chip is powered down. There is a parasitic thyristor in the bulk of the semiconductor, it has to do with the way the P and N layers are built up as an insulating layer under the transistors. Look up "latchup".

Electronic Technician, Electronic Engineering Technician
I love to build things. Test equipment, replica and original sci fi props and costume pieces, and whatever else I feel like at the time. I have an Ultimaker and a 3D engraver. I rarely put a kit tog

BTW, with that transistor buffer, when no Vcc is present, current will flow through the BC junction into the Arduino Vcc, potentially causing unexplained effects. And when on, the voltage you are measuring will be offset by about 600 to 700mV, at about -2mV/Celsius.

No that is called an emitter follower, you want the configuration where the emitter is connected to ground and the collector, resistor and input pin are all connected together. The the other end of the resistor goes to Vcc.

This means any input voltage is shunted off to ground through the base / emitter junction.

Electronic Technician, Electronic Engineering Technician
I love to build things. Test equipment, replica and original sci fi props and costume pieces, and whatever else I feel like at the time. I have an Ultimaker and a 3D engraver. I rarely put a kit tog

Electronic Technician, Electronic Engineering Technician
I love to build things. Test equipment, replica and original sci fi props and costume pieces, and whatever else I feel like at the time. I have an Ultimaker and a 3D engraver. I rarely put a kit tog

Maybe I'm not putting this together in my head the way you are picturing it, Grumpy Mike, but what I think you are describing is a common emitter amplifier. It is going to have a gain that is temperature and current dependent.