Celebrating the independent kiwi spirit of invention.

Solar PV: Solar Charge Controller

By Ian Mander, 24-30 April 2019, updated 28 March 2021.



On recent camping trips (Dec 2018 to April 2019) I wasn't particularly happy with the performance of our solar charging setup.

It's mostly due to the panels we were then using being amorphous silicon, which is much less efficient than crystalline silicon panels. They are also quite old, and have probably deteriorated considerably. They are also slightly higher voltage, being ~23.1 V instead of somewhere around 21.6 V peak (36 cells at 0.6 V each), which means a little more power is wasted when they are connected directly to a 12 V lead acid battery.

Also, the two controllers we were using are not very efficient. Indeed, the first time I tried the simpler of the controllers, I got more efficient charging without the controller. However, they provide very important (essential?) battery protection for over charge and over discharge. The overcharge protection is particularly important because of the high voltage of the solar panels. In summer we run the most risk of over charging, when insolation is highest and we can't continually monitor charging, such as if we're underground for many hours. In the evenings when the battery is being discharged for lighting, we need to know if the battery is going flat, especially in winter when we use the lighting for longer and run the highest risk of over discharging.

I've decided to make a list of the desired features of a DIY solar charge controller, with ways to implement those features, with a view to putting one together.

Almost all commercially available LiFePO4 batteries come with a battery management system (BMS) built in which provides cell balancing and protection. No solar storage batteries like to get too hot, so charge batteries in shade, not in a closed tent or car.

Solar Charge Controller Feature Implementation

Selectable discharge cutoff voltage.

Fixed 10.8 V discharge cutoff. There's not much capacity left below that.
LED battery level meter. With the timing conditions it is going to be difficult to use this for anything other than approximate information.



Features easy to implement

These features simply require adding a single item in the right place. (Working out the right place is a little trickier.)

Feature Implementation

Automatic charging will capture the most solar energy. The charging system should not depend on being set going each day; it needs to be ready to go when the light is available.

Automatic charging whenever the solar panel voltage is high enough. I think the panel already does this.

Voltage and current monitoring of solar panel. (The battery charge current will be the same if no buck converter is used.)

Use a dual voltmeter/ammeter in green (for incoming power).

Voltage monitoring of battery.

Use a voltmeter in blue or amber.

Current monitoring of load.

Use an ammeter in red (for outgoing power).
Temperature monitoring of battery.

Use an LCD thermometer.

Sound alarm if battery temperature exceeds 40 °C.

To save a small amount of power, the meter displays could be turned on only when a button is pushed.

Use a momentary button for the voltmeters (double pole switch to use a single switch for both).

It's probably not worth implementing a momentary crossover button to turn on the ammeters (ie, with NC and NO contacts) because:

  • The contact resistance could burn more power than the meter itself.
  • How could an uninterrupted supply of power be ensured when switching?
  • A DPDT momentary switch with a reasonable current rating is $2 for not much gain.

Multiple load outputs individually switchable.

Multi-way switched lighter socket. DONE. I have one which can be used as needed (suitable for light loads).

Short circuit protection.

Add a fuse on the battery output. 10 A, since that's what the ammeter can cope with.

USB charger output.

Use a USB charger which can be put in a lighter socket as needed. DONE. The fridge has a USB socket which serves the purpose.

Need storage pouch when not being used so it doesn't get lost. Could also make the pouch big enough for USB cables. DONE. The fridge cover has two pockets, one of which is now used for USB cables, the other for fridge and 12 V cables.


Features slightly harder to implement

These features require some electronic components, but are still reasonably easy to implement.

Feature Implementation
Temperature monitoring and alarm. Probably use an Arduino Nano with temperature sensors in relevant places.

Buck charging to get maximum power from solar panels (especially 24 V panels). This should allow the charging current to be higher than the solar panel current.

This is a feature of the inexpensive CN3722-based solar charge controller module. It also offers fixed voltage MPP "tracking" (which is better than nothing).

This is almost certainly the easiest way to do it because a simple buck driver will just collapse the solar panel voltage to the battery voltage. However, the CN3722 has a 5 A charging limit – possibly too low for a 100 W PV panel if the charger is converting the power correctly, and quite inadequate for a 200 W panel (135 W seen; 19 V @ 7.1 A).

Another option is to split the 200 W solar panel into its two separate 100 W panels, with each 100 W panel running its own CN3722 charge controller charging the battery in parallel. The solar panels would have to be separated because the fixed voltage tracking is manually set and they would fight with each other is using a single solar panel. (If using a higher current MPPT charge controller the solar panel's existing controller would have to be bypassed anyway.)

Percentage monitoring of battery.

Shane T already has a very good meter showing the charge percentage (except it's affected by voltage sag under load – this would be less of a problem with LiFePO4).

Otherwise, use two dual op-amp chips to have four LEDs (green, green, amber, red) which extinguish at various voltage levels.

Charging cutoff at adjustable voltage.

This is a feature of the inexpensive CN3722-based solar charge controller module.

When solar output falls enough to not be able to hold the relay on there's not going to be much charging happening.

Load low voltage warning at set voltage.

Can be turned off for a single instance only (ie, a latching off-switch that resets when the battery voltage increases over the set point).

Use an op-amp to compare the battery voltage with a reference voltage (Zener diode/s): 11.2 V = 5.6 V * 2.

Connect op-amp output through 100 Ω resistor to base of 2N2222 transistor which turns on a piezo buzzer.

Load cutoff at set voltage.

This cutoff should be latching, so the op-amp doing the comparing should be switched off as well. It should not turn on again when the battery voltage rebounds (which would be really annoying with the auto-resetting low voltage warning buzzer.)

Use an op-amp to control a MOSFET.

The op-amp compares the battery voltage with a reference voltage (Zener diode/s): 10.8 V = 3.3 V + 7.5 V. However, switching everything off at the same voltage the battery is to be switched off doesn't sound like a good idea because the Zener diode will turn off at the same time it's supposed to provide a reference voltage.

Better to use a lower value Zener diode in series with a resistor, and compare it with the midpoint of a voltage divider. This will have the advantage that the current through the Zener diode will be have lower variation between a full charge and flat, and it will allow a potentiometer to adjust the cutoff voltage.

Zener diode Resistor Current
Diode power
4.7 V 330 Ω 18-28 mA 0.13 W
5.1 V 270 Ω 21-32 mA 0.16 W
5.6 V 270 Ω 19-30 mA 0.17 W

With a bit of testing I should be able to get lower current and still have reliable operation. Just a few milliamps would be appropriate to put a power LED in series.

Could also put a capacitor across the op-amp so it keeps working a little longer than the turn-off.

Connect op-amp output to the base of a high current IRF3205 MOSFET through a 5.6 Ω resistor. 10 V = firmly on using next to no gate current, so the op-amp output should work just fine.

Passive infrared person detection to turn on lighting for anyone going to the toilet or getting a late snack.

PIR switch coupled to LED light. Can be turned off. DONE. Bought a solar powered LED sensor light from Pak-N-Save for $25.

This is likely to be quite fiddly to get working well, what with positioning and sensitivity. The Pak-N-Save light does not have any controls for sensitivity or duration, just a switch for brightness.

Select battery chemistry.

When turning on, check if a particular button is pressed. If so, open a battery chemistry selection menu with options for 12 volt SLA, 11.1 volt Li-ion/Li-ion polymer, and 12.8 volt LiFePO4.

This option would only be useful if creating a version for other people to use with their own battery; I'd know what battery I was using it with and program it accordingly.


Features even more difficult to implement

These features require an Arduino, programming, and for most features a user interface with screen.

Feature Implementation
Screen showing PV panel and battery/load statistics.

As a step up from the independent meters mentioned above, an Arduino can be fitted with a 20 character x 4 line illuminated LCD screen which can display the relevant information. Will require current measuring sensors or shunts. Example display:

           1   1   2
1  4   8   2   6   0

PV 22.0V | BAT 13.2V
   0.15A |    -0.72A
  1.23Ah |    1.42Ah
     Eff 87.8%

Are there small LCD screens which would give better resolution for a reasonable price?

The INA219 current sensor uses a 0.1 Ω shunt (a bit high) but can be used for high-side current sensing. However, it has a maximum of 3.2 A; not suitable.

The ACS712 Hall effect current sensor has 5 A, 20 A, and 30 A versions. The 20 A version (actually ±20 A) will do nicely for this job. The minimum division (least significant bit, or LSB) with 10 bit sampling is 0.0488 A. Extra precision can be achieved by oversampling, for example averaging 64 samples to give a 13 bit sample (with maximum value 8184 not 8191), with LSB 0.0061 A – excellent for a 2 decimal place display. The display is not going to update at more than 2 Hz, so 64 samples isn't a problem.

Active MPPT to get maximum power from solar panels (especially 24 V panels).

Genuine MPPT (using something like a perturb and observe algorithm) might not be too hard to achieve using an Arduino to basically vary the resistance of the potentiometer used to set the MPP voltage.

Selectable voltage for charge, float, and discharge cutoff, or select preset voltages for a particular battery type. Temperature dependant; over 25 °C requires lower maximum charge voltage.
Turn individual items on or off at certain times (ie, multiple load outputs on timers). Requires an RTC on the Arduino.



This is getting quite involved. It'll take a bit of time to sort out.

Update 8 November 2021: Maybe I should just buy one of these meters from Jaycar. It measures voltage, current, power, energy. It provides most of the functionality I want in metering.

The product listing doesn't mention that it can cope with negative current, which would be seen when charging (or discharging, depending on how it was wired). However, Jaycar also sells a 24 V, 100 Ah LiFePO4 battery with one of these meters built in, so the meter probably does cope with negative current. Just ignore the "kgs" used in a couple of places in the description. They don't actually mean kilogram-seconds.

For panel type, either of the crystalline panel types should do well. The amorphous panels we are presently using were a great price, but the output is not so good.


Celebrating the independent kiwi spirit of invention.

Return to ianman HOME | Back to Aqualab Home | Return to TOP
Inventions: Super Soaker Backpack | Air Cannon | Car Interior Lighting | LED Torch

* This would have been an ad.

When you buy stuff from Asian sellers:
Please don't buy stuff from a country in the middle of intimidating its neighbours.