In this article, we will build a simple auto power switching circuit using a relay and lithium battery backup. This is a very useful project for areas where power cuts are not frequent and usually last only a few minutes. Instead of investing in an inverter or UPS, you can easily make this low-cost DIY automatic backup light circuit at home.

Why Auto Power Switching is Needed?
Many people face short and sudden power cuts. During these times, lights and small appliances stop working, which is inconvenient. Using an inverter for such a short duration is not economical.
The solution is to design a relay-based automatic power switching system. It keeps your light ON during a power cut by instantly switching to a lithium battery backup. When mains power returns, it automatically switches back to the adapter supply.
Components Required
To make this auto power switching project, you will need:
- DPDT Relay (12V coil)
- 12V DC Adapter (mains power supply)
- 12V Lithium Battery (backup source)
- 12V LED Light/strip
- Wires for connection
Circuit of the Auto Power Switching project

- The common terminals of the relay are connected to the light load.
- The Normally Open (NO) contacts are connected to the adapter output (mains).
- The Normally Closed (NC) contacts are connected to the lithium battery.
- The relay coil is powered from the adapter so that it stays energized when mains is available.
This wiring ensures that the light will always run on mains power first, and only switch to battery when mains is not available.
Working Principle of the Circuit
The project works on the concept of a DPDT (Double Pole Double Throw) relay, which can switch between two power sources automatically.
Here’s how it works:

- When mains power is ON (adapter supply available):
- The relay coil is energized by the 12V adapter.
- The light remains connected to the adapter output.
- The lithium battery stays isolated and unused.

- When mains power goes OFF (power cut):
- The relay coil de-energizes.
- The relay switches the light connection to the lithium battery.
- The light stays ON without interruption.
- When mains power returns:
- The relay coil is energized again.
- The relay reconnects the light to the adapter power.
- The battery is automatically disconnected.
👉 The DPDT relay provides complete isolation between the adapter and the lithium battery, which prevents backfeed and ensures safety.
PCB Layout for Automatic Power Switching PCB


Please download the PCB layout, then print it on the A4 page.
Please check the PCB size while printing; it should be the same as mentioned.
** Refer to the docx file for printing.
Tutorial Video on Automatic Power Switching with Relay
In this tutorial video, I have explained all the steps to make the homemade PCB for the automatic pump switch circuit. I have made the complete circuit on the zero PCB.

But you can also download the PCB Gerber file for this project, and order the custom design PCB from PCBWay.com
About PCBWay and their services
You can order any custom-designed PCBs from PCBWay at very reasonable prices.

PCBWay not only produces FR-4 and Aluminum boards but also advanced PCBs like Rogers, HDI, and Flexible and Rigid-Flex boards, at very affordable prices.
For the online instant quote page please visit – pcbway.com/orderonline
You can also explore different PCB projects from their Open-source community pcbway.com/project/.
Also, during September, there is no extra charge for the purple PCB.
Connection diagram of the DIY Auto Backup PCB

Advantages of Auto Power Switching using Relay
- Simple and cost-effective design.
- Automatic operation without human intervention.
- Complete electrical isolation between the battery and adapter.
- Suitable for LED backup lights or other small DC loads.
- Works with lithium batteries, lead-acid batteries, or any DC source.
Applications
- Automatic emergency lighting system.
- DIY power backup for homes.
- Educational electronics projects.
- Small battery-powered backup solutions.
Conclusion
This auto power switching circuit using a relay with lithium battery backup is a practical and budget-friendly solution for handling short power cuts. With only a few components, you can design a system that ensures your lights never go out during power failure.
The DPDT relay ensures safe, automatic, and isolated switching between mains and battery, making this project both reliable and long-lasting.
Please share your feedback on this mini-project and also let me know if you have any queries.
I hope you have liked this electronics project, Thank you for your time.