Help designing a arduino controlled High current voltage regulator

I need to design a device which can limit high current and can be controlled by a micro controller.
The purpose is to limit the charging current of a high amp lead acid battery.

Perhaps something like a shunt resistor, opamp as a comparator, a pwm output of the uC with an RC filter as an input to the opamp comparator and something like a MOSFET as a switch?
Instead of a pwm pin with RC filter a digital pot meter could also be used of course. I've once made a sort of rudimentary 'configurable' current limiter that way. It worked fairly well.
If you don't want to use a shunt, a hall effect current sensor would be an obvious alternative.

What kind of current are we talking about? And why does the current limiter need to be controlled by a microcontroller? There may be a simpler way to do what you're trying to do.

What I am trying to do is, I have a high amp DC supply, to which I have some loads connected.
On the same supply I would like to connect a 12V lead acid battery for charging.

I am worried that when the battery is LOW it will draw a lot of current to charge itself which will obviously reduce the life of the battery. So I would like to limit the charging current for the battery.

Ohh. also the same battery will become the source when the DC supply is unavailable..

Wouldn't a pretty standard current limiter already suffice, then?

But really, instead of reinventing the wheel, I'd just have a look at the available charge controllers for lead acid batteries. It's likely something can be taken off the shelf that suits your needs.

What kind of a current limiter are you talking about..?

with a readily available controller I do not have much custom options.
like setting battery charging amps according to the battery capacity.

Also building it myself will be fun and I can learn too.

Do you already have the correct transformer, rectifier and filter capacitors?

Basically what I described before, but without a microcontroller to complicate things unnecessarily. So some kind of current sensing circuit (shunt + opamp, or hall effect sensor) combined with a buck converter to limit effective/average current by tuning down the pwm (decrease frequency and/or duty cycle) if the current is too high.

You're not limited to modules; you can start with a single IC as well. A quick google turns up e.g. this one, the Texas Instruments bq24450:
I'm sure there are several alternatives and equivalents. It does pretty much what you need, it seems.
If you look at the datasheet, you'll also appreciate that doing this from the ground up yourself (and doing it right) is actually pretty complex.

Absolutely, but I'd recommend to pick your battles and don't underestimate the complexity of this task. It looks simple, but getting it right will be pretty challenging if you have limited experience. I know I would mess up terribly, that's for sure.

1 Like

I don't understand the reason for asking this.

But with a buck controller isn't it that the input voltage needs to be higher than the output voltage.?
I do not have that option.

I have this old charger which I used to charge lipo batteries.
I wonder how it controls the charging amp from settings.

NB: I cannot find any suitable charger for my application hence build my own is the only option I see.

1 Ohm in series with battery, @12V max current is 12A, car battery can handle that

Not sure what you mean, but I was thinking more in terms of values like 50mR.

1 Like

May be something of a misunderstanding here.

You can not incorporate a microcontroller into the feedback control loop of a voltage or current regulator. Simple as that, it cannot ever respond sufficiently quickly and will be completely unstable.

You can use a microcontroller as a glorified switch to set the parameter of an actual voltage and/ or current regulator. An Arduino (most of them) is not appropriate for this as it lacks a proper DAC. The PWM function is singularly inappropriate as not only is it difficult to map a smoothed voltage from a particular PWM value, but if the code "glitches" in any fashion, the set value can dangerously go to maximum. :roll_eyes:

You really need purpose-designed hardware for this project - and such hardware should be readily available.


Module name :250W boost constant current module

Module properties: non-isolated step-up module (BOOST)

Input voltage: DC8.5V-48V

Input current: 10A (MAX) exceeds 8A please enhance heat dissipation

Quiescent current: 10mA (12V liter 20V, the output voltage, the higher

the current will increase too quiet)
Output voltage: 10-50V continuously adjustable

Constant] range: 0.2-8A

Temperature: -40 to + 85 degrees (ambient temperature is too high, please enhance heat dissipation)

Operating frequency: 150KHz

This is what I intend to do.

I got confused and forgot the relation between current and voltage.

Today just hooked up a load to my bench power supply and set a low amp for the load. What I see is that to maintain the set amp by me, the power supply is actually dropping the supply voltage to the load..
Basic things completely went out of my mind.

Now I just have to control the voltage to the battery to maintain the set amps for charging..

Changed the topic name to Arduino controlled High current voltage regulator.

So what if the voltage vs. charge current relationship of your battery turns out to be different from what you anticipate it to be? Why waste time on setting up a likely non-linear calibration for charge current vs. voltage if you can just control charge current?

Changing your approach to controlling the voltage is conceptually similar to driving LEDs using voltage instead of current - sure, it'll work, but it's a roundabout way. If you want to control current, simply do it directly.
By changing your approach to a voltage control you're not going to simplify matters in the end, and likely the opposite.

How do I control the current to the battery..?

I have a solar MPPT charge controller which is connected in parallel to an independent inverter with battery. The MPPT charge controller can generate around 90amps at the output.

The grid feed to the inverter goes via a relay inside the MPPT charge controller. When the battery is discharged and solar is available in the early morning, the controller puts the 220V load on the grid and charges the battery at a controlled amps, until the battery is fully charged.

Once the battery is fully charged, it will no more draw high amps, hence the MPPT then shifts the 220V load from the grid to the inverter which is then powered only by the MPPT's DC output at high amps.

Now, the amount of time the battery is taking to recharge, the solar generated power is not being used by the inverter, as the amp is restricted to 20amps (can be set on the controller) only.

I want to set the MPPT controller to output full amps all the time and run the inverter from the controller and also use 20 to 30 amps to recharge the battery.
Challenge is, the MPPT controller needs supply from the battery to run itself.

Below is the block diagram of how everything is connected.
RED dotted lines show current flowing to the MPPT controller to power it.

I would like select condition D at the day time and control the amps to charge the battery. The excess current produced by the MPPT controller can be used by the inverter. If the MPPT is unable to produce enough current (due to clouds) needed by the inverter, then the current limiter charging circuit will go off and let the extra needed current to flow to the inverter from the battery.

Challenge is how do I power the MPPT controller while I charge the battery with controlled amps. Also restrict have to restrict current flowing from the battery to the inverter.

The MPPT controller does not power ON until it gets power from the battery.

Many years ago my company built thousands of solar powered battery chargers. They ALL used pulse width modulation to control the current going to the battery. 0 pulse width meant NO current to the battery. 100% pulse width meant maximum current to the battery.
You can do the same to control the current in your system.
I still have a test solar panel and one of the controllers which work quite well.

1 Like

Yes I can do that.. You are correct.. PWM went out of my mind.
But the challenge I am telling you is, then how do I power the charge controller with the same battery..?
Look at the picture below..
BLACK dotted lines shows current flowing to the inverter, and RED line shows that the battery has to power the charge controller but the same power has to be restricted to the inverter.

While I put the PWM charger between the BLACK line to the battery, the MPPT controller has to be powered too by the same battery. How do I solve this..?
Chandan (VU3XCR)

Can I just put in a different perspective?

The OP talks about a lead acid battery. Now, that makes life very much easier, because there are a number of options for managing the battery, one of which may be particularly attractive because it is widely used and very simple to implement.

Lead acid batteries are ideal for "float" charging across the supply rails. The standard float voltage for lead acids is 13.8V for a 12V battery (2.3V per cell). This keeps the cell at around 80% charged, and is just below the voltage at which gassing occurs. The avoidance of gassing means topping up is rarely, if ever, required, and for sealed batteries it extends their life enormously.

Lead acids in this configuration have been used for over a century for things like electric clock systems in offices and factories, telephone exchanges, uninterruptible power supplies, and so on. Good quality wet lead acids can have a service life of decades; sealed batteries are less, but typically last several years (provided they don't get hot).

The charging system is simple to implement. Assuming a 12V system, connect the battery to a current-limited voltage regulator set at 13.8V (scale for other voltages). Then connect the load across the battery.

Typically you can set the current limit in amps to one tenth of the battery's Ah rating. For example, with a 5Ah battery, you would limit the charge current to 0.5A. There is no problem increasing this if the demand from the rest of the circuitry is high enough to gradually flatten the battery.

These days the easiest way to achieve what I've described is to use a variable-voltage switching regulator module; Banggood have dozens of them. Very few have variable current limiting built in, so just buy one with a current limit that's about right, or a bit higher, using the approach described above. Set the output voltage to 13.8V, then dab some paint on the adjustment pot to stop it being moved accidentally.

It is far easier than trying to build your own microprocessor-controlled device.

NOTE: As far as I know, only lead acid batteries (and super-caps) are suitable and safe for float charging in this way. So don't try this with other types of rechargeable batteries.

1 Like