Notifications
Clear all

Multiple buck converters using a shared ground

56 Posts
7 Users
29 Likes
2,503 Views
(@iwannastout)
Noob
Joined: 1 year ago
Posts: 14
Topic starter  

So I have a project to power my rPI and some other devices, such as 3.3V, 5.0V and a source voltage of around 12V in a camper to monitor the BMSs.  I know I need a level converter between the devices with different TTL logic levels.  So I was going to connect the ground wires together from the multiple buck converters to all the devices.  Any concerns about doing that?  


   
Quote
Topic Tags
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 

The hardware experts will chime in soon, but I believe you must ground them all-together... if it sounds like the rPI will be talking through serial, I2C or SPI and physically connected.  Now, if you're going through all the trouble of doing the optical isolators between logical devices, then the buck converters can be on separate grounds.

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6979
 

Posted by: @iwannastout

So I have a project to power my rPI and some other devices, such as 3.3V, 5.0V and a source voltage of around 12V in a camper to monitor the BMSs.  I know I need a level converter between the devices with different TTL logic levels.  So I was going to connect the ground wires together from the multiple buck converters to all the devices.  Any concerns about doing that?  

I just moved out of my 42ft RV and it had all kinds of devices I built and a few builtin. In some cases grounds were connected together when in close proximity, but since the entire RV was a giant UPS it didn't really matter, there was only one path from the batteries, and one path back. I am sure you will get some other views from folks based on some theory or the other, but I never had a problem. I used to be an industrial electrician in my youth so I have a very healthy respect for electricity, but in the RV I could not see any problems. I did NOT use the frame for ground even though it was connected to the negative bus bar. I have no strong reason for that and I am sure it would work,but my gut said it wasn't worth taking any kind of chance. The risk was if the AC wiring somehow got connected to the frame it would be possible but still unlikely to create a circuit through a human that was a little dangerous. We are lucky in North America that the original designers went with the much safer 120V system unlike much of the world with it's 240V system so that the risk of fatal shock is much reduced but not totally eliminated.

The rules for a boat are VERY different as one has to guard against galvanic corrosion (also in an RV but much less so) and the rules for a residence are also very different.

BTW, in my RV I used marine grade devices (breakers, connectors, bus bars) as much of the circuitry and devices are semi outdoors at least.

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1689
 

Hi @iwannastout,

   Answering a question like this, without seeing a full circuit is a bit like being the first to play in a round of Russian Roulette knowing there is a bullet in every chamber, because there are so many variations on what you may have designed. And even when you do have full circuits, etc., you can be sure at least one chamber still has a bullet left!

So please treat this like a hint guide, with all of the responsibility still on you.

----

Please also note, this mini-discussion is considering the needs of typical analogue and digital circuits to minimise the chance that noise (temporary, short term changes of potential at a point) on the ground line causes them to fail to work properly.

It is not about grounding to minimise the risk of shock in the event of an electrical fault, although it is common for the grounding scheme to also be required to meet such requirements.

----

Unless your circuit has 'isolating' parts which are designed to provide a degree of electrical isolation from each other, then it is likely the entire circuit will 'want' to regard all of its voltages are with respect to the same '0' V potential, often named 'Ground' or similar. In this case it is logical if you have two or more units to connect, they will all want to be connected to the same 'Ground'. I'll try to hint how to do this in the next section.

Typical 'isolating' parts include relays, opto-isolators, transformers with isolated windings. Having any of these types of parts does not automatically mean that the grounds will be separated, but are more like 'red flags' indicating you need to study the system very carefully. It may be intended that the grounds remain separate!!!

Grounds may be intended to be kept separate for safety, or to minimise electrical noise, or both. Be careful!

---------------

Connecting multiple grounds

When building a unit with multiple supplies, having decided all of the grounds should be connected:

A general principle is to identify a single point and connect all of the grounds to that point. This central point is known as a Star point. This is not a universal solution to all problems, and you will find many commercial circuits that may not appear to follow it, but it is a good 'rule-of-thumb' to get started with.

There is lots of stuff on the web to explain this more fully, I'll just give a flavour.

Note many of the available articles describe planning a printed circuit board, which may not sound relevant if you are using discrete wires. However, connections on a printed circuit board are not 'magic, they are essentially 'flat wires', and as such have the same problems.

---

The following schematics are borrowed from https://www.analog.com/en/analog-dialogue/articles/staying-well-grounded.html

image

If you start with the lower diagram, you will see two supplies (shown as cells VA and VD, but actually indicating any source of power), and two different load circuits (in this case, with Analog and Digital labels), but again these could be any two loads.

Note that VA is connected as a loop with the ANALOG Circuit and VD is connected in a loop with the DiGITAL Circuit.

In other words, all of the current from VA (that IA) is consumed by the ANALOG Circuit, and similarly VD with current ID and the DIGITAL circuit.

To keep the two circuits at the same ground potential, the grounds of all of the supplies and loads meet at one physical point ... the Star Point.

-----------

The upper circuit shows a bad circuit. It is ad because some of the Ground return wire is shared between the two loads. This means if (say) the digital circuit has a large transient current change, then the resistance and inductance of the shared section will cause a voltage change at the 'ground' of the Analog circuit, and be perceived as an input signal.

------------

Whilst it is necessary to connect all of the grounds together, it is also important to ensure the connection only occurs at one point. Otherwise there is a danger of creating a 'ground loop'. Anyone who has frequently connected audio amplifiers with multiple'assorted' input circuits like microphones, guitars, etc., especially if they have 'extra' items, like control panels, tape decks, etc.  will be familiar with the mains hum pickup problem when the ground is connected twice, e.g. once with the signal cable, and a second time with an earth in the mains cable.

------------

To make life even more confusing, it is not unusual to break one or more of these 'rules' and find the circuit still works .. typically it will continue to work until it can spot a moment that will cause the most embarassment or inconvenience ... 😊 

===========

Sorry this is a long and somewhat abstract answer, but this is one of those areas that looks trivially simple, yet can be really difficult for even experienced engineers at times.

The reference I used is from Analog Devices, one of the largest analogue chip manufacturers, and the same article starts:

Grounding is undoubtedly one of the most difficult subjects in system design. While the basic concepts are relatively simple, implementation is very involved. Unfortunately, there is no “cookbook” approach that will guarantee good results, and there are a few things that, if not done well, will probably cause headaches.

-----

Best wishes, be careful and good luck, Dave


   
Inst-Tech reacted
ReplyQuote
(@iwannastout)
Noob
Joined: 1 year ago
Posts: 14
Topic starter  

Good point DaveE, I didn't really provide enough details on what devices and such, so it is difficult to give an answer.  I get that.  I think the general answer of "tie the grounds together" makes sense.  The BMSs have a 5.0V TTL UART port, and I could wire them up to USB to TTL adaptors connected to the rPI, so that shouldn't be an issue.  The quad relay board is also 5.0V TTL and 5.0Vcc and I originally was going to have that connected to an Arduino.  Then have the Arduino talk to the rPI, so that might require some level shifting if I use the on-board UART of the rPI.  I might have to re-think that setup, as it seems overly complicated.  Initially, I was thinking of using I2C to connect up a bunch of sensors and relays, but soon realized that I2C does not work well over about 1M in bus length.  I think the next step is to figure out what type of monitoring and such I want to do with the rPI first.  Then figure out if I have enough ports to interface with all the devices.  Thanks DaveE, Ron, and Inq for your replies.

 

-Mike


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1689
 

Hi @iwannastout,

   Seems like you have made some progress, which is good start!

I am not sure if I have explained it clearly enough, but whilst the first half of my diatribe was about deciding if the 'grounds' should be connected at all, whilst the second half was how physically to tie it together.

I recommend you draw out a circuit diagram of what you intend to do. That will also help to clarify things.

If you wish, put a copy of the drawing on the forum .. it may solicit some useful comments.

If you draw a schematic, try to 'emphasise' any physical arrangements, in the way the drawing I showed did:

image

 By all means be artistically creative, but add some comments to explain the unusual bits, even if you are the one who sees it ... what is clear as day now, may become as clear as mud in short while!

6 wires coming together at one point like that is not the 'classic' style.

(The 'classic' schematic style normally only allows 'T' junctions, because an '+' junction with a blob at the centre to show the wires are connected is easily mistaken for two wires crossing, but isolated from each other.)

----------

I can't see where you say how long you need your I2C bus to be, plus I would need to do some checking for 'precise' details, and even then the Philips sheets on I2C include advice that amounts to 'prototype it and see', but you can stretch I2C 'somewhat', but be prepared to do some experiments and measurements. Sometimes, very cheap tricks like adjusting the pull up resistors may be enough to stretch the capability, but even I2C elastic breaks at some point. Certainly you should be careful to check the pull up resistor situation if you are attaching more than 1 peripheral to the same bus ... you are creating a transmission line. You probably appreciate this, but if not, start reading and asking.

Philips originally developed I2C as an 'add-on' they could attach to each of their chips to make a colour TV, which only required 2 pins/wires (plus the ground pin that was already there), so that the chips could talk to each other, without making the chips appreciably more expensive. Hence the bus length only had to span the inside of a large television set. But since then, ther can be few chip manufacturers who haven't produced a chip that used it, and of course every boundary has been stretched to beyond breaking point.

Companies like Philips, when they write their data sheets, etc., expect engineers using their products to have access to test equipment like oscilloscopes, which you might not have. Whilst I am not saying a 'scope is essential, your brief project description suggests it would a useful tool to have, to help you see what is going on, and hence guide any improvements and remedies! (Just mentioning  ... I don't get commission or anything!)

I also recollect, there used to be I2C 'extender' chips, though I don't know if they are conveniently available now.

Plus, I2C trasmission rates are 'flexible', so that if speed is unimportant, you might be able to trade speed for wirelength. (e.g. Relays don't need more than 1 or 2 messages a second each, so a few milliseconds extra isn't likely to be noticed.)

I2C can also be made to span 5V <--> 3.3V, so (for example) the processor might be 3.3V, but the load/sensor 5V. Again Philips published a handy note showing a circuit with a FET and two resistors, to achieve this spanning, and clones of it are widely available from all of the usual sources for I2C peripherals, etc. I haven't tried it, but using the link might reduce the effective range a bit, so bear that in mind.

Best wishes, Dave


   
Inst-Tech reacted
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6979
 

@davee I lived full-time in an RV and installed numerous MPUs and MCUs. There is NO need to connect the grounds. Each individual project has either a wall wart to convert 120VAC to 5VDC or even 12VDC, or the buck converter is taking the RV main 12VDC and producing 5VDC. Each of the individual circuits has a positive leg and a ground lead. In the case of the 120VAC wall wart, it likely came from a 3,000-watt inverter fed by the same 7,200-watt-hour battery bank. I did take care to run discrete negative wires as opposed to using the steel frame of the RV, even though it was hard-wired with 4/0 welding cable to the most negative negative battery post via the master 12VDC negative bus bar.

A lot of the theory you learned in school is not real world. In my case, almost everything I was taught about electricity has been rewritten. Fortunately, the old rules still work. I have never used an opto isolator in my life, and that includes when I worked with generators that stood over 12 ft tall, constant current panels mounted to 4 inches of carbon, etc. Mind you, I didn't touch anything without first touching it with my meter probes. I often metered the enclosure frame to the ground, just in case.

I know in the UK with your dangerous 240VAC, you have to exercise extreme care, and maybe we in North America, with the safer 120VAC, might be a little on the lazy careless side, but in this case, that is not the case; this is just 5VDC or even 3.3VDC, as long as the electrons flow out the positive post and back in the negative post, that is all that matters (I know now you say the holes flow out the negative and back in the positive, but it all works doesn't it)

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2532
 

Posted by: @zander

as long as the electrons flow out the positive post and back in the negative post, that is all that matters

Interesting, I always thought that electrons flowed from the negative end towards the positive end.

 

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6979
 

@will It depends on when you went to school. Now I hear it's not even about electrons or holes as we called them but about a field that surrounds the wires. It's interesting, but as long as you use the same theory consistently, all your calculations will work. I can still remember one of my high school electronics teachers walking through a door backwards to explain how either direction of flow works as long as you apply the rules consistently. We just happened to be in that era when electrons flowed out of the positive post.

Now let's wait to see if Pastor Dave has a completely different approach. I for one will not be surprised if he does. 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2532
 

@zander 

Yeah, I learned it as electrons (having a negative charge) are attracted to the positive terminal. So electron flow and 'classical'  current (aka holes) flowed in the opposite direction.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6979
 

@will So, does that mean that Dave's diagrams are all upside down? If the current flow is as you suggest from the Negative to the positive, why do we talk about ground loops? Why is ground also known as common? Why did we fasten the black negative wires in a radio chassis to the metal frame of the radios? (That last factoid I KNOW I remember)

If something is flowing out of the positive post (which must be true given the chassis argument above), then what is that 'thing' called that is flowing from the positive post? 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2532
 

@zander 

You got me wondering ... so I Googled it ...

Screen Shot 2023 09 10 at 5.04.40 PM

 

 

Anything seems possible when you don't know what you're talking about.


   
DaveE reacted
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6979
 

@davee The upper diagram is simply wired wrong, the digital circuit is supposed to go to ground or common after passing through the R and L circuit.

Screenshot 2023 09 10 at 20.12.23

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1689
 

Hi Ron @zander,

 Sorry, maybe it is my fault for not explaining clearly enough, although I did clearly say about my note "It is not about grounding to minimise the risk of shock in the event of an electrical fault, although it is common for the grounding scheme to also be required to meet such requirements."

 

To be clearer to everyone, all of the references to 'Ground' in my note above, do not mean something connected to a rod in the ground ... or the 3rd pin in a mains socket that may be called any of Earth or Ground or Protective Earthing Conductor or ?, depending upon local conventions.

I was referring to the '0V' ground terminals (often written GND for space reasons) you will find on most processor/sensor/power supply/etc boards. The questioner also used the term ground (RE: Multiple buck converters using a shared ground)

Sometimes, but by no means all cases, usually depending upon the power supply design, the Ground that I was referring to, will be connected to the local mains earth (or local name etc), but it is not necessary from the functions that I was considering.

----------------------

Optocouplers are very commonly used ... many, though by no means all, desktop power supplies use them, as do the higher power stepper motor drivers that come packaged in a box, that regularly appear for discussion on these pages. The latter I have explained at least twice in some detail are a case when NOT all 'GND' wires of a system should be connected together.

Transformers, relays and optocouplers are all used in a variety of different circuits .. sometimes their presence is to do with isolation for safety reasons, sometimes to control electrical noise, and other times they are simply the cheapest way to connect two things operating at different voltage potentials. As I said, their presence does not indicate a do A, never B type of choice, but rather, this circuit has a trick or two up its sleeve for the unwary ... make sure you understand it before connecting every point called 'ground' together.

========================

As for the circuit snip I showed, the upper circuit is indeed wrong ... it is labelled INCORRECT as a demonstration of how NOT to do it.

But from your comment, maybe you misunderstand what the resistance and inductance is in the return line represents.

image

These are not physical components, but representations of how a wire will actually behave. That is every conductor (excluding superconductivity) will have a small, but finite inductance and resistance.

At mains frequency (50/60Hz) the inductance effects are only significant at relatively long wire lengths ... a few centimetres/inches of wire has no visible effect. If the current is appreciable, then even a short wire at 50/60Hz has a voltage drop.

But the discussion refers to analog and digital circuits, so the frequencies are likely to be much higher ... WiFi for ESP chips is 2.4GHz, desktop and graphics processors are heading to around 5GHz, and the harmonics of each go much higher. At these frequencies, 1mm of wire is substantial inductor. Plus the current pulses for even small transistors can be several amps peak, so tiny fractions of an Ohm resistance can easily result in voltage drops of a volt or more  ... easily enough to confuse a 3.3V logic system, whilst an analog system may well be confused by voltage changes of a millivolt or less.

---(And thanks @will for your valid point.)

Best wishes my friends, Dave

 


   
Inst-Tech reacted
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6979
 

@davee I think we agree, but not positive. The OP like myself will or may have several 'projects' involving MPUs, MCUs, sensors and buck converters. Each is a complete circuit where power flows from the positive to the negative or zero or ground or common, call it what you will. There is NO reason why circuit A and circuit B need to share the 'ground' except they do since they all end up logically back at the same place as does the positive.

In other words, just wire up circuit A as if it was the only circuit, then do the same for circuit B. There is no reason to combine the 'grounds' because they already are combined at the negative battery post if using battery, or if using wall warts or other DC voltage converters then they are separate with no need to be commended. Clear?

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Page 1 / 4