bscopes
Posts: 2
Joined: Thu Mar 19, 2020 3:50 pm

Wiring Pi to Magnetic Lock and Relay Switch

Thu Mar 19, 2020 3:59 pm

I am attempting to wire a magnetic lock into a raspberry pi using a relay switch. I have a attached a diagram of how it is currently being wired. Although it works currently, there is only 3.2 volts being supplied to the lock (read on volt meter), where 12v is wanted for a stronger lock.

More Information:
We are connecting to the Pi from the Blynk App to turn the GPIO pins on/off. The lock is attached to a mailbox that will be able to lock remotely.

Any opinions? Let me know if more information is needed.
Raspberry Pi Magnetic Lock Diagram.png
Raspberry Pi Magnetic Lock Diagram.png (247.39 KiB) Viewed 363 times

pcmanbob
Posts: 10119
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Wiring Pi to Magnetic Lock and Relay Switch

Thu Mar 19, 2020 8:03 pm

Hi.

Can you post a link to the relay board you have as it looks like you have the pi connected to the output of the relay along with the lock.

If this is how you have it connected then it's very wrong and I would power down everything before you damage your pi.

Edit....

Having found a diagram for this relay board you do have it connected wrong , it is also designed to be driver by supplying 12V to the red and black wires to switch it on.

The screw terminals are for the output of the relay , K0 being one terminal and K1 being the other.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

pcmanbob
Posts: 10119
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Wiring Pi to Magnetic Lock and Relay Switch

Thu Mar 19, 2020 8:42 pm

To use this relay board with your pi you will need to use an external 12V DC PSU to power it and the lock like this.

Image
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

bscopes
Posts: 2
Joined: Thu Mar 19, 2020 3:50 pm

Re: Wiring Pi to Magnetic Lock and Relay Switch

Fri Mar 20, 2020 12:15 am

pcmanbob wrote:
Thu Mar 19, 2020 8:42 pm
To use this relay board with your pi you will need to use an external 12V DC PSU to power it and the lock like this.

Image
Wow! Thanks for taking the time to put together the diagram! It makes sense now. Will rewire the project in a few days and report back.

Thanks again for the help!

JohnsUPS
Posts: 188
Joined: Fri Jul 06, 2018 2:13 am
Location: USA

Re: Wiring Pi to Magnetic Lock and Relay Switch

Sun Mar 22, 2020 3:40 am

Be careful with the lock.
My workplace has many doors secured with these magnetic holds. Properly installed, they will hold 600lbs, so the magnetic field is considerable.

Over time, the inductive kickback of the coils in the holding devices causes damage to the relay contacts that actuate them. I personally have had to call our security team to replace the relays more than once because they are welded closed and won't allow a door to open.

A very common practice when wiring DC coil actuated relays is to incorporate a reversed biased diode across the coil, I would suggest that this be done here as well.

Return to “Other projects”