« first day (2 days earlier)      last day (28 days later) » 

2:47 AM
@AhtishamAshraf This morning I read a question similar to yours. Perhaps we can compile a FAQ! :)
My rfid-rc522 reader stops reading after some time, how can I debug it? - EESE 2021apr28
https://raspberrypi.stackexchange.com/questions/124397/my-rfid-rc522-reader-stops-reading-after-some-time-how-can-i-debug-it
 
 
1 hour later…
4:03 AM
@AhtishamAshraf My last link seems broken. raspberrypi.stackexchange.com/questions/124397/…
 
 
1 hour later…
5:13 AM
@tlfong01 one more thing to mention i have the same model of raspberry pi in the above link Pi 3 Model B+(2017)
and the thing is that i have tested the relay with the light bulb powering with 3.3 V and the card seems working perfectly every time without any issue. There must be some issue related with the 12 V and the Relay, with 3.3 V it works like a charm
 
6:13 AM
@AhtishamAshraf Ha, firstly one important thing to confirm. When you said: "I have tested the relay with the light bulb powering with 3.3 V...", did you mean that (1) You did test the relay with a 3.3V power light bulb (***Question:***Is this "light bulb" just an ordinary LED?). Did you test the light bulb as a fake electromagnetic lock?
I mean, before you tested the real electromagnetic lock, you tested the waters by first testing a light bulb. Actually this is almost the same thing I suggested earlier: (1) Put aside the lock, (2) Instead of the real lock, use a 12V powered LED with a 1kΩ as a "fake lock", and see if the RFID card can operate on this fake lock smoothly, many many times as you like, not just "You can only live once"?
@AhtishamAshraf (1) I am 95% sure that Rpi model does not matter. (2) If you said testing the light bulb was like a charm, I am 80% sure that the relay (and Rpi and software) does not matter. (3) What remains is the 12V power supply unit (PSU). (4) BTW, I am still waiting for the link to your lock.
I must know exactly if your lock is (a) "locking the door" is activated when 12V power is switched on, or (b) "unlocking the door" is activated when power is on? No hurry though. I am feeling that we are almost there (one last mile!)
 
 
3 hours later…
8:58 AM
I tested with the ordinary LED using the raspberry 3.3 V Power and the RFID and about the Second one i am implementing the (b) unlocking the door, the Power cable is connected to the Closed Relay and it is passing the current constantly and as soon as i scan the RFID it opens the Circuit and the Current Stops and the Door Opens. I have tried either Ways using NO and NC but still the same. @tlfong01
 
9:18 AM
@AhtishamAshraf Ha, so you seem to have explored almost all the possibilities. So let me confirm: (1) You used the fake door lock (ordinary status/indicator/hobbyist LED, in series with current limiting resistor (perhaps 470Ω, but not important/relevant). powered by Rpi's 3V3 rail.
(2) And you confirmed the following: "... the Power cable is connected to the Closed Relay and it is passing the current constantly and as soon as i scan the RFID it opens the Circuit and the Current Stops and the Door Opens...."
I think I understand 90% of what you say in (1) and (2) above. Now I think there are at least two possibilities: (1) 12V powered door lock in "door closed" state, current passing from 12V+ through relay's COM and NC to door lock, ... , then when RFID reader caused Rpi to switch off relay and lock, creates Back EMF which corrupts Rpi's software, therefore need to reset to restart program.
I am thinking aloud, so not that organized, and I am slow in writing and thinking, so any casual errors and typos could not meet this chatroom's no more editing after 3/5 minutes limit. In other words, many of my errors stay permanent, ... :(
PS - I know very little about the door lock you are using. My experience is only with plain, bare bone solenoid type lock. So I might miss something important. You might like to skim my new references on locks and let me know if your lock looks like any of them. No hurry though. Ah, locking down jogging/supper time. I need to go. See you later. Cheers. PS - You might like to skim my other answer on Back EMF to get a rough idea of what might be going on inside your lock.
 
 
2 hours later…
11:37 AM
I was aware of the Back EMF and i found it on the first place , i wanted to know if there is any solution for this one to fix? like anything i need to add in the diagram @tlfong01
 
 
1 hour later…
1:02 PM
@AhtishamAshraf (1) For Back EMF, as I suggested in the very beginning, use total optical isolation wiring, as described in my answer in "How to use JD-Vcc jumpered relays""". (2) A related trouble maker is EMI, and you might like to try the four methods described in Appendix C of my answer to "What is Back EMF?".
Ref 15 suggests how to reduce noise (Back EMF and EMI) has more references, especially Ref 8, 9 in grounding using decoupling capacitors.
I have more troubleshooting suggestions: (1) (a) Instead of the RFID Lock program, write a small python program to test if disconnecting 12V lock power can disturb python program, (1) the small test program does the following: loop indefinitely, every 0.5 sec, print time at Thonny output shell.
(ii) Instead of using sofware control, use a manual switch to power lock, then switch off power, to see if Back EMF and/or EMI would disturb or reset the loop printing program. You might like to suggest other troubleshooting little programs.
@AhtishamAshraf Yet another suggestion: (1) Insert Thonny console log/loop indefinitely print statements in the Appendix A LX230 RFID Rpi python program. Good luck. See you tomorrow. Cheers.
 
 
1 hour later…
2:39 PM
@AhtishamAshraf I read the spec of the lock I referenced and found something that I didn't know that I didn't know. As I said earlier, I only knew about simple, plain, bare bone, solenoid that door lock, and the moving part, a stick like thing is not powerful at all, and I can use a finger to stop the movement. But for the lock, There is no moving part at all, all magnetic, and the lock force is 1,200 lbs!
So my wild guess is that only 12V, 250mA might have built a very strong magnetic field. And when Rpi and RFID reader read the RFID card, they switch off the lock current, and so the big magnetic collapsed suddenly, cause big Back EMF and EMI, therefore disturbed. One more suggestion is this: move the lock 10 ft from Rpi and see if there is any improvement, or problem disappeared..
 

« first day (2 days earlier)      last day (28 days later) »