Read battery voltages from 2 batteries w/o common ground

Hello,
I´ve been reading this post and I have a common ground problem... Can you help?

My goal, is to read battery voltages from 2 different batteries. They may not be sharing a common ground. They will also be 12v and/or 24v. So I will need voltage dividers to reduce the voltage to be read on the Arduino.

My problem, is to read the voltage I will need to link the common ground of the Ardunio to the battery I am trying to read. I dont want to introduce a permanent common ground.

Do you think it is feasible, to use a mosfet, connect the ground, take a reading and disonnect the ground again?

Note... I´m also using a mosfet on the positive not to create a constant drain on the battery.
My programming will be as such...

  1. Activate D07
  2. Activate D12
  3. Take reading at A01
  4. Deactive D07 and D12

Do you think this will work?

Massive TIA... Love the forum very useful!!

Schematic_Common Ground Voltage Testing_Sheet_1_20200411135053.png

What is your objection to a common?

My objection to a common ground is the application I am reading the batteries from. I dont want to introduce a common ground if there is not one already.
Some incidences will have it, some will not.

I don't want to introduce a common ground if there is not one already.

That doesn't make sense, either your design needs one or it doesn't. What you 'want' is not relevant.

None of your circuits on the right will work properly if the -ve of the battery is not conneected to the -ve supply of the Ardunio. How do you propose to turn the two 2N7000 transistors on and off with outputs from the Arduino if they don't share a common ground with it? I know you've read the tutorial about common grounds so you should already know the answer to that.

In any case, you can't use an N channel MOSFET as a high side switch the way you have it, you need a P channel MOSFET and another transistor to change the level. Not only that but you have source and drain reversed.

Hay Perry,

Thaks for the reply. I dont get your answer, and yes I have been told about a few errors. It has been updated below.

My mis-understanding of your post is D7 and D8 2N7000 are linked to the -ve of the Ardunio. once they are actiavted I will have linked the -ve for D12 and D13 2N7000.

Maybe I´m over complivating this, but I dont see why my application should introduce a common GND to the circuit, if I can avoid it.

TIA.

Voltage is always relative. A meter requires a reference connection (usually ground) and it won't work without two probes.

With a regular multimeter the common/black lead isn't necessarily earth ground but it's an internal-floating "ground" (or simply a common reference connection). If you are measuring battery voltage and you reverse the connections, the meter will measure negative because the battery's negative terminal is negative relative to positive terminal.

The Arduino always reads voltage relative to it's ground. Again, that ground can be "floating", but you have to be careful if there is a USB connection (possibly earth grounded) or any other external connections. (Unlike a multimeter, the Arduino can't read negative relative to it's ground.)

I dont want to introduce a permanent

Then use the flying capacitor method.

Thanks for the reply. I don't get your answer

Do you understand from the explanations DVDdoug, Ron_Blain and GM have given you? If not, then please ask another question.

Your new circuit is better, but I don't see the point of the 2 MOSFETs in series, what do you hope the will achieve?

For the sake of those of us used to following the lines around a circuit diagram please get out of the habit of labelling pins with where they are suppose to go and instead join them up with lines. Thank you.

"For the sake of those of us used to following the lines around a circuit diagram"

I have found that makes things really cluttered. I prefer names myself.
Perhaps names on both ends, with lines for folks who prefer lines.

Names also come in handy when laying out a board, in Eagle you can see the signal names and it helps one to determine if a signal needs more attention to routing (like SPI clock line) or not (for example, Reset).

I have found that makes things really cluttered. I prefer names myself.

Oh! I hate the pin names method myself. Just shows you can annoy some of the people some of the time but to really upset everyone at once you need a computer (or something like that).

Honestly Perry, I'm more confused now than when I posted this.

I didnt think it would this diffcult to read two battery voltages without a common ground between the ardiuno and the batteries. I thought my idea was straight forward, alas it is not.

Back to the drawing board!

ps. as for naming pins, I guess its a personal preference. e.g some use tabs and other use spaces in programming!

Honestly Perry, I'm more confused now than when I posted this.

I don't know how else to tell you. You've read the tutorial, several people have explained it in several different ways. I don't understand what you don't understand.

If you want to read voltages with no ground connection then follow GM's suggestion and use a flying capacitor. (No, I'm not going to explain! There are several discussions on here about it, and Google is good at finding things).

Alright Perry, Im just trying to learn something. Wow!

I´ll research flying capacitors. Thanks for your help, I think.

Alright Perry, I'm just trying to learn something. Wow!

Hopefully someone else will come along and explain it in some different way that none of us has thought of and you'll understand.

BTW, I always encourage people to try stuff; don't ever be afraid to try what you think and learn from what happens. Maybe the only way you will understand this is to build it and play around with the circuit.

Do have fun experimenting :slight_smile:

grichfitz:
Alright Perry, Im just trying to learn something. Wow!

I´ll research flying capacitors. Thanks for your help, I think.

OK, what you are looking to do is not all that unusual or really difficult. However, there are rules one normally understands before trying to do what you want to do.

I get what you are trying to do using the MOSFETS but when using a MOSFET one needs to understand how it acts as a switch and understand the data sheet information. Additionally, even when using a MOSFET like the common 2N7000 as a switch there are things like the MOSFET On Resistance.This is your 2N7000 data sheet.

Most of this is here nor there because there is no need for the use of MOSFETs. Now if you wish to try and run with that design then by all means have at it but myself and others will tell you it is a poor design and will not give anything close to accurate measurements.

The way this is normally done is using a voltage divider as you have and you need what is called a differential input to your ADC (Arduino). Now you can use A0 & A1 for one channel and A2 & A3 for the other channel using any of the tutorials out there or as I suggested use a ADS1115 simple little module with your Arduino.

I would also suggest you read up on and get a handle on what is called Common Mode Voltage. You will eventually run into that.

Ron

You shouldn't double post, it's not polite and wastes other's time.

Having said that you need to identify how isolated the grounds need to be. Right now the grounds are not directly connected to each other but they are connected through a diode (built into the Mosfet).

A flying capacitor is simply a capacitor used to transfer a sample of the voltage. They work better with relays than semiconductors if isolation is a goal.

Concept:

You add a divider on the UNO side of the measurement (i.e. at the analog divider)

With a relay, you connect a capacitor say 1µF, to supply

Wait some short time for the capacitor to charge to the supply voltage. You might want to put a 100 ohm in series with the supply and where the capacitor connects to limit current into the cap when it first connects to the supply.

Switch the relay disconnecting the capacitor from the supply and connecting it to the divider going to the analog input. Read the analog input as fast as possible as the capacitor will start to discharge as soon as its connected to the divider.

This method maintains complete isolation and does not have the measurement divider drain on the measured supplies.

They work better with relays than semiconductors if isolation is a goal.

I don't think flying capacitors work without a double pole change over relay.

These are other isolation techniques like:-
Opto isolators, but to make a linear transfer of voltage you need a dual transistor single emitter type and an op-amp for the feedback.

Inductive isolators, coupled coils or transformers they are all the same thing. On the unknown voltage side you have a voltage to frequency converter, then through the isolator to a frequency to voltage converter.

You can do the same trick with capacitive coupling, or simple optical coupling.

PerryBebbington:
BTW, I always encourage people to try stuff; don't ever be afraid to try what you think and learn from what happens. Maybe the only way you will understand this is to build it and play around with the circuit.

I agree with that in principle, but then you get this thread and this one, and wonder.

Hay peeps.

Thanks for the input. From reading your advice and the various complications of keeping the circuits apart, I’m going to try the flying capacitor solution.

To me this is the simplest method. I like simple. Simple works! I’ve never heard of this before and I like it!

If anyone has any suggestions on the particular values of capacitors, relays and resistors it would be appreciated, but I think I now have enough information to figure it out myself.

Thanks everyone!

hannah_mackinlay:
I agree with that in principle, but then you get this thread and this one, and wonder.

Well, yes, indeed. There's always a need for new entrants to the Darwin awards.