simulate this circuit – Schematic created using CircuitLab

I am trying to use a 12V battery as a back up power source. I made this circuit but it doesn't work properly.

When the adapter is off the device (shown as a lamp) works on battery no problem, but when I plug in the wall adapter power goes off on the output and the relay switches and gets stuck to the adapter side until I disconnect the battery and then it switches back.

What could be the problem?


2 Answers 2


Your circuit should work.

It appears that you have wrongly wired the relay contacts as shown below.

enter image description here

Please cross-check and rewire.

  • \$\begingroup\$ This is not correct. It will parallel the power adapter and the battery and disconnect the load when the relay is engaged. \$\endgroup\$
    – StarCat
    Dec 14, 2021 at 18:48
  • 2
    \$\begingroup\$ Exactly, @StarCat! And that is what the OP is reporting. His circuit should work. Apparently, he has wrongly wired it as shown above. \$\endgroup\$
    – vu2nan
    Dec 15, 2021 at 3:18
  • 1
    \$\begingroup\$ It might help if you add that explanation to your answer. \$\endgroup\$
    – StarCat
    Dec 15, 2021 at 7:05

Are you trying to power your device from a battery or power adapter? Consider using a switched DC jack. This will automatically disconnect the battery when you plug in the adapter. No relay required.

See "Conductors in Dc Power Connectors" on this page: how-to-select-a-dc-power-connector

  • \$\begingroup\$ Hi, Thanks for helping. It's not clear what you meant by the statement (which I deleted as it's meta, not part of the answer) when you said: "If my answer helps please mark it as an answer.". If you were asking the OP to accept your answer if it helps then no, that's not what accepting an answer means. As explained here an OP is encouraged to accept the most helpful answer (to them). As only one answer can be accepted per question, an OP must not accept an answer just because it's helpful, that's what an upvote is for. Any questions? \$\endgroup\$
    – SamGibson
    Dec 15, 2021 at 18:15
  • \$\begingroup\$ Noted. "Please remember to accept the most helpful answer" is the terminology I was going for. I often find that posters forget to accept answers. It would not bother me except I'm trying to build minimum reputation level. \$\endgroup\$ Dec 15, 2021 at 18:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.