Two power sources for Solenoid: Battery AND AC/DC Adapter

Hello everyone,

I'm really new to this forum and an amateur when it comes to electronics so please bear with me and don't judge. I'd really like to learn so please don't hesitate to correct and explain to me what's wrong.

So here's my problem.

I have 12v solenoid lock which I would be controlling with the Arduino Nano via a BC547 transistor. The whole project would be powered by an 12v AC/DC wall adapter. The problem is, whenever the power runs out I won't be able to open the lock as it is configured to be "fail-safe" However, I would like the project to be configured as a "fail-secure", where I can still open and lock even if there is no power.

To deal with this, I thought of connecting backup 18650 batteries ONLY to the solenoid (not the whole project), which I can turn on by a SPST mechanical switch lock like this one (https://shopee.ph/12mm-Metal-Key-Switch-with-keys-i.18252381.2700634084). Here are intended functionalities of the added back-up battery.

  1. When there is power from the AC/DC adapter, the solenoid can be opened/locked via a digital signal from the microcontroller.
  2. When there is power from the AC/DC adapter, the solenoid can be opened/locked via the mechanical lock switch, which (I think) draws power from both the batteries and AC/DC adapter.
  3. When there is no power from the AC/DC adapter, the solenoid cannot be opened and locked via the microcontroller
  4. When there is no power from the AC/DC adapter, the solenoid can be opened/locked via the mechanical lock switch, which draws power directly from the batteries.
  5. When there is power from the AC/DC adapter, a switch can be closed to charge the batteries via the BMS board

Also, I've added a DPST switch to the BMS board to charge it whenever the batteries are low.

So, anyone have a comment or suggestion?

backupbatteries.PNG

Easiest solution: reconfigure that lock so it works the way you want it.
Second easiest solution: get a lock that works the way you want it.

Your project: I'd configure it so the adapter charges the batteries continuously, and the Arduino & solenoid are powered from the batteries, like a UPS setup. No need to worry about changeover or remembering to close a switch to charge the batteries after a rare power output.

You may want to take a little more time going through this. The Arduino requires power which will drain your batteries. It depends on your battery chemistry if it can be float charged etc. Some battery will not tolerate that. They sell some "UPS" boards with a boost converter and charger on the china market (eBay etc) that will do your job. I have several of these but I do not remember the part numbers, just that I got them on eBay about 2 years ago. These will switch from the AC power source to the batteries and back. They will charge the batteries when there is power available and the batteries need charging. This approach will not need you to remember to charge the batteries. This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil

I wonder when your solenoid will be powered: in open state, in locked state, always, or only while switching?

The battery backup choices has been explained already. I would not care about the power consumption of the Nano, it is neglectible against the solenoid power.