Drawer lock project help needed

I am trying to create a lock that I can open using an NFC card. I was able to do all the NFC stuff, but I am kind of stuck with the lock and I hope someone can help.

I am using a NodeMCU ESP8266 board. The lock I purchased is a cheap Chinese lock, for which I was not able to get a manual, all I have is the following picture from the site I bought it, but some info is in Hungarian.

So according to the image the lock needs 3-5 volts, and as far as I know the NodeMCU can give 3.3 volts, which should be good. According to the picture, the red cable should be the power, black is the ground and blue should be the signal cable (written in Hungarian on the image).

I connected all the cables to the device, and created a very small code that gives a 10 second signal to the lock. I also tested this with an LED, and the LED light up perfectly fine. However, if I attach the lock itself, as soon as I connect the power the lock releases, so I think something is working. However, nothing happens when I give a signal through the blue cable. I also tried the yellow one, which I have no idea what it does, but no luck there.

Another interesting thing I was able to gather is that when I push the lock to a closed position by force it is released again in a couple of seconds. The NodeMCU was plugged into a computer during this test, and as soon as I push the lock to a closed position, Windows gives the "device detached" sound, like I am disconnecting the NodeMCU board. If I put the aforementioned LED in series with the lock, its brightness is decreased by a lot as soon as I force the lock to a closed position.

I am very new to electronics, and I think that maybe the lock needs more voltage? Maybe the picture is wrong, and 5 volts is needed in order for it to operate? Or am I missing something crucial? In case the lock would need 5 volts, is there an easy way to do that with a NodeMCU? I know that some Arduino boards can give 5 volts, but NodeMCU is much cheaper, and I would like to keep it cheap for now.

Thanks a lot!

Perhaps for the "signal" but not for the power. Have you tested it? What is the signal? Is the signal to "lock"? Or to "unlock"? Or is it alternating lock and unlock?

I was not able to test it sadly, as I only have the NodeMCU board. What would be the ideal way to test this?

Use you 5 volt supply. No Arduino needed.

I am powering the NodeMCU directly from a computer using an USB cable. So I should take the USB cable apart, and plug it directly into the lock?

That would be risking your computer if the lock takes too much current. Better use an old 5V output cell phone charger.

I will try that, thanks a lot!

So I tried it with a 5V 2A phone charger, I took an USB cable apart, and plugged it in. The lock released, but again, the signal coming from the NoceMCU did nothing. I measured the signal from the NodeMCU and it is 3.3V as expected. The other problem is that after a couple of seconds the lock got really hot, and I had to plug it out, but I think I cooked it :frowning:

I think your problem will be solved if you use an NodeMCU compatible relay board in between.

So now you know why experienced hobbyists will not buy anything that does not come with, or have available, decent documentation.

Then that tells you that the lock needs a short pulse to power the lock while it is moving from lock to lock and the same for unlock.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.