# Solar Battery Charge Controller

#### lapa678

##### Junior Member level 1
Hi There!

Inspired by lack of electricity on my camping site, I am trying to put together a DIY solar battery charger. At the first attempt, I will try to do something simple.

Here is the concept I have in my head:

Since analog electronics are not my strong side, I have few questions:
1. Some solutions use only MOS key to connect solar panel to battery and load. Is that valid solution? Solar Panel provides 18V, while for charging rather 14V is needed. My gut feeling is to put converter there..
2. Do I need to use Buck converter if I have Battery? Arduino could do the PWM and control of Voltages/currents, but since there is battery, I guess the only thing needed is making sure that Battery does not go below ~12V.
3. Do I need MPPT? I would say that making sure Solar panels don't go down on output voltage is enough (i.e. by using PWM) - I don't need max power there.

You input will be very much appreciated!

Cheers!
Tomasz

#### FvM

##### Super Moderator
Staff member
Consider that solar cells have constant current characteristic.

With suitable voltage, they can be directly connected to a lead-acid battery. You need means to disconnect the cell to avoid discharge at nighttime and overcharge if the battery is full. Voltage converter with MPPT control algorithm improves charging efficiency.

#### HighTechPower

##### Newbie
2. Do I need to use Buck converter if I have Battery? Arduino could do the PWM and control of Voltages/currents, but since there is battery, I guess the only thing needed is making sure that Battery does not go below ~12V.
Using microcontroller on secondary side while PWM IC on primary side in a battery charger design built around flyback topology, I found that current control is a bit tricky and needs deep understanding how to design hardware and code well otherwise current overshoots.

#### treez

Yes, do a Buck converter, and close the loop on the input voltage, at that voltage that means max power is being delivered...i think its 90% of open cct voltage.

Have another error amplifier acting as a current clamp, so your current cant go higher than X amps...the current clamp will kick in if the current trys to go above X amps...........(the input current).

I think youll need a diode too...or a PNP switch, since otherwise the batt can discharge through the internal diode of the hi side nfet when the buck is disabled at night (if your buck uses a hi side nfet)

#### Easy peasy

mppt is essential to get the most out of your solar panel ...! easy to program though...

#### lapa678

##### Junior Member level 1
Hi guys & thanks for your feedback!

@FvM: since it is OK to have direct connection of solar panels and battery, one of the variants I will do in near future is as per This Link.

BUT, I quickly put together Buck Converter from components I have, resulting in this:

Works!

But I am lost a bit in logic of charging ... using PowerPoint engineering I came up with this:

What I would do is the following:
- Buck provides 14V for charging.
- If current from Solar panels drops to ~zero, battery is full, stop Buck.
- If the voltage on battery is lower than 12 V, shut down load (but will it reach 12V is Buck will be set to provide 14?)

Does it make sense?

Tomasz

#### treez

Stop charging the battery when it gets to about 14V, yes.
The current from the solar panels will only go to zero when either..
1..its night
2...You not drawing any current from it.

If battery drops to 12V....just keep charging it i would have thought..no need to switch the load off.........if battery falls to 11V, then yes, somethings wrong....so switch the load off, and charge it up the battery.......if it refuses to go above 11v after being on charge for much time (when there was also no load on the battery) than the battery is dead.
--- Updated ---

If you like i will send you schem of input current clamped Buck...set up for MPPT...ie , to regulate its input voltage to 90% of its O/C voltage......but only if you want it

Last edited:

#### lapa678

##### Junior Member level 1
Stop charging the battery when it gets to about 14V, yes.
The current from the solar panels will only go to zero when either..
1..its night
2...You not drawing any current from it.

If battery drops to 12V....just keep charging it i would have thought..no need to switch the load off.........if battery falls to 11V, then yes, somethings wrong....so switch the load off, and charge it up the battery.......if it refuses to go above 11v after being on charge for much time (when there was also no load on the battery) than the battery is dead.
--- Updated ---

If you like i will send you schem of input current clamped Buck...set up for MPPT...ie , to regulate its input voltage to 90% of its O/C voltage......but only if you want it
Hi there! Thanks, noted!

And yes, if you could send the schematics, I will be very interested to take a look/analyze and borrow good solutions :>...

Cheers
Tomasz

#### treez

OK, here is solar buck in LTspice. (convert to .asc then run it)

Here i have only put the input voltage error amplifier....i will later add the input current clamping error amplifier (unless you beat me to it).

I assumed O/C solar cell volts = 18v..then the MPPT reg voltage will be 16.2v.

Also, i have out the battery voltage to 12v...if i put it to 13.9v...then with MPPT, that means a duty cycle for the buck of 13.9/16.2 = 0.85...that is a very high duty cycle and many constant frequency controllers cant do that.....so i will also come back later and convert it to a constant off time buck...then it will manage easily this high duty cycle.

#### Attachments

• 6.8 KB Views: 6

#### treez

...as you know, the duty cycle limited , constant frequency buck will still work when vout is close to vin, but it will go into dcm and you wont be able to deliver as much power.

BTW, attached is what was delivered to Tomasz in the post above. I was going to add another error amp to clamp the current at 3Amps or so, and convert it to constant off time, so will do this soon, unless Tomasz beats me to it.

I did cheat and use a behavioural source for the hi side drive.......but a bootstrap can be added for that or whatever, or a special buck chip incorporating it......i can't think of a cheap one off hand, only more pricey (but very good) linear.com ones.

#### Attachments

• 26 KB Views: 7
Last edited:

#### lapa678

##### Junior Member level 1
Hi!

I'll be short - thanks for you input. Indeed I might borrow few things.

For now I will keep doing engineering, and considering holidays period, I might take some time. I might come back to you in September when I have my PCBs populated.

Anyway, for thanks to all for your input! Very interesting!

Cheers,
Tomasz