microcontroller circuit help

Hi all I am trying to put together a circuit that selects between a battery and outlet depending on voltage. Something similar to this:

formatting link
but not as complicated. Here is a block diagram to illustrate AC ------------!----------- | | Battery | -----------|------------- Chip Now the battery outputs 12 V while the chip gets 110V from the outlet. It should decide, in case the battery is running out, to switch to AC. The chip should have an internal 110 to 12V DC converter as well. Any help in getting me started will be appreciated.

Reply to
mookiewookie
Loading thread data ...

Since U need inverter to convert battery voltage to 110VAC there is no need of such ckt. All inverters have automatic changeover from mains to battery. Also cutout and alarm for Low Battery. So if U want to charge battery for other sources (solar wind etc) then U can install a switch between mains and inverter. Just switch off mains when alternative power is there. When no such power available or battery goes low then after alarm switch on mains. This will provide mains power and charge battery also.

Reply to
psdayama

What you would want to do is build your own UPS of sorts. Get a run-of-the-mill car battery charger and a car battery,and an inverter (12VDC -> 120VAC). Make for damn sure the charger is nothing special and it just outputs the voltage and current needed to charge the battery, a smart charger will damage this rig... Hook up the battery to the inverter, and hook the charger up to the battery as well, so they are all in parallel. Use the outlet on the inverter as your power source. If the power goes out, the inverter will continue to draw power from the car battery w/o interruption, and when the power comes back, the battery will charge until its full, meanwhile the inverter is running off the charger. It's a very very simple circuit and design, but again, no smart/special chargers!!

One last note on this design.. don't do it indoors. If you do, be sure to put it near a window and at least passively vent the battery out the window, try to enclose it in a plastic container for instance, and run a vent out the window. The reason I say this is because car batteries produce hydrogen as a byproduct of charging, which is fine when they're in the open air, but inside a house it's a fire hazard!

Good luck, Eric A.

this:

formatting link

Reply to
lain

Oops! I just noticed you wanted 12V out of it.. in that case, you could try doing the same thing without the inverter! Your 12V circuit will get power from the car battery when the charger isn't getting power, and it'll power from the charger otherwise.

- Eric A.

this:

formatting link

Reply to
lain

Reply to
mookiewookie

From your description, you want to do the following:

1) Charge the battery 2) Provide power to a 12 volt DC load from the AC mains 3) Switch to battery power for the load when AC is unavailable 4) Switch back to powering the load from the AC mains when AC power is once again available 5) Protect the battery from being discharged too far

Two questions: Does that cover everything? How much current does the 12V load draw?

If I have understood what you want properly, you need a comparator, not a microcontroller. The comparator will sense the battery voltage, and when it drops below a specific point, will provide a signal to switch a relay or a power mosfet or bipolar transistor. That will open the circuit between the battery and the load so that the battery won't discharge any further. A relay can be connected to the power supply such that the load will receive +12 V DC from the supply (which is AC powered) when AC is available, and from the battery when it is not available. We need to know what the load draws to provide a design.

Ed

Reply to
ehsjr

Ed, thats exactly what i was looking for. The 12V load draws about 0.1 amp. I'll look into comparators as you have suggested. A design, if you have any, will be really helpful. Thanks for the input.

Reply to
mookiewookie

See below.

Ok, here you go. It is not the best possible design, but I believe it may be the simplest. It is totally automatic. The charging circuit is intended for a lead-acid battery. View in fixed font.

------ +-In|LM7812|Out-+-----[10R]------------+ | ------ | | | Gnd a| a| | | [D5] Ry1-1 [D8] ------ |a | | |---+ +-----+----+-------+ | 15V | [D2] | D6 | | | | ------ | | | [D7] [Ry1] | | [D3] | | a| | [LOAD] | | +| | +----+ | | [D4] --- / | | | | - 50K \\ --- | | | --- /12 volts and adjust the 50K pot so that the relay energizes. Lower the voltage and adjust the pot so that the relay drops out at the set point. For a typical lead acid battery, 11.5 volts is a good choice. In no case should you go below 10.5 volts with a lead acid battery, and the closer you get to 10.5, the more possibility of damaging the battery. Once set, you should not move the pot again. After adjusting, connect the battery and the 15 volt supply.

Parts: The diodes are 1N4001, and the relay is a 12 volt low current device like cat# RLY-622 from Allelectronics, which draws < 20 mA. The power supply is a "wall wart" rated at 15 to 24 volts, like cat# DCTX-161 from Allelectronics.

formatting link

Ed

Reply to
ehsjr

I should have added a .22uf cap from the input pin of the 7812 to ground, and a .1 uf from the output pin to ground. Also, the ~15 V or higher power supply is an unregulated supply - if you use a regulated supply, you need > 15 volts, so use one rated 18 volts.

Ed

Reply to
ehsjr

Ed, could this setup be used with a NiMH battary pack and a smart charger or is it for acid batteries only.

ehsjr a =E9crit :

Reply to
mookiewookie

In the future, please bottom post, below the post to which you are replying.

No, the setup in the previous posts won't work for a NiMh pack with a smartcharger. The setup diagrammed below will do that.

D2 +------------------->|--------------------+ | a | | Ry1-1 D3 | +-----+----+---o o------o--->|---+-----+----+ | | | | | | a | | | | | | | | | | | | +| [D1] [Ry1] |> |

Reply to
ehsjr

Ed, can you explain the relay wiring in some detail. I`ve never worked with relays before and so am not really sure how to connect them. The dpdt relay has six leads, and looking at it from the bottom, i assume lead 1 and 16 carry the electromagent, 4 and 13 are poles, 6 and 11 are NC and 8 and 9 are NO in this config:

1--------4-----6-----8 16-----13---11-----9 For lead-acid circuit, am I to connect D8 to lead 1 but then what about the other leads. Again your input will realy help.
Reply to
mookiewookie

I don't know what relay you have.

Ed

I`ve never worked

Reply to
ehsjr

Sorry i meant eight pins, and its the one you recommended.

formatting link

Reply to
mookiewookie

formatting link

Ok, here's a diagram, looking at the pins sticking up toward you:

N/O N/C Com Coil 9 11 13 16 o o o o

o o o o 8 6 4 1 N/0 N/C Com Coil

And here's the schematic, with the pin #'s included:

D2 +------------------->|--------------------+ | a | | Ry1-1 D3 | +-----+----+---o o------o--->|---+-----+----+ | | | | | | a | | | | | 1| 9| |11 9| | 1| | +| [D1] [Ry1] |> |

Reply to
ehsjr

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.