Using Arduino to open an electric lock on button push and keep it open for 10sec. Button is a contact push button. Lock needs 12V

Good day, so I have following setup planned.
I have a secret door in a cupboard, and its locked with a FLIN 12V lock.
Usually this lock is constantly connected to a 12v power supply, and can be released on a switch (like a light switch on or off)

What I want to achieve is that you have a hidden push button (like a pc start button that closes when released) and have the push send a signal to open the lock for a set amount of time. Like when the normal switch is kept open for say 10seconds.
Bonus would be to have a buzzer in there as well to have an audio signal when it's open.

I have good knowledge of soldering and basics of small electronics, but it has been ages since I used my little arduino last. Any suggestions how I would go about wiring and set up this thing would be welcome.

Best regards, chris.

Hi, this is a motorised lock (as opposed to a solenoid lock), so it is marginally more complex.
In any event, you are dealing with 12v here, so you must use relays or mosfets to interface between the arduino (5V or 3.3v) and 12v.
Easiest way is to replace the top-left switch with a relay with suitable current rating of the contacts (as long as it has toggle connections like DPDT or SPDT). It is unlikely you will find a suitable relay that can be switched with the arduino directly, so you will need to use an intermediate mosfet (or transistor) to interface the arduino to the relay. You will need a diode (like a IN4004) connected in reverse across the relay coil so you don't destroy the mosfet.

For sensing if the door is open or closed (I guess this is the bottom left switch) this appears to feed 12V back. So, you will need a simple resistor divider to convert the 12v to 5v for the arduino.

My only reservation is that 12v is applied all of the time to the lock. If it were me, I would only power the lock when it needs to be powered (when opening or closing). But that requires another relay, but I would personally do that.

A buzzer is simply. You can get a cheapo buzzer that you can directly connect to an arduino output pin (as long as the buzzer consumes a smaller current that the arduino can supply on a pin).

As you are using 12v, you can connect that to the RAW pin of the arduino which will then regulate it's own 5V.
The last issue to think about is how "electrically noisy" the motor is. We don't know what voltage spikes etc the motor will put back into the 12v. Some power diodes separately feeding the arduino and lock might be needed, and I would add some power supply capacitors around the arduino.

Finally (and yes I know this is an arduino forum) - but have you thought of designing a circuit using something much simpler and easier? Like a 555 timer? That will work off 12v directly, and in monostable mode it might be a better solution.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.