last day (31 days later) » 

12:01
1
Q: Raspberry Pi , RFID , Relay Module and Magnetic Door

Ahtisham AshrafI have used the code from github and in that code i am implementing the raspberry pi and the RFID and relay module with magnetic door unlock. Everything is working Okay , the RFID , the Relay module and the button. When the Card is scanned the relay module light turn on and i can hear the tick so...

Ah let me see. Let us make things as simple as possible, but not simpler. So your RFID function works only for the first time, then you need to reset Rpi. I remember when I tested my RFID module, I wrote 3 functions: (1) A function to read RFID card, (2) Another function to print what is read from the RFID card. (3) A main function to loop the first two functions. If you write a minimal program to just test the above three functions, then it should be much easier to debug. You might search my RFID demos in the following forums: (a) SO, (b) EE SE, (c) Rpi SE.
This is another demo. You can find more references in those answers. (4) Can RFID read stacked cards? electronics.stackexchange.com/questions/519993/…. Cheers.
The last demo has the functions I suggested: def main(): #testRc522(); #writeRfidCard('Diamond Ace'); #readRfidCard(); #writeRfidCard('Heart Ace'); #readRfidCard(); #writeRfidCard('Club Ace'); #readRfidCard(); #writeRfidCard('Spade Ace'); #readRfidCard(); readRfidCard(); return;
The RFID works all okay until i power up the 12 V Electromagnetic Lock. The Relay is working Okay as well until the 12 V Lock is not given the power. It scans the RFID and then the light on relay turn on and i can hear the tick of relay. It works perfectly but as soon as the Electromagnetic Door is powered on the RFID works for the first time and then it kinda stop working but the button to unlock works like a charm.
Can you give us the link to (1) the code, (2) tutorial how to use it. Cheers.
(1) So before 12V power on, you can (a) use RFID to unlock (note 1) or (b) press the button. (Note 1sort of, because 12V power is not yet on.), (2) Now 12V power on, (a) you can use RFID but only for the first time, (b) manual button works as before, as many times as you like. (3) After RFID has worked for the first time, it won't work again, unless Rpi is reset.
(4) I guess the button is designed to click/unlock as many times as you like, and it has no memory. But for the RFID, there is memory, once it remember that door is unlocked, it won't click the relay again. But only while guess. It would be nice you has the user manual.
I have implemented it exactly like mentioned in the code github.com/lesp/LXF230-RFID-Door-Lock , the issue that the RFID works as well and it works as many times as we want until the 12 V power is supplied to the relay. As soon as power is turned on the RFID stops working. If i turn off the power now it still doesn't work until the raspberry is restarted
now let me explain in bit detail 1. Turn on the Raspberry with the python code. 2. Scan the RFID Card, it is working perfectly with no limit to scan, i can scan it 1000 times without any issue. Relay light is on and relay is tripping 3. Press the button to unlock working Perfectly. Relay is on and relay is tripping. Now Let's turn on the 12 V Electromagnetic Door Power 4. RFID Scans the card, Relay light is on , Relay is tripped. Relay is closed again , light in relay goes off. Now i when scanning the card it is not working again. 5. Button unlock works all the time
There is an issue between the relay and the reverse voltage i guess that relay passes to the board which disable the RFID as per me but i am not sure. The code is not having any issue until i turn on the 12 V power to relay
Ha, You did say a couple of times, even with emphasis, that "The code is not having any issue until i turn on the 12 V power to relay". But I do have a strong excuse that I missed this very important sentence. The reason is that your question is some 12 sentences long, and I cannot count more than seven! :) / to continue, ...
You see, I break a long comment into two short comments! :) Anyway, my first brainstorming wild guess the this: "Switching on 12V power might cause some abrupt current and generate EMF (Electronmagnet Wave), or Back EMF which might cause trouble (I don't know what sort of trouble). / to continue, ...
Now what I don't understand is why you don't do this: Also switch on 12V power BEFORE testing anything!. Of course you should have a good reason not to switch on 12V power, say until you leave home. But this is a troubleshooting trick to investigate further. So you might like try it. Cheers.
Our chat is getting too long. Perhaps we carry on here. See you later. Cheers.

  last day (31 days later) »