spacehuhn / wifi_ducky

Upload, save and run keystroke injection payloads with an ESP8266 + ATMEGA32U4
MIT License
1.28k stars 294 forks source link

ESP32 - Solenoid Electromagnetic Lock - power issue from Relay to Lock #113

Open cnu77 opened 1 year ago

cnu77 commented 1 year ago

I tried the electromagnetic lock for my kid's school project.

https://esp32io.com/tutorials/esp32-button-controls-electromagnetic-lock

Circuit_1

I am using a 12V solenoid lock. Adapter is 5V (tried 12V, but it made the lock hotter) to power the lock and relay.

For ESP32, I am using an USB power.

The objective is to unlock the magneticlock for 10 seconds when the button is pressed. After so many iterations, when I press the button, the Relay is able to get the inputs.

But the Solenoid lock is always in Locked status. Not sure where the problem is. Is the because ESP32 is 3.3v and the power is 5v?

From 5V adapter: +ve to the lock -ve to the COM of Relay

Lock to NC of Relay.

Relay: GPIO 27 is connected to VIN GND to GND 5V to IN

b623a1e9-9489-4ec3-a2c8-0396f9eeaf17

Kindly help.