2 grounds for a series battery circuit

Ok, I accept your appology :D, but kill the devil in you, nothing good ever comes from him!

This topic really changed to something else, so maybe I should start a new one. The biggest problem is switching the sries connection on and measure the voltage with both cases.

That’s the least of your problems, it’s been answered and isn’t a problem at all. There is no need to disconnect the batteries therefore no need for the switch. I mentioned this for the first time briefly back in post #7. I suggest you scroll back to post #9 and read it again.

Ok, to calirify my original idea and problem and give the solution, I make this post:

Originally I knew that I could not measure the batteries both in series and disconnected one from another because I would have to measure compared to ground (ground was taken as the lower battery’s “-” and I knew that would not work. So I started thinking what would the PCB layer for ground do, can it be used in order to measure compared to it or not, I guess it can not, because its connected to the lower battery’s “-”, even if there are 2 layers for ground they will be connected at 1 point and then connected to the lower battery’s minus. I decided I cant have 2 layers to each of the battery’s “-” because the 2 batteries will be connected in series also and that will be a short circuit if the 2 gorund layers have to connect to each other. (this is from where my ground concept lack of knowledge come).

I finally found the answer here:
http://forum.arduino.cc/index.php?topic=21526.0

On post 2, they mention a virtual ground used for the MCU in order to compare each battery to the MCU virtual ground. This is what I needed, like I though before a separate ground might work.

I intended to use 2 reverse polarity diodes because there would have been 2 circuits, for each of the batteries. I was wondering should there be a ground on the upper circuit as I could not connect it to the lower battery’s “-”. Now I know this: I had 2 batteries and I was thinking of connecting the lower battery;s ground to its “-”, while the upper battery will need a separate ground compared to which I can measure even if the 2 batteries are connected in series it should work? But the 2 circuits would be needed. The dividers on the upper circuit would be with a higher voltage I guess (if there is no separete goround?), because the voltage of the lower battery will be applied also.

I hope these 2 posts gives a good idea of what I was thinking. In my head its like a whirpool, everything is there, but when there is some practical thing missing or concept (like the ground concept, which means that we measure compared to something) it becomes a question like this.

This is the circuit of my original idea. But since I cant use a PCB layer for ground 2 and I do not know how to realize a second ground, I am thinking a virtual ground for the MCU will do the job, (I guess I cant just connect a wire to the metal frame of the battery bank and call it ground, plus it will be dangerous)?

I think you are still stuck on the idea of what a “ground” is. Remember that all potentials are relative. Ground is special only in the sense it is usually connected to Earth, and the Earth provides a fixed potential reference (more or less). For mains equipment, connection to Earth via ground is a very important safety feature.

Usually, your circuit “Ground” is the same as “0V”, but not always. For example, in a live chassis, 0V might be referenced to a mains phase. Never connect that to Earth ground! Or for battery equipment, we often call “0V” ground, even though it is not connected to Earth.

By convention, we call the outputs of a cell 0V and 12V, but the important point is the potential difference of +12V. We could call the outputs -12V and 0V, -3V and 9V, A and B, or anything.

You need to decouple from the idea that 2 cells in series have “two grounds”. Think of it as a power source, with 0V, and two outputs 12V, and 24V. Now, design your circuit to use those 3 voltages, and it becomes straightforward.

Forget about “ground”, there is no need to connect your circuit to Earth, and in fact probably desirable that you don’t.

In this circuit you probably don’t even need a “ground fill”, but if you think you do, use the 0V for the fill.

Recommended reading : https://electronics.stackexchange.com/questions/117892/different-grounds

1 Like

I will read the link you provided, I understand that what you call earth I used to call ground, it was also mentioned in another post (maybe not on this forum). But the idea was that if the 2 batteries are separated and charged separately I can not connect the upper battery’s voltage divider to the lower battery’s “-”, while they are disconnected? Otherwise it would be easy, true.

Also the MCU will be connected to a power supply which is prefered to be taken from both batteries with a voltage dc to dc converter, otherwise I will have to power it only with 1 battery and that will mean they will get discharged and charged unevenly.

EDIT:
By the way the link says this:
They represent different ground types.

The first is “circuit ground” and is a reference point in the circuit against which all voltages are measured.

The second is chassis ground and represents a connection to the metal enclosure the circuit is in.

The third represents earth ground and is a physical connection to the ground under your feet.

3 is often used in place of 1 though.

Also you sometimes get various different combinations of the three representing different ground zones in a circuit (digital ground, analog ground, power ground, etc) at the designer’s discretion.

That means circuit ground and earth ground can be mixed and earth ground can be used as the point compared to which I can connect the MCU ground and measure the batteries while they are not in series (of course only the MCU will be connected to the earth ground, while the batteries have no ground what so ever, only “+” and “-”)?

No, it simply means that sometimes the third symbol is used in place of the first symbol and vice versa. Not the that the types of ground are sometimes swapped.

This is a very basic concept, especially within the scope of your application, you have one ground. Forget the switch, forget about isolating the batteries during charge, and move on. As @bobc mentioned, the rest of the design becomes pretty straightforward after that.

This is my design. Whethear I need to isolate them or not, this should work. If I need 2 grounds, then the black ones must be ground 2 and the white ones must be ground 1, but if it can work with 1 ground than its ok.

This is the other idea with only 1 relay and 1 ground and a permanent series connection.

EDIT:
This is the charger that I will use, it should work even when charging the batteries while they are connected in series.

Description of ABC-1220D FST:
Short-circuit Protection: Charger O / P cut-off automatically when short circuit. Overload Protection: Charger O / P current-limited automatically when overload. Reverse Polarity Protection: Charger O / P cut-off automatically when batteryreverse connection. Automatic multi-rate charging function: Equalizer Charge and Floating Charge. Parallel Operation Available: Parallel with Battery as DC Power Supply operation available. Unique LCD Display: Indicating both charger status and battery level. 3 LED Display: Red (Power On) , Green (Floating charge) and Yellow (Equalizer charge). Advanced SMD Technology: Reliable and Elegant.

Link:
https://www.battery-import.eu/p/fst-abc-1220d-12v-20a

There is an obvious error in your relay layout, which means it will never work, but that is easy to fix.

How often will you be switching the relays? They have a limited number of cycles. It would be better to use a MOSFET. I understand the need for a big cap now!

There is also a BANG possibility if you do not sequence the relays correctly, +24V could be shorted to ground.

It still seems quite complicated and error prone, I would use a simpler starting point, which removes the need for complex switching and bulk caps.

Easier said than done. I think the chargers will work with the batteries in series. So I have to either measure the voltage drop over the resistor with no ground, or use a divider only on the lower battery and the whole 24v bank. A DPDT relay should work when measuring the 24v and lower battery, while never disconnecting the series. If the series are disconnected the other circuit with the SPDT relays should be used. My deadline for finishing this is Tuesday morning so I can’t afford to look for a circuit anymore. If you can suggest how to fix the problems you think might arise, I am listening.

I would use something similar to the second circuit, but use a CMOS switch instead of the relay, also need to adjust the potential divider on the 24V to get within range of ADC input.

Being a software sort of guy I would drop the comparators, and use a couple of pins on the MCU to drive a serial-parallel buffer to drive the LEDS. Or even a single pin to drive WS2812 smart leds.

Coursework question?

The comparators are dropped a long time ago. Everything will be done only with the MCU. Its worst than a course work :D. I know now how not to sleep :D.

The LEDs will be only 4, driven from the MCU pins directly (with a resistor) at 5mA, total consumption 20mA. it will probably take 5mA for driving the transistor or relay so total consumption should be about 30mA. I know that I can use the circuit at the arduino forum, but at the moment I need to fix a few problems with it. its on post #2.

http://forum.arduino.cc/index.php?topic=21526.0

This is the circuit that I will use. I hope the relay works on transfering the voltage and current. This relay in particular looks like its for AC current, will it work for a DC current also?

Tomorrow I will sodler and test it.

If you mean the Finder 32.21 relay then its contact (according to the datasheet) is rated as follows:
Breaking capacity DC1: 30/110/220 V -> 3/0.35/0.2 A (Meaning for 30V at utilization category DC-1 it can switch 3A)

I’m not sure why I’m posting this, nor why you keep posting, you don’t listen to much of what anyone has to say.

Why three regulators? Are both LM2575 supposed to be powered by Bat2? C1 on the LM117 is a really bad idea. Don’t need D4 if you remove C1. D8 will drop your 3v3 down to about 2v6 for the MCU. And there’s still the value of C6, and all those unconnected 3v3 and gnd pins. A small cap on the ADC pin wouldn’t hurt, and remember to wait 50ms or so after switching the relay for the contacts to stop bouncing.

1 Like

I am reading everything you all said. The voltage drop over SK56 will be considered.

The second power supply is 12V for the relay coil (the label is mistaken).

I think LM117 will overheat. C1 is bad because it will discharge into the regulator when the output is shorted and into the output when the input is shorted?

C6 should be 10uF.

The pins do not need to be connected, they are internally connected?

The datasheet says 10mS. The cap will slow down the voltage rise and fall and (100nF) should be enough?

Ever heard of electromagnetic compatibility (EMC)?
There is a reason such chips have multiple GND and VCC pins. Most MCU manufacturers will tell you (in the datasheet) that you need one (or sometimes two) decoupling capacitor(s) per VCC pin. (As near as possible to the pin. Good connection to ground)

But you have 12V available from the battery. Anyway, the inductor value of 100uH is inappropriate for both of those circuits when powered from 24V. Have you looked at the datasheet?

Instead of a relay have you considered something like a TS5A3157?