« first day (7 days earlier)      last day (23 days later) » 

2:36 AM
@AhtishamAshraf I read the door lock ad again and found it saying that it uses magnetic force which seems not solenoid at all. My old solenoid lock using a string to pull a hinged door for my cat (wearing a RFID tag on her neck) food dispenser is too weak to pull something. So I have ordered 4 hopefully strong locks for my and my neighbour's cat food feeders. Below is the order I placed this mroning.
I am ordering two versions: 12V 350mA, and 12V 600mA. Now I can use my scope to display corresponding Back EMF pulses! :)
 
 
3 hours later…
5:16 AM
@tlfong01 I have installed the SPI-py package as well. Like in the start of discussion it worked perfectly without any issue until the Electromagnet Module is given 12 V Current.
 
 
2 hours later…
6:51 AM
@AhtishamAshraf (1) Thanks a lot for your confirmation on SPI-py. So I still think we are almost there, or walking the last mile. (2) By the principle of "if it ain't brike, don't fix it", we should not change anything on your almost working hardware/software configuartaion. (3) I would suggest the following cross checking procedure: (a) You backup your working programs, and try to install a copy of the same code to test your new 6V solenoid door lock,
(b) I will also use the old package, install SPI-py, MFRC522 programs and test my 12V 350mA, and 12V 600mA door locks. (4) If we have bad luck that both of us have the same "You only live once" fate, then we can start debugging, perhaps me trying to replace the third party SPI-py by the Rpi builtin SPI package, and see if I can then add Rpi Thonny python console debug print statements, to narrow down where is the cause of trouble.
You can, on your side, at the same time debug any way you think good.
Question: Are you using Rpi Thonny python IDE, or all CLI commands?
 
 
3 hours later…
9:35 AM
@AhtishamAshraf Now I have new idea. Part 1: (1) I know now you are using Rpi to control a 2 channel JD-Vcc jumper low level trigger relay. The relay's COM is connected to +12V and NC is connected to door lock +, and 12V ground is connected to door lock -. (2) (a) So now when you supply 12V power, and there is no 3V3 input signal to the relay input, (b) so COM and NC is connected/shorted, (c) so +12V passes through COM, to NC to door lock +, switching on door lock, then current goes to ground.
(3) So now if Rpi sends Low signal to relay, NC is now open, the +12V at COM is no longer connected to NC. In other words, current is switch off. Therefore door lock is unlocked.
Now, Part 2 is my new idea. The new idea is to replace the relay which acts as a current switch by a N-channel Power MOSFET IRL540N which can also acts as a switch.
Some two years ago I already tried to use the above IRL/IRN540N to switch on off a 350mA current motor. This time I am instead switching on/off the door lock which like the motor, is inductive, and so needs flyback diodes to prevent back EMF. Now I am showing two schematics, (1) Using relay, (2) Using IRL540N.
@AhtishamAshraf Now the IRL540N not a relay switches on/off current to the motor. (1) The left diode is just status diode indicating current is on, (2) The right diode is the flyback idode. Now let me show you the schematic of magnetic door using IRL540N to switch on/off the current.
You might have noticed that there is no flyback diode for the magnetic door lock. The reason is that the IRL540N already has a built in flyback diode. I am only 60% sure that my circuit using IRL540N works. So I need to study the datasheet and then do the experiment. Stay tuned. :)
Ah locking down jogging and supper time. See you later. Cheers.
I forgot to mention that relay contacts switching is open air, therefore causing sparking. For the mostfet switch, it is not open air, all things happen inside the IC package, so if works, should be good. But only 60% sure that it will work.
 
 
1 hour later…
10:59 AM
I will try with this one @tlfong01
 
 
2 hours later…
1:09 PM
@AhtishamAshraf Apology - On second thought, I think the flyback for the magnetic lock is necessary, because the mosfet's built in flyback seem not in the back EMF path.
So you may try v0.3 as shown in Appendix G. Warning There is 40% chance that something might be fried! :) Good luck and cheers.
@AhtishamAshraf One more thing. Even it works, we may still need to consider using an optical coupler such as EL817C, as used in the original JD-Vcc relay version, to reduce noise, also suppress back EMF.
 

« first day (7 days earlier)      last day (23 days later) »