Question about buck converter & common ground

I'm currently trying to measure the amps being pulled from 4 12v batteries connected in series (48v) using an Arduino. In order to do this, I purchased a shunt that will be connected next to the negative terminal of the batteries, which I will measure the voltage across using my Arduino to find out the total amps being consumed. The problem is, the Arduino can't be floating for this to work, and so needs to be a part of the same 48v circuit as the shunt. Obviously the Arduino can't take 48 volts, so the solution I came to is to buy a buck converter which will lower the voltage into a range that the Arduino can tolerate (there will be other components attached as well). My question is, if the Arduino is connected to the converter in this way, will it still be possible to simply read in the voltage at the shunt as if the Arduino was wired in directly? Phrased another way, is connecting to the output ground of the converter the same as connecting to the negative terminal of the batteries?

A 400W buck converter is a tad excessive for powering an Arduino!

You have to be careful with this. The negative of the battery is the most negative point in the circuit, so is the end of the shunt connected to the battery. The other end of the shunt is positive with respect to the battery negative so needs to go to the Arduino analogue in. That means that the Arduino ground has to go to the battery. Is the shunt converter ONLY powering the Arduino and nothing else? If so you are fine as its negative will be connected to the battery negative and the Arduino ground. However, what you have is a negative for the load you are measuring that is positive with respect to the battery negative, so that ground of the load is NOT the ground of the Arduino. That means you can't just connect other parts of the load to the Arduino as they don't share a common ground.

A circuit diagram of what you are proposing would be very helpful, hand drawn and photographed is fine.

Thanks for the quick reply.

A 400W buck converter is a tad excessive for powering an Arduino!

Good point, I haven't purchased the converter yet, that was just a random one I pulled up on Amazon.

However, what you have is a negative for the load you are measuring that is positive with respect to the battery negative, so that ground of the load is NOT the ground of the Arduino. That means you can't just connect other parts of the load to the Arduino as they don't share a common ground.

Sorry, I don't quite understand. Would you mind elaborating? Attached is a very crude "schematic" of what I'm thinking if it helps any.

Attached is a very crude "schematic"

It's fine, much better than your description, thanks.

If it helps any.

It helps a lot!

Right, to measure the current you need to measure the voltage across the shunt. As you have it are not doing that. To do that the Arduino -ve needs to be connected to the battery end of the shunt and Ain where you have it. As the Arduino -ve is connected to the battery then so must be the converter -ve. That means you are not measuring the current supplied to the converter. What are you trying to measure? Are you trying to measure current to the converter that supplies the Arduino? Or are you trying to measure current supplied to another load, which you have not shown?

Sorry, forgot to include the load in the picture, should be fixed now.

That's better.

That will work and measure the current supplied to the load. It won't measure any current supplied to the Arduino, but I'm guessing that's not an issue.

Be aware of the following:

I am assuming, as is generally the case, that the -ve supply to the converter and the -ve output of the converter are the same, as in, they are connected together at the converter.

When you build the circuit remember that the wires also have resistance and will drop voltage. If you construct the circuit exactly as drawn you won't get accurate current readings because the Arduino -ve is not connected directly to the battery end of the shunt, so you end up measuring not just the voltage across the shunt but also the voltage across the wire carrying the current to the shunt. To get round this you have wire it so that all the negative wires physically meet at one point, so the battery negative, the shunt negative, the Arduino negative and the converter negative all join at a single point, and ONLY at a single point physically.

Have you considered what happens when you charge the battery? The current will flow the other way and IF you charge through the shunt then Vin will be negative with respect to the Arduino ground. If you don't charge through the shunt then this isn't a problem.

So, if I'm understanding correctly, the input and output negative terminals are equal on most converters, and so I should be able to simply measure the voltage from the positive end of the shunt without making any other special preparations (aside from taking the resistance of the wires into consideration, which I'll make sure to do, thanks), right? As for charging, I don't think it will be an issue, the batteries will be charged by some solar panels that will be connected to the batteries in parallel with the load shown in the previous drawing, so none of the charge current should pass through the shunt. (?)

So, if I'm understanding correctly, the input and output negative terminals are equal on most converters, and so I should be able to simply measure the voltage from the positive end of the shunt without making any other special preparations (aside from taking the resistance of the wires into consideration, which I'll make sure to do, thanks), right?

Correct.

The batteries will be charged by some solar panels that will be connected to the batteries in parallel with the load

If by that you mean that the solar panels will be connected across the load rather than across the battery then no, that's no good as the charging current will flow through the shunt the other way and make Vin negative with respect to Arduino -ve. Also, you will then only be measuring the net current supplied by the battery, not the current to the load. You need to be clear about which current you want to measure. You could measure any or all of the following:

  • The current supplied by the battery.
  • The current supplied by the solar panels
  • The current supplied to the load from the battery
  • The current supplied to the load from the solar panels.
  • The current supplied to the load.
  • The charge current to the battery.

For the way you have it the solar panels should be connected in parallel with the battery. Would I be correct to assume you have a 24 cell lead acid battery? Lead acid batteries need 2.2V per cell to charge, or very close to that. You can't just stick a solar panel across them and hope for the best, you need something to take the output of the panels and convert it to 52.8V. I believe such things exist ready made, but I've never had one.

Sorry, it's possible I'm using my terminology incorrectly. I should note since I haven't already that I'm one individual working on this project out of several, and my primary role in it is doing data retrieval and monitoring, and with a background primarily in programming, it gets a bit fuzzy for me when I delve deeper into the electrical stuff. That aside, the current setup involves several solar panels connected in series which are then connected to a charge controller, which converts the voltage coming off of the panels into something the batteries can handle. The charge controller is then connected to the batteries. I've attached an expanded picture that shows this. My goal is to measure the current passing through the side with the load. I can't say for sure what kind of batteries we're using exactly, but I do know that it's 4 12v lead-acid batteries connected in series.

Full charging 12V LA batteries takes at least 13.6V times 4 in series = 54.4V. What is the max current expected through the shunt and it's resistance? You need way less than one Amp @ 5V (5 Watts) for the Arduino.

flylamp:
Sorry, it's possible I'm using my terminology incorrectly. I should note since I haven't already that I'm one individual working on this project out of several, and my primary role in it is doing data retrieval and monitoring, and with a background primarily in programming, it gets a bit fuzzy for me when I delve deeper into the electrical stuff. That aside, the current setup involves several solar panels connected in series which are then connected to a charge controller, which converts the voltage coming off of the panels into something the batteries can handle. The charge controller is then connected to the batteries. I've attached an expanded picture that shows this. My goal is to measure the current passing through the side with the load. I can't say for sure what kind of batteries we're using exactly, but I do know that it's 4 12v lead-acid batteries connected in series.

That's fine.

Lead acid batteries are capable of generating very large currents into short circuits, which can be dangerous as it can result in fires and other serious damage, not to mention spontaneous uncontrolled battery disassembly. For this reason you need a fuse somewhere, and I suggest the best place is in the link wire between any 2 of the 4 batteries. The fuse should be HRC (high rupture capacity), which are the ones filled with sand. The reason is that 48VDC doesn't like to be interrupted and will draw an arc when the fuse blows. The sand in HRC fuses is there to quench the arc.