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.
3 hours later…
5:16 AM
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.
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.
1 hour later…
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.
« first day (7 days earlier) ← previous day next day → last day (23 days later) »
Transcript for
May2
May '213
May4
Discussion between tlfong01 and Ahtis…
Imported from a comment discussion on raspberrypi.stackexchang...