Good afternoon
I am currently working on a project to create a gym pass system. I am a programmer with zero knowledge of electronics as such, so I apologise for the possibly trivial question
The project consists of opening the door in the case of a valid pass (QR scanning by the camera - I have already written the code for this). Generally I have everything ready and all that remains is to bundle it all together. The door will be secured with an electromagnetic latch, which will release on the basis of an impulse. In my solution, I plan to connect the ESP32 directly to my laptop via USB and control it using the python API.
As to the core of my question. I have watched a lot of tutorials with similar ideas, where people used a 12v battery and a 5v relay to provide power for the ESP32 as well as for the hitch. In my case the ESP32 will be connected to the PC via USB. Does the relay then become a redundant component? Can I then successively send an impulse to the abutment from my PC via the ESP32?
I am currently working on a project to create a gym pass system. I am a programmer with zero knowledge of electronics as such, so I apologise for the possibly trivial question

The project consists of opening the door in the case of a valid pass (QR scanning by the camera - I have already written the code for this). Generally I have everything ready and all that remains is to bundle it all together. The door will be secured with an electromagnetic latch, which will release on the basis of an impulse. In my solution, I plan to connect the ESP32 directly to my laptop via USB and control it using the python API.
As to the core of my question. I have watched a lot of tutorials with similar ideas, where people used a 12v battery and a 5v relay to provide power for the ESP32 as well as for the hitch. In my case the ESP32 will be connected to the PC via USB. Does the relay then become a redundant component? Can I then successively send an impulse to the abutment from my PC via the ESP32?