Author Topic: Measuring Voltage from battery whilst keeping it isolated?  (Read 3113 times)

0 Members and 1 Guest are viewing this topic.

Offline lja246Topic starter

  • Contributor
  • Posts: 16
  • Country: au
Measuring Voltage from battery whilst keeping it isolated?
« on: December 09, 2022, 04:11:59 am »
Hi all,

I'm trying to make a circuit for a caravan that can connect the cars battery to the caravans battery and then disconnect it in certain situations. I am trying to figure out how to measure the voltage of the cars battery as I will be using N-channel mosfets to connect the two, so the positive rail will always be connect and only the ground connection will be interrupted. Is there any way to measure the cars voltage whilst keeping it isolated as any connection from the micro controller's ground to the car batteries ground will complete the circuit and make the mosfet's useless.
I was thinking maybe I could use an external ADC and use it in differential mode however, i'm unsure if it would keep the batteries  isolated.
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3032
  • Country: us
Re: Measuring Voltage from battery whilst keeping it isolated?
« Reply #1 on: December 09, 2022, 04:20:57 am »
Can you provide a schematic of the situation?

It seems you could always use a separate mcu for each battery and have them communicate over an isolated link.

Update: There's also this recent thread which touches on the same topic:

https://www.eevblog.com/forum/projects/reading-a-voltage-which-is-grounded-to-a-different-potential/

In reply #6 some "exotic" ideas are mentioned:

... Then there are many more exotic options if you have special requirements, flying capacitor voltage sampling, delta-sigma analog voltage isolators, linearized optocouplers and so on.
« Last Edit: December 09, 2022, 04:49:42 am by ledtester »
 

Offline lja246Topic starter

  • Contributor
  • Posts: 16
  • Country: au
Re: Measuring Voltage from battery whilst keeping it isolated?
« Reply #2 on: December 09, 2022, 05:48:39 am »
The project is still in the idea phase at the moment so I haven't got a proper circuit drawn out but here is a quick circuit.
1658209-0
The caravan battery will always be connected and used to power the micro controller which will be an ESP32 and the car battery will be connect or disconnected using the mosfets. The car battery is the one that I am interested in measuring. If I was to use a separate controller to measure the voltage and then communicate it to the esp32 with optical isolation for example, could you suggest a cheap controller for this and an isolated form of communication?
 

Online inse

  • Frequent Contributor
  • **
  • Posts: 642
  • Country: de
Re: Measuring Voltage from battery whilst keeping it isolated?
« Reply #3 on: December 09, 2022, 07:23:12 am »
Keep in mind that you need a floating supply for the gate driver of the back-to-back MOSFETs.
A (bistable) relay is not an option?
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14076
  • Country: de
Re: Measuring Voltage from battery whilst keeping it isolated?
« Reply #4 on: December 09, 2022, 07:44:39 am »
A 2nd controller would be an option, but quite complicated.
As the 2 batteries are connected at the positive side, they are not really isolated.  One can measure the voltage in the car battery quite similar to the caravan battery. The initial point to measure would be the difference between the 2 batteriesm which is the voltage over the 2 MOSFETs.  Use a voltage divider and maybe difference amplifier.  It may need some care with the protection, because the car system is only 12 V nominal, but can still have quite some voltage spikes from switching large loads and inductive kickback.
 
The following users thanked this post: Someone

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3623
  • Country: nl
Re: Measuring Voltage from battery whilst keeping it isolated?
« Reply #5 on: December 09, 2022, 07:46:41 am »
Maybe I'm totally off, but is a car battery not connected to the chassis with its negative terminal (ground) and as such connects the caravan chassis to this ground when hitched on to the car?

And would it then not be better to have the switched coupling between the positive terminals?

Also what is the purpose of this connection? Charging the caravans battery or raise the available power?

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3623
  • Country: nl
Re: Measuring Voltage from battery whilst keeping it isolated?
« Reply #6 on: December 09, 2022, 07:49:39 am »
A 2nd controller would be an option, but quite complicated.

There are probably loads of examples on wireless connections between two ESP32 boards, so using one to measure the car battery and another for the caravans and using a wireless link to communicate the results is not that big of a deal.

Offline coromonadalix

  • Super Contributor
  • ***
  • Posts: 5795
  • Country: ca
Re: Measuring Voltage from battery whilst keeping it isolated?
« Reply #7 on: December 09, 2022, 03:23:05 pm »
use an ssr relay it will automatically give you isolated control lines

you have miniatures volts and amps displays  who could fit pretty well in a dash,  or some are wireless enabled

some of them don't need an isolated supply, they will feed over the source


and normally the frame of the vehicle is grounded, and or ground level, sometimes you see flexible braid strap between the frame and the motor
« Last Edit: December 09, 2022, 03:26:12 pm by coromonadalix »
 

Offline mawyatt

  • Super Contributor
  • ***
  • Posts: 3194
  • Country: us
Re: Measuring Voltage from battery whilst keeping it isolated?
« Reply #8 on: December 09, 2022, 04:27:15 pm »
Maybe I'm totally off, but is a car battery not connected to the chassis with its negative terminal (ground) and as such connects the caravan chassis to this ground when hitched on to the car?

And would it then not be better to have the switched coupling between the positive terminals?

Also what is the purpose of this connection? Charging the caravans battery or raise the available power?

Most cars we've seen have a battery negative to chassis ground, which as you say could complete the negative connection when the trailer hitch engages if both sides are at chassis potential.

Agree, using the + battery seems like a better solution, either by means of a regular relay or Opto-relay.

Best,
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Offline bdunham7

  • Super Contributor
  • ***
  • Posts: 7729
  • Country: us
Re: Measuring Voltage from battery whilst keeping it isolated?
« Reply #9 on: December 09, 2022, 05:25:37 pm »
Reading an isolated battery can  be accomplished by using a TL074 and a few resistors, just look up a typical differential probe circuit to get the idea.  It won't be totally isolated but if you use 2x 1M resistors as input voltage dividers you'll be close enough.   However, unless all the the electrics in your caravan are totally isolated, I don't see how are going to manage to keep your grounds isolated between the car and the trailer.  It sounds like a sparky idea.  You're going through all this just to avoid using a high-side switch?
A 3.5 digit 4.5 digit 5 digit 5.5 digit 6.5 digit 7.5 digit DMM is good enough for most people.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19345
  • Country: gb
  • 0999
Re: Measuring Voltage from battery whilst keeping it isolated?
« Reply #10 on: December 09, 2022, 05:49:39 pm »
A small relay and capacitor? Switch on the relay to take a sample. Choose high values for the potential divider, so they don't draw much power from the circuit being measured.
« Last Edit: December 09, 2022, 05:51:33 pm by Zero999 »
 

Offline lja246Topic starter

  • Contributor
  • Posts: 16
  • Country: au
Re: Measuring Voltage from battery whilst keeping it isolated?
« Reply #11 on: December 09, 2022, 08:05:18 pm »
Thanks everyone for the replies,
 
I already tested the caravan and I found that the negative of the battery isn't connected to the chasis but you all raise a good point about just switching the high side to make it easier.

I think i'll go with a latching relay to break the positive rail but i'm unsure about what rated relay I should use to deal with the inrush current. It is possible that the caravan battery can be as low as 11v and the car battery be at 14.4v and since I can't really measure the resistance between the two connections I can't determine the inrush current.

Does anyone know roughly what type of inrush current I'd be looking at here because in my experience its never really the continuous current draw that kills the relays, but it's usually the inrush current.

Also if there are any suggestions about another way of high side switching I'm all ears.
 

Offline bdunham7

  • Super Contributor
  • ***
  • Posts: 7729
  • Country: us
Re: Measuring Voltage from battery whilst keeping it isolated?
« Reply #12 on: December 09, 2022, 08:49:59 pm »
Does anyone know roughly what type of inrush current I'd be looking at here because in my experience its never really the continuous current draw that kills the relays, but it's usually the inrush current.

Also if there are any suggestions about another way of high side switching I'm all ears.

What is the maximum current you want to draw from the car to charge the caravan battery?
A 3.5 digit 4.5 digit 5 digit 5.5 digit 6.5 digit 7.5 digit DMM is good enough for most people.
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3032
  • Country: us
Re: Measuring Voltage from battery whilst keeping it isolated?
« Reply #13 on: December 09, 2022, 09:18:59 pm »
In searching for "trailer charger" I came across what is called a "trailer breakaway kit":

Quote
Breakaway system with built-in charger is designed to bring a trailer safely to a stop by activating its electric brakes should it become disconnected while being towed. Push-button tester lets you know if the rechargeable battery is fully charged.

and you can see a teardown of one in this video:

Trailer Breakaway Kit - Unboxing - With Some Explanation. -- SyEnsability
https://youtu.be/rU3161yks5U

At around 2:30 you can see that the battery has it's own charger PCB. So in this design you have:

Code: [Select]
    main battery ----- charger pcb ----- trailer battery

and they are always connected (normally).
 

Offline lja246Topic starter

  • Contributor
  • Posts: 16
  • Country: au
Re: Measuring Voltage from battery whilst keeping it isolated?
« Reply #14 on: December 09, 2022, 09:36:55 pm »

What is the maximum current you want to draw from the car to charge the caravan battery?

I'd say probably 10 - 15 Amps max from the car battery ideally but I'm not sure how to regulate the current as the relay will just act as a simple on/off switch and I wouldn't be able to use PWM or something.
 

Offline bdunham7

  • Super Contributor
  • ***
  • Posts: 7729
  • Country: us
Re: Measuring Voltage from battery whilst keeping it isolated?
« Reply #15 on: December 09, 2022, 09:41:21 pm »
I'd say probably 10 - 15 Amps max from the car battery ideally but I'm not sure how to regulate the current as the relay will just act as a simple on/off switch and I wouldn't be able to use PWM or something.

Since you wanted to have an ammeter, just use a 0.1 ohm shunt in series with a 20A or 30A circuit breaker.  Your inrush will be limited to ~30A and you wouldn't be likely to see more than 15-20A unless you have a large load on the caravan battery, in which case the breaker will pop and you can take care of whatever the issue is.
A 3.5 digit 4.5 digit 5 digit 5.5 digit 6.5 digit 7.5 digit DMM is good enough for most people.
 

Online inse

  • Frequent Contributor
  • **
  • Posts: 642
  • Country: de
Re: Measuring Voltage from battery whilst keeping it isolated?
« Reply #16 on: December 10, 2022, 04:29:59 am »
@coromandelix
Non polarized DC SSR, do they exist?
An AC SSR would not be suitable as the incorporated TRIAC will not switch off until the load current drops to zero.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19345
  • Country: gb
  • 0999
Re: Measuring Voltage from battery whilst keeping it isolated?
« Reply #17 on: December 10, 2022, 05:43:48 pm »
@coromandelix
Non polarized DC SSR, do they exist?
An AC SSR would not be suitable as the incorporated TRIAC will not switch off until the load current drops to zero.
An SSR with two MOSFETs connected back-to-back will work with DC of either polarity.
https://www.infineon.com/dgdl/Infineon-PVN012-DataSheet-v01_00-EN.pdf?fileId=5546d462533600a401535683f185294d
https://www.vishay.com/docs/81646/vo14642a.pdf
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2353
  • Country: gb
  • Recovering Electrical Engineer
Re: Measuring Voltage from battery whilst keeping it isolated?
« Reply #18 on: December 10, 2022, 07:32:32 pm »
Use a low cost isolated ADC like an AD7400. A zener and a few resistors and your done.
Well, you might want to arange to wake it up a few times an hour to reduce battery drain to zero. A cmos 555?
 

Online inse

  • Frequent Contributor
  • **
  • Posts: 642
  • Country: de
Re: Measuring Voltage from battery whilst keeping it isolated?
« Reply #19 on: December 10, 2022, 09:10:54 pm »
I feel like this discussion is leading nowhere…
Take a step back and think of a simple reasonable solution.
Why do you need a uC to decide how to connect the batteries?
« Last Edit: December 10, 2022, 09:14:21 pm by inse »
 

Offline lja246Topic starter

  • Contributor
  • Posts: 16
  • Country: au
Re: Measuring Voltage from battery whilst keeping it isolated?
« Reply #20 on: December 10, 2022, 10:30:05 pm »
As the cars battery is directly connected to an Anderson plug at the towbar the caravan plugs into that, there is no low voltage protection for the vehicle so on a few occasions the vehicle has struggled to start because both batteries have been drained so when the voltage reaches a certain value i'd like the vehicle to disconnect first so there's no issue with starting it. There have also been occasions where a large current will flow from the caravan battery to the vehicle when starting so if it detects that there is a reverse current flow i'd also like them to disconnect. And it will kind of be integrated into a smart system that's in the caravan already so i'd figured i'd just basically add onto that.
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3032
  • Country: us
Re: Measuring Voltage from battery whilst keeping it isolated?
« Reply #21 on: December 11, 2022, 04:08:56 am »
The "trailer breakaway kit" solves these problems with a battery charger. I'm sure there is a battery charger which can handle:

- main power source not connected
- main power source voltage < battery voltage

as well as performing safe charging when these conditions are not present.
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3032
  • Country: us
Re: Measuring Voltage from battery whilst keeping it isolated?
« Reply #22 on: December 11, 2022, 06:58:47 am »
Ok, I just thought of one scenario you still have to consider:

- main power supply connected but battery is being used

Should the charger be connected to the battery? Maybe you don't want to be charging the trailer battery if it also is being used -- something to consider.
 

Online inse

  • Frequent Contributor
  • **
  • Posts: 642
  • Country: de
Re: Measuring Voltage from battery whilst keeping it isolated?
« Reply #23 on: December 11, 2022, 07:09:52 am »
An automotive relay that switches the Anderson connector when the motor is running does not solve the basic problem?
Or if you want to mount it on the caravan side, a simple Schmitt trigger or voltage monitor that connects at  >13V car voltage and disconnects below.
« Last Edit: December 11, 2022, 07:17:31 am by inse »
 

Offline lja246Topic starter

  • Contributor
  • Posts: 16
  • Country: au
Re: Measuring Voltage from battery whilst keeping it isolated?
« Reply #24 on: December 12, 2022, 04:04:04 am »
I think i'll just go with a relay that switched the high side and I can use a normal voltage divider to measure the voltage of the car battery. I'll have the relay controlled by a micro controller that can communicate with the "smart system" that's already in the caravan.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf