Solar Power Supply with Battery Charger

I've installed a central DC power supply at my home. The goal is to replace the tons of wall warts (for lots of dc-powered devices like NAS box, internet router, ...) by point-of-load dc/dc converters. These dc/dc-converters require an intermediate power supply rail of about 12 ... 36 Volts DC. I've chosen a 19V supply rail, just because it's easy to buy decent notebook power supplies that fit my needs. Those power bricks have a reasonable efficiency (88% ... 90%) and low cost.

Starting off that intermediate voltage, it's quite possible to build highly efficient dc/dc converters to supply the devices with their typical supply voltages (e.g. 5V, 12V). It's possible, although not yet done, to achieve better total efficiency than using their own wall warts. Especially the 5V ones often show up with rather poor efficiency.

Since I've installed a spare solar panel on top of the garage, I also want to take advantage of the available solar power to save energy. The solar panel peak power rating is well above the power reuirement of my DC power rail, so I want to be able to conserve the excesse power for the times of day with lesser sunshine. As you might guess, I'm using a battery pack for this purpose. This kind of Li-Ion battery packs is sometimes available at your favourite electronics scrap yard, they're sold after one or two years of use due to maintenance intervals of medical equipment.

Roughly I've got the following requirements for my central DC power supply:

  • Provide up to 80 Watts of electrical power to a 19V rail
  • If no other source is available, use a notebook power brick as the power source
  • If there's sunshine, take the power from the solar panel
  • If there's excess power from the solar panel, charge the battery pack
  • If the battery is charged and not enough solar power available, use the battery to supply the power rail
  • Provide some level of redundant and uninterruptible power supply for the devices
  • Provide some protection against failures and short circuits
  • Achieve a reasonable level of power conversion efficiency
  • As you might imagine, building such a thing is not a trivial task. Indeed it took quite a lot of time to finish it, the firmware undergoes still some optimization and bug hunting.
    But let's start with the basic concepts: The thing will have three power sources

  • The solar panel
  • One (or more, just for redundancy) notebook power bricks
  • The battery pack
  • and three power sinks:
  • The 19V DC rail
  • The battery pack
  • additionally I've provided an output that turns on if there's still excess power from the solar panel available.
  • All of the sources and sinks operate at different voltage levels, so I need to provide some means of dc/dc converting. I've build two synchronous MOSFET half bridges. These are able to operate "both ways", beeing able to convert a lower voltage to a higher voltage and vice versa, just depending on the pwm control signal.

    Since the power brick operates at the same voltage as the DC rail, this one is the easiest. I've provided ideal diodes to prevent reverse current flow on the input side. On the output side, there are some fuses and self-protected high-side switches. Fits nicely on a rather simple PCB: DC input and output board, top and bottom view.

    To control the flow, I've used a STM32F303 microcontroller. Additionally on this board: some step down converters and LDOs to provide internal voltages (12V, 5V, 3.3V).

    Not obvious, but required for the operation of the DC/DC conversion and also for power monitoring: Sense amplifiers for voltage and current

    To put all of these together, I've needed some kind of strategy. First I've drawn a Block Diagram of the hardware and a State Diagram for the software control flow.

    Regarding the hardware side, I've decided to build up the modules onto a hand carved base board. Not beeing tired of building one of these monsters, I did another one for testing purposes. This one is somewhat different than the real one, but still provides a valuable test system for firmware development.

    For testing purposes (the sun just didn't shine while I was working on it, maybe it's because I was working on it in the evening and night hours), I've build a simple solar panel simulation. This little board works as an external controller for a lab power supply, just in case you've missed the power transistors etc. on it.

    On the software side, I use my proven STM32 makefile template.
    Look here: The STM32 files for my other STM32 related pages.

    Block Diagram
    State Machine
    Controller Schematics
    Converter (Half Brigde / Synchronous Buck) Schematics
    Startup / Load Test Current Sink Schematics
    Ideal Diode and Output Circuitry Schematics
    Solar Panel Simulation Schematics
    Voltage and Current Sense Amplifier Schematics
    MOSFET Switch

    ... und ein Zaehlpixel hab ich auch :-)