I need a circuit design that uses two power sources...sort of. The entire circuit will consist of two parts. The first part will be powered via 9Vdc power brick. The second part will be powered via 9V battery. The thing is that both parts need to be electrically isolated, or at least enough to cause no damage to each other. I also need it to be low part count and cheap. My thought was to use a P-channel MOSFET. The circuit is imaged below. My question is if this will work, or if I need to go a different route. I read somewhere that circuits should use a common ground. Ignore the switch on the left; it's only there for simulation-testing purposes.
If this'll work, does it matter which one I use? Or would you recommend B over A?
You do not need to connect the grounds if you are using an optocoupler.
If you use a high gain optocoupler like the 6N138M or HCPL700, you can light an LED without using an extra transistor.
free-bee:
. . . . . . at least enough to cause no damage to each other . . . . .
There is no need to have an optocoupler to stop the circuits damaging each other.
You can use circuit 'A' of your original post but connect the negatives of both supplies together. If you are worried about the circuits damaging each other, place a high-value resistor in series with the MOSFET gate. (I am assuming there are no other connections between the two parts of your circuit)
You may need to consider what will happen if the battery supplying the left-hand part of the circuit starts to lose its voltage.
Archibald:
There is no need to have an optocoupler to stop the circuits damaging each other.
You can use circuit 'A' of your original post but connect the negatives of both batteries together. If you are worried about the circuits damaging each other, place a high-value resistor in series with the MOSFET gate. (I am assuming there are no other connections between the two parts of your circuit)
You may need to consider what will happen if the battery supplying the left-hand part of the circuit starts to lose its voltage.
Well, the left-hand side gets it's power from a 120V AC to 9V DC wall adapter. The whole idea is to detect if there is a power outage and automagically activate the right-hand side.
I have to say, I don't get your application, two 9V sources for an LED On/OFF.
Use a latching relay circuit. I've attached an example.
Just replace the motor with your LED and resistor, and if you need isolation for the LED , connect the second line to different source. Its a mechanical switch so it has no electrical connection to the rest of the circuit.
You'll need a relay with coil rating 9V. 12V coils are the most common, most will work on 9V but might stop working properly as the battery gets low.
The only down side is the coil will consume more power then something like a mosfet or transistor. But modern relay coils use far less current and will likely be under 50mA(part dependent).
Its really simple, time tested and universally used in PLC applications to this day. Its also only 3 physical components (2 switches, relay) before you add whatever your controlling.
Sorry for the (very) late reply. I was somewhere else for a few days.
I thought about using just a normal relay for the circuit and connecting the LED to the N.C. contacts, this way the LED is on while the relay is unenergized. But my concern there was that the relay probably wouldn't last very long. The entire circuit should be expected to have very long on/off cycles and, at the same time, short on/off cycles. The left side of the circuit could remain powered for minutes or it could be powered for days or even months at a time.
It's to be plugged in and forgotten. If the power goes out, the wall adapter/brick/plug/whatever will lose its voltage (preferably fast) and the left side of the circuit will too. Once the left side of the circuit dies, the right side activates an LED (a series of, in my specific case).
Another question: since the power circuit on the left is from a wall block, will there be a negative voltage, with respect to ground, on the (-) terminal? In my example of 9V (I chose it just because), should I consider the (+) rail to be at 4.5V and the (-) rail to be at -4.5V?
Sorry for all the questions. I have never done anything IRL dealing with two separate power sources and don't want to blow anything up. The electronics sim I use is terrible at some things.