



The circuit is extremely useful in alternative energy applications such as wind or solar, which experience long periods of calm or clouds when no power is generated to feed the battery array. The switch works in tandem with your charge controller. You charge your batteries using your wind or solar generation capacity just like you always do, but if the batteries get low because your wind or solar stops, this device will automatically turn on a grid powered battery charger to protect the batteries from chronic undercharging. It will permit you to run continual loads even when the sun doesn't shine or the wind doesn't blow.
I like to think of this switch as creating a sort of reverse grid-tie arrangement. The alternative energy system is connected to the grid, but instead of sending excess power out onto the grid, this arrangement uses grid power when it is needed to meet electric demand and keep the batteries charged when conditions are not good for energy production. Unlike a true grid-tie, this system will not make your electric meter run backwards, but you don't need the expensive equipment and your electric power will not stop when the public utility grid goes down. To see how this switch would fit into a typical solar electric system, click here .
Construction (Please Note: Revised March 4, 2006)
Build the circuit on a breadboard, PIC prototype board, or printed circuit board. You will also need to program the PIC 16F676 chip with the program downloaded from the link to the left. If you purchase a circuit board or kit below, you will find more detailed assembly instructions in the assembly guide link at left. The parts list gives all necessary components. You will need to size the battery charger according to the size of your battery bank. Likewise, the solid state relay must be able to handle the current draw of the charger you select. Minimum control voltage of the relay is 3vdc. Connect the relay in series with the hot leg of a 120vac line such that when the relay is turned ON, a connection is made between a 120 volt wall outlet and your battery charger. Connect wires between the battery inputs on the board and the battery bank's positive and negative and negative terminals.
PIC 16F676 Software
Programming your own PIC chips requires additional equipment and skills. If you just want to get operating, I suggest you purchase a preprogrammed chip. Kits and ordering information is found below. For the adventurous pic programmers, a DOWNLOADS bookmark on the left side of the Altenergy web log will give you access to the Grid Charger Hex file and/or asm file. Click on the links to load the files directly into your browser. Use the SAVE AS function in your FILE menu to save these files to their destination in your computer. These files contain the programming instructions for the PIC 16F676 microcontroller chip. The hex file is ready to be loaded into a PIC programmer. The asm file is intended for programmers who wish to modify the program or understand how it works. Configuration bits are shown below.
PIC 16F676 Configuration Bits
Oscillator: LP
Watchdog Timer: Disabled
Power-up Timer: Disabled
Brown-out Reset: Disabled
MCLR Pin Function: Reset
Code: Not protected
Data EEPROM: Not Protected
Grid-Charger Voltage Switch Materials
Switches
PB1 1 reset switch (momentary, normally open)
SW1,SW2 1 ON time select switches or jumpers
Capacitors
C1 1 .1uf electrolytic
C2 1 10uf electrolytic capacitors
C3, C4 2 18pf ceramic capacitors
Resistors
R1 1 2k 1/4 watt resistor
R2, R5, R6 3 10k 1/2 watt resistor
R3, R4 2 50k 10 turn potentiometer
R7 1 100k 1/4 watt resistor
Semiconductors
LED1 1 LED 5mm T1
U1 1 78L05 5v 3 terminal voltage regulator
U2 1 PIC 16F676
Miscellaneous
XT1 1 32.768khz crystal
DIP14 1 14 pin DIP socket
1 Printed Circuit Board or breadboard
1 120vac Solid State Relay
1 120vac Battery Charger
Precautions
Be careful not to accidentally reverse the polarity of the 12 volt dc supply, or you will destroy the 78L05 voltage regulator. When connecting the LED, the flattened side should face away from pin 9 of the PIC. Observe caution and electrical codes when working with 120vac. Protect the PIC from static discharges.
Adjustments
After building the circuit you need to adjust the low and high voltage setpoints. You will need a voltmeter and an adjustable power supply capable of delivering from 10 to 15 vdc. Follow these steps:
1. To begin, turn the low voltage adjust pot, R3, fully counterclockwise.
2. Turn the overvoltage adjust pot, R4, fully clockwise.
3. Adjust the power supply to the maximum acceptable voltage for your battery bank. I chose 14.95 volts for my minimum battery voltage. This is just below the over voltage cut-off of my inverter.
4. Connect the power to the board. Be very careful not to accidentally reverse the polarity of the supply. At this point, the LED should blink ON, then OFF.
Troubleshooting… If the LED does not turn ON when power is supplied, press the reset button to see if that turns it on. If it still does not blink, there is something wrong with your assembly and you will need to troubleshoot the cause. Inspect it closely with a magnifying glass for bad solder joints. Check if the PIC or LED is placed backwards or if pins are not properly seated. Test the supply voltage between pins 1 and 14 on the PIC to insure it is 5v. If you did not use the supplied printed circuit board, double-check all your connections against the schematic.
5. Turn R3 clockwise until voltage at pin 8 of the 16F676 measures 2.5 volts.
6. Adjust the power supply to the minimum acceptable voltage for the battery bank. I chose 11.95 volts in my system.
7. Turn R4 counter clockwise until the LED turns ON. If you overshoot, back off 1/2 turn on R4 and press the reset button to turn off the LED. Then slowly turn R4 counter clockwise until the LED turns ON.
A finished assembly might look like this. Here, you see the orange power cord that plugs into a wall outlet. Harder to see, but coming out with the orange cord are two 18 awg cables that will go to the battery bank terminals. The outlet on the front of the box is the receptacle for the battery charger The red switch is the reset button and the white wall switch is an optional SPST switch to disconnect the battery power from the circuit board.


A customer asked if the Grid Charger Voltage Switch could be calibrated to operate with 24 volt battery banks. A couple minor parts changes are all that's needed. Follow these steps:
1 Make sure the capacitors C1 and C2 can handle at least 24 volts.
2. Change R7 to 300Kohms.
3. (optional) change the voltage regulator to a MIC2950. This is a newer more efficient regulator chip. It is pin compatible with the 78L05. The MIC2950 will operate better at the higher input voltage. It has the added advantage of being virtually blowout-proof. It has built-in over current, temperature, and reverse-polarity protection. It would be a good choice (although a slightly more expensive one) even for 12 volt operation.
Follow the same adjustment procedures as for 12 volt systems. Your turn-on voltage will likely be somewhere in the neighborhood of 21.5 volts and the turn-off voltage will be about 28 volts.
A couple of questions for you. First if ones battery voltage drops below
our set threshold then the unit will allow a charger to charge the
batteries from grid supply but because most chargers are not capable of
supplying the current needed to run ones inverter then the house itself is
now without power? Do you suppose then that the relay that connects grid
power to ones battery bank be used to switch the house breakers from grid
to inverter? Finally could not this whole operation be done with a single
relay where in the coil in energized from the inverter? Most inverters
have a low voltage shutdown so when the inverter senses a low DC voltage it
shuts down and power that was normally routed from our inverter to our
house breaker via the NO contact would switch to the NC position connected
to grid voltage. If one desired they could then charge the battery bank
from the grid source. Looking forward to your reply
Regards Jason
Jason, you pose some interesting thoughts. If you use a small charger, you
would need to be careful about your load. In my setup, my Iota charger is
capable of running my load and charging the batteries. The load consists of
refrigerator, blowers and ignition for two gas heaters, the same for a gas
water heater, and two lights in my living room.
After thinking about Jason's question some more, I want to give my thoughts
about choosing the right size battery charger to work with the grid backup
switch. Please understand that you will only be able to continuously draw
whatever the stated capacity of the charger is. You do have ability to
handle larger intermittent peak loads because the batteries can give the
extra juice when you need it. A small charger will take longer to charge
your batteries.
do you have a 240v version of this kit? in new zealand and australia the
grid is 240 volt.
Hi Cameron, It does not matter what the voltage of your local grid may be.
The grid charger voltage switch will run ok. All you need is a solid state
relay that is capable of operating at your local grid voltage. Since the
switch uses a TTL level signal to operate the solid state relay, make sure
that whatever relay you choose has a dc control voltage of 3-5 volts. Many
relays have a 3-32 vdc range and thse are just fine for the grid charger
voltage switch.
Is there a set-up for 48 volt systems. I'm using 8 Rolls 6V batterys on my
system here in Bayfield, Colorado. Thanks for any help. Also not grid tied
only generator back-up! Larry Frey
Larry, there is no 48v system available at this time. If you send me an
email with some information about your system, I might be able to make some
modifications to the switch so it would work for you. Do you use an
inverter? What voltage feeds it? What is your generator's charge voltage?
What kind of charge controller do you use? --tom
are there any issues with connecting this in conjunction with the a solar
charger? for example a trace C40 is tied to solar panels and does the
charging of a bank of batteries If I read the description correctly using
the kit would then hook up a second charger to the same battery bank. So
the potential exhists that there could be 2 chargers charging the bank at
the same time? --chris
Chris, Your understanding is correct. The grid charger switch is designed
to control a second grid powered charger that runs in conjunction with a
solar charge controller such as your C40. It's ok to run two chargers on
the battery bank at the same time. Each charger sees the other as if it
were the battery bank itself. Thus the chargers reduce their charging
current somewhat until the batteries are fully charged. The grid charger
switch will turn on for a preset amount of time and then turn off The
charger that is connected to it will handle the control of the charge
current.
Hi. I’m interested in buying the battery charger part of your device. The
one on your site that cost $12 bucks, is that the charger? The one that
comes in the metal box? I want to try to build the circuit on my own but I
just don't know if I can build the battery charger, so I just want it ready
so all I have to do is tie them together.
Please let me know, and also I want to get the preprogrammed PIC.
Another question, How do I do the paypal invoice?
Hi. Just to make it clear, this is not a charger. It is a switch to turn a
charger off and on automatically. The bare printed circuit board is what
costs $12. You can buy the board with components, including the
preprogrammed PIC chip (you assemble it!) for $30. Or you can buy the unit
assembled and tested for $60. To the completed unit you would need to also
supply a battery charger, an enclosure, a properly sized solid state relay,
and connecting wires. To use paypal, you need to set up a paypal account.
You will receive info on setting up an account if you ask me to send you a
paypal invoice. If you choose not to use paypal, that's ok. You can just do
it the old fashoned way and mail me a check. Thanks, Tom
Can you please Post your contact information like a phone number where we
can call you.
I hope you won't mind, but I'd prefer that contacts be kept to emails. I
sell stuff, but it's not really a business. It's more of a hobby. And I'm
out at work all day anyway. Thanks, Tom