Automatic power source switching

Discussion in 'The Projects Forum' started by djp8djp, Jul 20, 2014.

  1. djp8djp

    Thread Starter Member

    Jun 16, 2013
    30
    0
    Hi

    I have built a guitar onboard pre-amp, which runs on a 9V battery. I also built for it a small power conditioner/regulator, which converts the battery 9V into +/- 15V, and +5V, for powering the various preamp elements. But I will also sometimes be connecting to the guitar a 13-pin cable (for MIDI), which has lines for +/- 7VDC and ground, as supplied by an outboard synthesizer unit.

    What I'd like is to be able to "detect" the presence of the +/- 7V power, and if it's "live", then have my power unit switch from drawing on the battery, to drawing on the +7V. Basically, just disconnect the battery. I could just use a physical switch, but I'd rather have it function automatically.

    The thing is, I'm really in the dark as to how to go about building such a thing. One consideration that boggles me is considering which source would be powering the switching circuit - I'd think it would have to be... either one!?! I could start making some guesses, but rather than just demonstrate my ignorance, I thought I'd ask for help. Anybody? Even just a simple "go look at this" link would be a nice start.

    * an additional consideration will be that it might be best to convert the bipolar 7V into unipolar. But more on that later. First, I just want to know if the switching idea can work
     
  2. djp8djp

    Thread Starter Member

    Jun 16, 2013
    30
    0
    All right, I've come up with an idea for the first part of my question.

    I plan to tie both power sources to my regulator. So that's both the 9V battery as well as the remote power supply. Of course, while the remote unit is turned off or disconnected, only the battery will supply power.

    But if I put a relay between the battery and the regulator, and the relay is normally-closed, and the relay is powered by the remote power, and it is hard-wired to supply voltage into the actuator contact... then when the remote power becomes available, it'll open the relay, and cut out the battery. I expect I'll put in a diode next to the battery, and another on the remote power line, to prevent reverse voltage in either of them. And pay the price for the diode voltage drop, but no big deal.

    Thoughts? Comments?

    And now on to part two. The remote power is +/-7VDC. And I'd like to not just tap the +7V side alone. Because the remote power will still be driving the 4 dual opamps that are part of it's reason for being there. And as I'm not certain of exactly what the capabilities are of that power supply, I'd rather not risk creating imbalances in the supply to the op amps by drawing on just one side of it. So I'd like to convert the bipolar +/-7V into unipolar. I've built units before to do the opposite (DCunipolar to DCbipolar). But how do I go the other way? The regulator I built can run on anything from 3V to 18V.
     
  3. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,363
    Generally, the simply way to automatically switch between two power sources is to connect the two sources using one rectifier diode in series with each of the two sources.

    Your situation is somewhat different because you are using different voltage levels.

    The simplest solution is to use a switch that disconnects the 9V battery when an external source is plugged in. Standard 1/4" phono jacks or 3.5mm jacks are available with such a switch built-in. The 13-pin DIN socket does not provide such a switch.

    One possible solution is to use a transistor at the output of the 9V battery. You will need a high-side switch such as a PNP transistor or a P-channel MOSFET. Then use the -7V sense line to turn off the transistor.
     
  4. NorthGuy

    Active Member

    Jun 28, 2014
    604
    121
    If you use SPDT relay, you can wire it to switch your circuit between battery and the jack power in such a way that they can never be connected at the same time. Then you do not need diodes.

    Is the ground of jack power connected to the ground of your circuit or is it isolated?
     
  5. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,802
    1,105
    The disadvantage with using a relay is the power needed to energise it. Fine if the power can come from a mains-supplied source, but otherwise a battery would soon be dead.
     
  6. djp8djp

    Thread Starter Member

    Jun 16, 2013
    30
    0
    A big thank you to everyone who replied. Much appreciated!

    MrChips, you're right, the 13-pin DIN has no facility for switching when you connect/disconnect the plug. I am in fact using that feature of the 1/4" jack for closing the ground on the battery, so that it's only connected while a plug is in the socket. But that's an aside from the power switching issue here.

    I do like the idea of solid-state switching via PNP or MOSFET. But as far as I know (and that ain't far), any such scheme will require some power draw. And as the battery is the only "permanent" power supply, I'd rather not be pulling extra/constant current from it, even though it'd be small. More importantly, as the battery ages and sags, the switching may cease to work.

    NorthGuy, I like your idea of the SPDT, to limit the supply line connection to one at a time. I'd actually looked at a couple of solid-state IC SPDT switches thinking the same thing, but forgot about it when I went to look at relays. The reason I abandoned the IC switches was the same as the above.

    Since then, I've found Normally-Closed solid-state relays, e.g. Vishay LH1518AT, IXYS CPC1150N. But I'm pretty sure that even though they have a NC side, they still need power to conduct at all.

    Alec_t, the relay that I'd hope to use would be a normally-closed one, or a SPDT model as mentioned earlier. With the battery line on the closed pin. So the battery would be the supply when the relay had no power. Then when the mains-supplied power became available through the 13-pin DIN, it'd power and switch the relay, disconnecting the battery and connecting its supply to my voltage regulator. It'd be something like an Omron G6RN-1-DC12 or -DC5.

    (And yes, everything is sharing a common ground. A bit sketchy, that, but all-too common in guitar electronics. Then again, we're usually talking in millivolts and milliamps, typically all passive too)

    So can anybody tell me if there's a solid-state SPDT switch or relay unit that will conduct across the NC pins without power?

    And finally - anybody got any ideas about how to draw from across the supplied +/-7VDC supply, and convert that into anything unipolar? Maybe I should start a different thread for that.
     
  7. NorthGuy

    Active Member

    Jun 28, 2014
    604
    121
    If you want to go solid state, you don't need a relay. Two diodes will work fine for you. You only need to make sure that the voltage from power jack is higher than the voltage from the battery.

    When connecting the +-7 supply, it's important to know where the ground of your circuit is in relation to this supply - connected, isolated?
     
  8. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,363
    There is zero current draw in a solid-state switch.

    When the 9V battery is required, the current (micro amps) to turn on the transistor is a tiny fraction of the current drawn by the rest of the circuitry.
     
  9. djp8djp

    Thread Starter Member

    Jun 16, 2013
    30
    0
    Thanks everybody.

    NorthGuy, I love the simplicity of the two rectifier diodes. But the thing is, right now I'm dealing with an external supply of +/-7VDC, and still haven't figured out how to convert that into a higher-voltage unipolar (anybody...???). So right now, the external supply is lower than the battery. Usually. As the batttery ages, that relationship changes. I'm afraid I'm stuck with trying to figure out how to actually disconnect the battery when the external power is available.

    MrChips, I also like the transistor or MOSFET switching approach. I'm a lttle shaky on the implementation of such, so the following reflects my level of understanding. First off, I'm not worried about connecting the batttery, so much as disconnecting it when the external power is available. So if the battery was supplying this switch circuitry, thus "closing" the connection between battery and regulator, I'd need the connection of external power to "open" that connection - disconnecting the battery, as well as connecting the external power to the regulator. So that's a "normally closed" connection from battery to regulator, with the external power opening it. How would I do that?

    The ground of my circuit is connected to both the external supply ground and battery ground. I've attached the schematic of the unit. Everything in the dotted red box is on a circuit board, all else is external to it. You'll see the battery at the bottom. The box labelled "Other Active Electronics" would be my regulator. I've added "my switch" to show you where I'd like the external power to be inserted. It's shown in the "external" position, but "battery" will be the default position. It also shows the external power as just using the +7VDC, which brings me again to the following question...

    How to convert +/-7VDC to unipolar?

    And will a SPDT switch IC conduct on the closed pin with no power?
     
  10. NorthGuy

    Active Member

    Jun 28, 2014
    604
    121
    I don't quite understand the configuration.

    It looks like the schematics inside the red dash line is only powered when the 13-pin jack is in, and otherwise isn't powered at all.

    It also looks like the block marked "Other Active Electronics" is not connected to this schematics at all and doesn't interact with other parts.

    If there's no interaction, it should be possible to disconnect "Other Active Electroncs" ground from the 13-pin ground and connect it to -7V. This way, you would have 14V for "Other Active Electroncs" drawn from both sides of 13-pin switch.

    Let's forget about the battery for a moment. Is the above correct?
     
  11. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,363
    I am confident there is a simple circuit solution. Give me some time to breadboard it and test it out.
     
  12. djp8djp

    Thread Starter Member

    Jun 16, 2013
    30
    0
    Hi again. Thanks for hanging in there.

    In truth, the whole project is quite complex. But the aspect which this thread addresses is fairly simple. But in order to give you a better overview of what's happening, I've put together a sketch.

    Here you see that I've replaced the entire circuit board from my previous, which had been in a red-dotted box, with a pink box labelled "External Unit". You see the signal source, called "Pickups", whose signal gets routed through a switch. Incidentally, that switch is actually two switches, an 8P5T and a 6P4T. See what I mean about the actual project being complicated? But for now, just know that the pickup input signal can go to a variety of places.

    One destination is my little Preamp unit (green rectangle). Another is the External Unit. The signal can actually go to both. Either way, it eventually goes out.

    But the Preamp unit needs power. Originally, I just had the 9V battery there. But then I thought "Hey, when I plug in the External Unit, I have access to unlimited power, albeit +/-7V. Wouldn't it be cool to just automatically use that for power whenever it's available, and save from needlessly draining my battery !?!".

    This idea inspired the lower switch, which is the topic of this thread. I could just use a physical switch. But I'd rather have the system do the job itself. We've already discussed how a normally-closed relay could replace that switch. If the relay was powered and triggered by the External Unit's power, then at the point in time when that power became available, it would flip the relay, disconnecting the battery and connecting itself. I would be happy with a switch IC, but I still don't know whether it will conduct without power.

    Unfortunately, as you can see, everything has the same ground, so it won't be possible to use the +/-7V together directly to power my Regulator.

    I am left wondering if it would be possible to convert the External Unit's +/-7V into a unipolar voltage. I just didn't want to pull all the juice from one side of the External Unit, as it may imbalance/upset its internal op amps. I've used ICs before that go from unipolar to bipolar. How do I go bipolar to unipolar?
     
  13. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,363
    This is something along the line of what I was thinking.

    [​IMG]

    I have not tested this as yet, only performed a circuit simulation. All component values are experimental. The MOSFET is a P-channel enhancement mode FET. Select any that is appropriate.

    The MOSFET is normally ON when the NPN BJT 2N3904 is conducting.

    When the -7V supply is connected to R4, 2N3904 is OFF and so is the P-channel MOSFET.
     
    Last edited: Jul 22, 2014
  14. NorthGuy

    Active Member

    Jun 28, 2014
    604
    121
    Here's my idea:

    Use a mechanical SPDT relay. Select a relay which would work from 7V. Wire it so that when not energized it connects your circuit to the battery. When energized, it switches your circuit to +7V of the 13-pin power source. Connect the coil of the relay between -7V and GND of the 13-pin. Connect a capacitor at the input of your circuit to carry it on while switching if necessary.

    When 13-pin jack is unplugged, your circuit is connected to the battery with no power losses, not even a diode drop.

    When you plug the 13-pin jack in, the power between -7V and 0V will be used to energize the relay, while the power between 0V and +7V will be used by your circuit. Select the relay in such a way that coil current is similar to what your circuit draws. This will balance the load on 13-pin power source.
     
  15. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,802
    1,105
    To prevent junction breakdown you may need a diode in series with the connection to the base.
     
  16. djp8djp

    Thread Starter Member

    Jun 16, 2013
    30
    0
    NorthGuy, the mechanical relay is what I came up with and started talking about in post#2. So far, that's my most reliable and easiest plan. But I'd rather still see if I can get a solid state method to work, and do away with the mechanicals. Although you do bring up a new point regarding using the -7V for the relay actuator voltage. I'm not sure that'll work with "negative" volts, will it? And while I love the idea for the sake of tapping the negative supply for a more balanced load on the external bipolar supply, the relay will draw only a very small current, so I think the effect could be pretty small.

    MrChips, thank you very much for going to the trouble of putting together the schematic! One question, though ... won't the +7V connected to ground create problems??? Actually, I have other polarity concerns too - the -9V connected to +7V, and related to that I see the load receiving +9V or +7V, but from opposite sides? I think I'll have to sim it up myself.

    ps - thanks Alec_t !
     
  17. NorthGuy

    Active Member

    Jun 28, 2014
    604
    121
    Of course. In the relay, coil is completely isolated from the contacts. Therefore you can switch practically anything with anything. Not the case with solid state stuff.

    What sort of current would your circuit draw from 0V to +7V?
     
  18. djp8djp

    Thread Starter Member

    Jun 16, 2013
    30
    0
    My preamp has four dual op amps. Two NJM2068 and two NJM4562. These are drawing 15mA off each of their bipolar power feeds, so that's 30mA all together. But my regulator unit is drawing 95mA. Not very efficient! I'll have to look into getting that better. But for now, I need just shy of 100mA.

    The external +/-7VDC power supply is intended to run a different onboard unit, that I provided the schematic for earlier. It also has four dual op amps, so let's say these also need around 20-30mA. But they draw on both sides of the external +/-7V. And if I draw 100mA from just the +7v, I think it's reasonable to assume that things will get out of balance. I don't have the specs for the external supply (it's built into a synthesizer). But just to be safe, I'd like to try to draw from both sides of it to power my regulator.

    So, how to convert bipolar +/-7VDC from the external power, into one positive voltage for my regulator? Which, incidentally, will take anything from +5V to +18V. Maybe I should start a new thread?

    The power-switching question is closed for now, as I'll either use the mechanical relay, or get that solid state circuit tested out.
     
  19. NorthGuy

    Active Member

    Jun 28, 2014
    604
    121
    Here's the example of a relay that woud balance your load:

    http://www.digikey.com/product-detail/en/G5LE-14-DC6/Z3111-ND

    To go to unipolar source, you can buy a ready-made DC-DC 14V-to-your-voltage isolated converter. Of course, you can build your own too. You can, for example, use 555 timer to switch the source to produce AC pulses, then pass them through a small transformer and rectify. You can get any voltage this way.
     
  20. djp8djp

    Thread Starter Member

    Jun 16, 2013
    30
    0
    Thanks NorthGuy. (BTW, are you north of the 49th?)

    I'd looked at the Omron relays, those G5LEs as well as the GR6L and GR6N. They're a tad longer, but shorter and narrower. Which is good, as I have to fit EVERYTHING into a solid-body electric guitar.

    Which brings me to the power solution. I like the idea of using a 555-to-AC-to-DC. But there's not really any room for a transformer, which would anyway be a bad idea inside the guitar. Don't need a noise generator in there.

    How big are those ready-made DC-DC converters? And they'll take a bipolar input? Can you point me at one please?
     
Loading...