PiBenge
Posts: 34
Joined: Sun Sep 14, 2014 9:59 am

RFID/Electromagnetic Lock

Sun Dec 28, 2014 9:13 pm

Right, I'm planning to develop a door lock that locks/unlocks by the use of a RFID Reader. I'm using the book "Raspberry Pi Projects" to find information about it all but it isn't very specific to what I am looking for. The system is a simple idea. RFID Reader Input. If authentication is valid then audio "Access Granted", Green LED Lights up and the electromagnetic lock unlocks. If authentication is not valid then audio "Access Denied", Red LED Lights up and nothing happens. I am using the Chapter "Twittering Toy" for Text to Speech and the Door lock Chapter with the Traffic Light tutorial for LEDs.

Equipment I am using:
125Khz Cards - http://www.amazon.co.uk/125Khz-Door-Ent ... ters_img_y
125Khz RFID HID USB Reader - http://www.amazon.co.uk/gp/product/B005 ... WO4UI7KN1S
Electromagnetic Door Lock - http://www.amazon.co.uk/gp/product/B00J ... S644IBWRIX
Female to Female Jumper Wires - http://www.amazon.co.uk/gp/product/B00D ... 5RPPQJT789
220 Resistors - http://www.amazon.co.uk/gp/product/B004 ... UQEVEP9KPZ
Assorted LEDs - http://www.amazon.co.uk/gp/product/B008 ... B378JR1ILO

Already I have a Raspberry Pi and the essentials for it. If anyone has any documentation or think I have missed something please reply. The book does say to use a PiFace Digital Interface but I am not really wanting to use it due to its expenses, so if you have any documentation on setting up the magnetic lock using GPIO Pins please help me out as well. Appreciate it to those who help. Once completed I will open source it all as well.

-Ben
-Benge, keep focused.

danjperron
Posts: 3406
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: RFID/Electromagnetic Lock

Sun Dec 28, 2014 9:55 pm

Hi PIBenge,

I do have some code with a 10Mhz mifare reader.

Maybe you could look at the code and it will help you.


I use an arduino because I could have the system centralize with the raspberry PI and have multiple reader (one for each door).

http://www.raspberrypi.org/forums/viewt ... 53#p658053


I hope it will help.



Daniel

PiBenge
Posts: 34
Joined: Sun Sep 14, 2014 9:59 am

Re: RFID/Electromagnetic Lock

Sun Dec 28, 2014 10:13 pm

Thanks I will have a look into it. I'm quite knowledgeable when it comes to python so I will probably use that identifying the cards ID to a text file. Will have to try keep it a standalone feature if possible.
-Benge, keep focused.

PiBenge
Posts: 34
Joined: Sun Sep 14, 2014 9:59 am

Re: RFID/Electromagnetic Lock

Mon Dec 29, 2014 4:51 pm

If I am using the equipment I have listed, does anyone have a diagram of a circuit that's useable for it. Noteable the Electromagnetic lock requires 12v, 380mA-430mA (Between 4.56-5.16w). I don't want the raspberry pi to be damaged so is there a way to get around this? Besides this, the Raspberry Pi is also using 3 LEDs with the GPIO Outputs as well.
-Benge, keep focused.

danjperron
Posts: 3406
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: RFID/Electromagnetic Lock

Mon Dec 29, 2014 5:10 pm

The only concern willl be the 12V magnetic lock.


Just use an optoisolated relay like this one.


http://www.dx.com/p/one-channel-12v-rel ... #.VKGKOsAA

It is already 12V and the optocoupler will isolate the RPi . The 3.3v GPIO could be hook up directly. Don't forget to put ground.


Daniel

PiBenge
Posts: 34
Joined: Sun Sep 14, 2014 9:59 am

Re: RFID/Electromagnetic Lock

Mon Dec 29, 2014 5:28 pm

Thanks Daniel,

I will look into that and it looks trusting. By any chance do you have a way to set this up with the raspberry Pi? And what do you mean by ground (Sorry if this is a stupid question...First Time using the GPIO Pins and Electrical Circuits and already researched a fair bit)
-Benge, keep focused.

danjperron
Posts: 3406
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: RFID/Electromagnetic Lock

Mon Dec 29, 2014 6:26 pm

be sure that the ground for 12V is connect to the ground for the Raspberry PI 5V.

Looks like that relay has the same ground to activate the coil and activate the opto-coupler.

If you are using python , just use the gpio interface to activate the relay. The magnetic lock will be on the other side of the relay. Maybe a 5V coil relay will be better . You won't have to bring 12V near the raspberry PI and could be completely isolated .

With a 5V relay the power could be provided with the raspberry Pi. I assume that the power supply is strong enough.

http://www.dx.com/p/diy-5v-relay-isolat ... #.VKGa3sAA

PiBenge
Posts: 34
Joined: Sun Sep 14, 2014 9:59 am

Re: RFID/Electromagnetic Lock

Mon Dec 29, 2014 6:51 pm

Problem is the magnetic lock requires 12v. The Raspberry Pi using GPIO Pins can only provide the 5v. Just found this and this should solve my problem perfectly.
-Benge, keep focused.

danjperron
Posts: 3406
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: RFID/Electromagnetic Lock

Mon Dec 29, 2014 8:32 pm

What did I just said.


Use a 5 volts relay with optocoupler like the one from the last post and use the contact side of the relay to power 12V on the magnetic lock!


This way your are using only 5 Volt from the connector P1 of the Raspberry PI to power the relay circuitry.
You bring 12V on the relay contact side which goes to the magnetic lock.
Use one of the GPIO with python to toggle the input pin of the relay which is protected by an optocoupler and it will work with 3.3V signal.


I can't make a schematic right now but I will do it tonight (eastern time).

PiBenge
Posts: 34
Joined: Sun Sep 14, 2014 9:59 am

Re: RFID/Electromagnetic Lock

Tue Dec 30, 2014 10:45 am

Dont worry dude, I know what you mean now and have researched enough to develop the whole project now. Really good tutorial.

https://www.youtube.com/watch?v=3u45htuQeag
-Benge, keep focused.

kevin1328
Posts: 3
Joined: Tue Dec 30, 2014 1:04 pm

Re: RFID/Electromagnetic Lock

Tue Dec 30, 2014 1:16 pm

Hi PiBenge, does your USB RFID Reader appears to be USBtty? or Hidraw0? in /dev ?

PiBenge
Posts: 34
Joined: Sun Sep 14, 2014 9:59 am

Re: RFID/Electromagnetic Lock

Tue Dec 30, 2014 3:14 pm

Haven't got the reader yet but its a HID RFID Reader.
-Benge, keep focused.

lew23
Posts: 4
Joined: Sun Feb 28, 2016 2:00 pm

Re: RFID/Electromagnetic Lock

Sun Feb 28, 2016 2:04 pm

Hello,

@danjperron Have you made a tutorial for this and if so could you link me? I want to achieve something like this in my house...

Thank you

danjperron
Posts: 3406
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: RFID/Electromagnetic Lock

Sun Feb 28, 2016 3:38 pm

No not yet but I will make a youtube video in a near futur explaining how it works. I did have two demo units simulating the door.

But sorry the video will be in french since I'm part of a raspberry pi group in montreal.

Annihilation989
Posts: 12
Joined: Wed Feb 14, 2018 3:37 pm

Re: RFID/Electromagnetic Lock

Sun Sep 08, 2019 7:43 pm

Could you post a link to your video please.

danjperron
Posts: 3406
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: RFID/Electromagnetic Lock

Mon Sep 09, 2019 12:32 am


Annihilation989
Posts: 12
Joined: Wed Feb 14, 2018 3:37 pm

Re: RFID/Electromagnetic Lock

Mon Sep 09, 2019 5:51 pm

Thanks

Return to “Other projects”