Hi, I have recently do up a similar project using a servo instead of a magnetic lock and it was successful. However, now by having to replace the magnetic lock with a servo, i got confused and clueless on how the wiring should be like and how does the program has to change to serve the same purpose but only using a magnetic lock instead of a servo to allow access to authorized RFID card. Now the 3 wires that are connected from the arduino UNO to the servo to control it are ( +5V, Pin 8 , GND).
I was looking through the website and i found this picture that made a connection using arduino to control a magnetic lock. I am not sure whether is it relevant to my plan of replacing the servo i had with a magnetic lock instead but i need some guidance to the suggested circuit under the door strike section of the link below.Gammon Forum : Electronics : Microprocessors : RFID readers for access control / event management / parties
Anyways , my magnetic lock is the 12V and 0.5mA powered one.
Attached is my schematic diagram of the project and need guidance on the wiring part of how to replace the servo with a magnetic lock.
Hi, thanks for the quick reply, i have done the connection but it seems to not power up the magnetic lock but the process is going as per normal. Hope you can guide me on the connection part as i am a bit lost on the lock pins and the triangle shapes. I am not sure where to connect on the connection the 3 pins stated above that is being used by the servo previously namely ( +5V, Pin 8 and GND).
Your servo should not have been powered from the Arduino 5V in the first place, ie not the red wire, it should only have been controlled, the orange wire.
The door lock can't replace the servo as such, not in the sense of take servo out and put lock in anyway. So forget about the process going on as normal for now, because the commands which move the servo are nothing like the commands which make an i/o pin high or low. Your sketch will need changing.
So for a start, forget about your existing Arduino sketch. Hook the lock up as shown in Nick Gammon's pic, using whatever pin you like, and you could test it with a sketch like Blink I guess, just to activate / de-activate it. But you must use a mosfet as shown; you can't power the lock from an i/o pin of the Arduino. And it needs that diode across it too, as shown.
I dont understand what are the lock pin , Gate symbol and the small triangles at the picture of gammons connection. Hope you can help by further elaborating more on those points mentioned as now i dont even have a clue on how to build up that circuit.
Ok, lock pin just refers to the pin on your arduino that you have designated to be the control pin, like say pin 8 or whatever.
byte lockPin=8; // say
The big symbol in the middle is the whole mosfet. Its connectors are Gate on the left, Drain on the top, and Source at the bottom.
The downward pointing traingle arrow thingies at the bottom just mean common ground; sometimes shown as 3 short horizontal lines which you may have seen elsewhere.