Using a relay to connect a battery to an Arduino pin for level checking

Hi, I wanted an arduino to control a relay so it would connect a battery to one of that arduino's pins in order to check the battery level as suggested here:

I will be checking only when certain conditions are met.

Now, I know how to completely isolate the arduino from the one channel relay as shown here:

So my question is:

  1. Since the battery's ground will have to be shared with the arduino's in order for the level to be checked then the arduino is no longer completely isolated. I assume this is true?

  2. My next question is more important, how about the other side of the relay coil (voltage divider side), is there a danger of emf there? If so, is there any improvement I can do to protect the arduino pin?


  1. yes

  2. dont know, no EE

with respect to the voltage measurement: better use floats in the math to get higher accuracy.
(integer math truncates in divisions and there are at least 2 divisions in the code.).

Thank you for that reply. I have done some further research and I have not come across anything that says that the emf would forward propagate across the contacts so I should be okay with running a voltage divider across those contacts and into my arduino.