Thursday, August 4, 2011

Solar Controller - Battery Voltage Sensor























As promised, the first post that details how a solar controller board works. First here's an overview of what the controller does. A Solar Controller, or a Solar Charge Controller, is a bunch of electronics and code that control the storage or use of energy created by a solar panel.

The controller ensures that the battery* doesn't get overcharged or doesn't over-discharge. Both conditions will either ruin or shorten the life of the battery. The controller can also determine when to run the load. The load, is the work being done. E.g. a set of lights that run at night or a pond pump that runs during the daytime.

The functions of the controller can be broken up into discreet sub-sections, each that perform a specific function.

The first section I'll cover is the battery voltage sensor. You have to be able to know what voltage the battery is at before you can begin controlling that voltage.

Battery voltage sensor: This block get's the battery voltage into a state that can be understood and measured by the microcontroller. It's mainly just a voltage divider (http://en.wikipedia.org/wiki/Voltage_divider) that divides the battery voltage down so that the uC can read it safely.

If you put in a voltage that is greater than the supply voltage for the microcontroller (in this case 5V) then it's possible to damage the microcontroller . The Zener diode will not let the voltage get above it's Zener rating of 4.7V. If the voltage is above 4.7 the Zener will conduct and short to ground, thus holding the voltage at 4.7 or below. This is for safety in case a high voltage accidentally gets connected that is out of range for the voltage divider.

If you put these two resistor values into a voltage divider calculator, http://www.raltron.com/cust/tools/voltage_divider.asp you can verify that it's dividing the possible battery voltages to safe levels.

Say the battery is at 14V*, nearing full charge, then the output voltage going into the microcontroller pin is 2.1 volts. In the code in the microcontroller you multiply that back up to get your 14V battery voltage. Note: 10K gets entered as 10000 Ohms for simple calculators like the one in the link above.

It's possible for someone to disconnect the battery before disconnecting the panel and have the voltage float up to somewhere around 23 volts. In this case the voltage divider will output 3.5V, still safe. Say someone connects a grid tied type panel that produces 35V. Then the output is 5.3V, too high. In that case the Zener diodes starts conducting at 4.7V and bleeds off any excess voltage that may damage the microcontroller.

If you use 1% tolerance on the resistors, you can build a very accurate voltage sensor that is easily accurate to a tenth of a volt.

*I'm using sealed lead acid and flooded lead acid batteries. This is because for the the power they are the least expensive and also the most easily recycled type of batteries. Always read the data sheet before attempting to charge a battery. LIPO, NIMH and other battery types are charge very differently than lead acid types.

No comments:

Post a Comment