Easiest way to make sure analog in voltage wont fry the board when off

I have a Nano every that will be powered by 12V. I vill have one external 0-5V source going to an Analog input.

When I power off the nano it might be voltage still to the analog input. This might fry the board.

I'm planning to use a relay to send the 0-5V signal through. What about a delay in the relay, if that happens for a few ms will it fry?

But my main question or possibly my suggestion.... let say I use the "Vin" and connect it to 12v NOT USB. then when turning it on/off I just switch the "GND" for the power and all the external batteries, then the voltage can't damage anything as there are no closed circuits? Or am I just tired and stupid right now :smiley:

Thanks!

You should make every imaginable effort to avoid connecting powered devices to unpowered devices, as both can be destroyed by the connection.

If you think that is not possible to avoid, in this case of an analog input, a 10K resistor between the external source and the analog input might prevent damage to the Arduino.

2 Likes

I would,

Trying to work with a relay disconnect an input is fraught with issues, race conditions, spikes etc.

1 Like

easiest way - just put a big resistor in series with the analog input.
eg 1M 5V = 5ua that will not fry the input - nor will it significantly change the reading.
( unless your 0-5V signal is changing VERY fast, as the input capacitance is only a few pF)

You would also need to add a cap at the input. 1 Meg at the input could pick up all sorts of noise.

I will admit my solution is very conservative. But since the components are cheap and not too many of them it seemed the best for someone new to Arduinos and the OP did a good job in knowing this was something to worry about.

I've not seen a problem with noise even with a 500M resistor - the input capacitance of the analog input would act to filter it anyway.

Hi all, thanks for all the suggestions!

But still does any one know if my question below will work or not? Seems super simple if it works.

let say I use the "Vin" and connect it to 12v NOT USB. then when turning it on/off I just switch the "GND" for the power and all the external batteries, then the voltage can't damage anything as there are no closed circuits?

Wow, you have experience with a 500M input? or perhaps this was a typo.

I guess I can't visualize your circuit.

when turning it on/off I just switch the "GND"

Is this one operation or two. If you are actually opening the ground what else is connected to the board?

No, a relic from testing a nanoammeter

Nor can I. Can you post a schematic? You would need to ensure every voltage source was disconnected.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.