Shop OBEX P1 Docs P2 Docs Learn Events
Switching battery between charger and load — Parallax Forums

Switching battery between charger and load

SSteveSSteve Posts: 808
edited 2006-12-30 23:44 in General Discussion
I'm designing an SX-based device to switch power to the amplifiers on my home theater system. I've got the software done, but I have very little hardware experience so I'm hoping I can get a little help.

Part of the setup is a car audio crossover that's been modified for my application, a 12V lead-acid battery to power it, and a charger for the battery. Currently I have a mechanical break-before-make switch that either connects the charger to the battery or the battery to the crossover. I'm trying to control these connections from SX pins. Here's what I've come up with so far:

attachment.php?attachmentid=44790

Here's what I think should happen: When RD1=1 and RD0=0, the battery will be connected to the crossover. When RD1=0 and RD0=1, the charger will be connected to the battery. When RD1=1 and RD0=1, the battery won't be connected to anything. Is that correct?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
OS-X: because making Unix user-friendly was easier than debugging Windows

links:
My band's website
Our album on the iTunes Music Store

Post Edited (SSteve) : 12/29/2006 12:00:51 AM GMT
689 x 345 - 12K

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-12-29 19:34
    Steve,
    ·
    ·· One thing you should probably plan into the circuit is a fail-safe…What if the SX is not powered? ·In this case the default state of the MOSFETS will be both connected. ·What you need to do is change things around so that the MOSFETS are connected through a small resistor (say, 220 Ohm) to the I/O pins and that they have 10K pull-down resistors on them. ·That way the default state would be off if the controller was off. ·I hope this helps.· Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • SSteveSSteve Posts: 808
    edited 2006-12-29 23:48
    Thanks for the input, Chris. I really appreciate it. Aside from the fail-safe does the rest look like it'll work?

    Here's the updated design:

    attachment.php?attachmentid=44803

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows

    links:
    My band's website
    Our album on the iTunes Music Store
    641 x 355 - 12K
  • T ChapT Chap Posts: 4,223
    edited 2006-12-30 00:54
    The IRF510 is an Nfet? Have you tried to breadboard the mosfet to see if you can even turn it on with the same gate voltage as the charger? In some cases the gate voltage must be higher to get an Nfet to turn on in a sourcing application.

    I would just plug the charger into the battery and leave it on, assuming it is a smart charger and can reduce current at fully charged level. If the charger is producing noise on the lines thenb that is another issue.

    Post Edited (originator) : 12/30/2006 1:41:42 AM GMT
  • SSteveSSteve Posts: 808
    edited 2006-12-30 16:26
    originator said...
    The IRF510 is an Nfet? Have you tried to breadboard the mosfet to see if you can even turn it on with the same gate voltage as the charger? In some cases the gate voltage must be higher to get an Nfet to turn on in a sourcing application.
    Yes, it's an N-channel MOSFET. I'll try breadboarding it to see if it works. If it doesn't, would I be better off using relays?
    originator said...
    I would just plug the charger into the battery and leave it on, assuming it is a smart charger and can reduce current at fully charged level. If the charger is producing noise on the lines thenb that is another issue.
    I think the charger creates noise in the crossover, otherwise we probably would already have it set up that way. You'll have to forgive me my ignorance--the guy who designed the crossover in the first place is the one who helped me with the original setup and that was a few years ago.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows

    links:
    My band's website
    Our album on the iTunes Music Store
  • SSteveSSteve Posts: 808
    edited 2006-12-30 17:37
    Ok, how about if I do this instead? I'm already using an RC-4 for the two AC SSRs. I can just use the other two sockets for the DC SSRs. It sure would be easier to assemble, which is a big plus for me.

    attachment.php?attachmentid=44815

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows

    links:
    My band's website
    Our album on the iTunes Music Store
    609 x 350 - 10K
  • T ChapT Chap Posts: 4,223
    edited 2006-12-30 20:54
    Since this is for a home system, why not just use s 12vdc wall adapter? You already mentioned that the charger adds noise, so I assume you will have access to AC? Will the SSR's you have pass DC across the triac? Check their datasheet to see if DC is acceptable, in that case go that route with your drawing. I am curious what the SX role is, do you have a it checking the battery voltage somewhere not shown and kicking in the the charger when needed? If not, you could easily add an LM339 with a trim pot as REF(5 volts from a regulator off the battery or other supply) and set the pot at some voltage(divided by 2) where you want the charger to kick in. Then, put the battery on the other comparator input, but through a voltage divider(centertap two 10k's), when the battery gets below a level it will trip the comparator and tell the SX to do something, like switch in the charger.

    I would first try to use the DC wall mount, if that isn't possible, I'd get a noise supressor for the charger and test whether it can just stay plugged in and then don't switch anything. If the SSR will work great, I never tried them on DC. If not use a relay or PNP mosfet. Actually, you may use a PNP transistor as well, don't know a part number off the top of mu head but I am sure radio shack has some that would work. Since it is just a crossover it can't pull that much current. If you are trying to power amps as well, then the transistor may need to be currenty rated for your gear.

    Triacs are very noisy in some cases, especially dimmers that use triacs. You may get by with one on audio at 12 volts.
  • SSteveSSteve Posts: 808
    edited 2006-12-30 21:40
    The reason I'm making this thing is to be able to turn the amps on and off via a remote control. Right now, to turn the amps on I flip a switch to connect the battery to the crossover then turn on a power strip that powers the amps. To turn it off, I turn off the power strip, wait 30 seconds or so for the tube amp to cool down, then flip the switch to connect the battery to the charger. This all requires going to the other side of the room and getting down on the floor. I have to wait for the tube amp to cool down because there's a huge spike when power is removed from the crossover. Besides making it more convenient to power the amps, this will also make it foolproof for other people using the system. It's too easy to power the crossover on or off when the amps are on and I don't want that spike from the crossover blowing my speakers.
    originator said...
    I am curious what the SX role is, do you have a it checking the battery voltage somewhere not shown and kicking in the the charger when needed?
    No, the battery is always switched over to the charger when it isn't powering the crossover. The SX is there to read the IR from my remote and respond to Onkyo receiver power on and power off commands. I've attaching the complete schematic so you can see the whole picture. The pushbutton is for manually cycling power and the LED is an on/off/busy indicator. When it sees a power on or power off command, the SX cycles power to everything in the correct order and with the correct timing.
    originator said...
    Will the SSR's you have pass DC across the triac?
    The MODC5 SSRs are 3A 3-60VDC relays. Here's the datasheet: www.crydom.com/userResources/productFamilies/66/crydom_io_odc.pdf
    originator said...
    If you are trying to power amps as well, then the transistor may need to be currenty rated for your gear.
    The amps are switched through 5A 240V SSRs.
    originator said...
    Triacs are very noisy in some cases, especially dimmers that use triacs.
    Oh, I haven't considered that. That would defeat the purpose of using the battery in the first place. The whole reason I'm using it is because the guy who designed the crossover wants me to use a battery because it provides the cleanest power. I guess I can hook up a 'scope to the outputs of the SSRs to see if the signal is a clean 12V, right?

    Thanks a lot for your input. I really appreciate the help. And the patience!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows

    links:
    My band's website
    Our album on the iTunes Music Store
    844 x 633 - 19K
  • T ChapT Chap Posts: 4,223
    edited 2006-12-30 22:42
    Yes I knew there were DC SSR's, just wanted to make sure you had a DC version, some are AC only, some are DC only, I have heard of duals. I would just use the SSR and see how it works, you might be fine with it. I have a recording studio, there are triacs on some dimmers and they are all noisy on my gear, but these are dimmable triacs, yours may not produce the noise. Many studios dont use triacs, they use variacs, which are giant windings that weight about 10lbs each for varying AC levels on lights. I find that with audio stuff, it is always trial and error to minimize noise. A relay of course just works, no thinking involved there except for good sheilding of all the parts. A battery is a good source for clean DC, but out of all the high end gear I have seen and used, I have never heard of running gear off batteries to get a cleaner signal. I would honestly suggest you to rethink the concept and nuke the battery. Put a fat cap around 2200 > 4000 uF on the DC lines from a power supply, along with some small caps like .1 and .01, put it all in a shelded box and call it a day. A scope will show you what is on the lines, and you may not even hear what you see, then again, you may hear things you don't see coming from RF from a triac that is not on the DC lines, but in the air hitting your audio signals. Noise from a triac is most always RF or other Smile they spit out.

    If you stick with your original plan, should easily be able to hook up your SSR and check the noise levels without having to build PCB's to test it. I have an old dynaco stereo 120A, one side died and I need to get it back up and running, it is a great amp for small speakers.

    PS You could of course just use Pfets like your original schematic. Numerous options really, you have to just breadboard/perfboard one up and see how you like it prior to etching or ordering boards.

    BTW, with Eagle you can send sunstone circuits(pcbexpress) your .brd file only and get boards back in 3 days.
  • T ChapT Chap Posts: 4,223
    edited 2006-12-30 23:22
    I keep forgetting you are only wanting to charge the battery with the triac, so who cares if it is noisey, you aren't using the crossover when it is charging,. My bad on that one.
  • SSteveSSteve Posts: 808
    edited 2006-12-30 23:44
    originator said...
    I keep forgetting you are only wanting to charge the battery with the triac, so who cares if it is noisey, you aren't using the crossover when it is charging,. My bad on that one.
    Ok. I thought maybe the triac was something in the SSR. Cool.
    originator said...
    BTW, with Eagle you can send sunstone circuits(pcbexpress) your .brd file only and get boards back in 3 days.
    I'm using an SX48 proto board (can't beat it for ten bucks) and an RC-4. Between the 120VAC and the expense of the amps & speakers I didn't want to take the risk of blowing everything up and/or burning my house down by designing my own board. But I'll keep that in mind if I ever decide to make my own board.

    My Dynaco is a Stereo 70 with the Curcio Audio Engineering upgrade board. It's connected to the high-pass output of the crossover and drives a pair of Ariel speakers that I built with some friends. The low-pass from the crossover goes to one channel of a Hafler DH-220 which drives a subwoofer that a friend and I built. Once I get this thing done, I'll take some pictures and post it in the Projects forum.

    I just ordered the MODC5s. Now I'll start working on the box for this thing.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows

    links:
    My band's website
    Our album on the iTunes Music Store
Sign In or Register to comment.