Thursday, August 4, 2011

Solar Controller - Microcontroller X-plained

This picture is the representation of the micro-controller on the schematic. Power and ground on the right. All the multi-purpose pins on the left.

The micro-controller is the heart & brains of the controller. It makes the decisions about what do; connect the panel to the battery, turn on the load (LED lights, pumps, motors, etc).

You can think of it like a CPU for your computer but it's actually more than that. A micro-controller (uC) is a small, inexpensive computer, complete with RAM, registers, code, peripherals, an amazingly powerful and inexpensive bit of silicon. Think less than $0.50 in quantity, a dollar or two if you buy one at a time.

A uC has pins that can be configured as inputs or outputs (and many other things). The inputs can be used to know if a switch is on or off. Some pins can be analog inputs, which means they can read the voltage level of the pin. Analog inputs are used to sense things like battery voltage and ambient light level.

When configured as outputs they can be used to turn on an LED or turn on a transistor to allow the panel to charge the battery.

The uC also has peripherals (add-on's to the CPU) that can do some pretty cool stuff. Generating PWM signals is really handy for controlling current, which you need to do for a solar controller. Google PWM if you're interested but it allows you to turn a switch (a transistor) on and off really fast. Toggling that switch at high frequencies is what you do to control current flow between panel and battery, battery and motor, etc.

uC's have come on the market big in the last 10+ years. In the last couple years they've become so cheap that there aren't many arguments left for not using them in almost any complex circuit. There are still plenty of inexpensive controllers on the market that were designed in another decade that don't use uC's but solve problems with discreet analogue electronic components. Very simple controllers can still be made this way but they aren't that good at charging batteries to their capacity or being good at not ruining the battery and especially knowing when to running your device when you want to.

How to select, program and use uC's is a big topic but there are tons of resources on the Web. The Arduino is a popular, easy to use, uC solution. You could certainly use an Arduino to run your solar controller if you're inclined to make your own.

As you can see from the schematic on the previous post. The uC gets connected to all kinds of things on the solar controller. Like the battery voltage sensor from the previous post.

No comments:

Post a Comment