I work for an escape room business, I create tricks and props using arduinos. Most of the time the Arduino has to take input from a player using buttons, sensors, etc. and locks/unlocks and electromagnetic lock for either a door or drawer or something. The locks are always controlled via relays and their respective arduino.
The problem is that installation can get quite messy and unruly since we have so many locks and arduinos that need power supplies. So for now I've been using a 12V power supply that powers the arduino through a 7805 voltage regulator as well as the lock. .
Note: I am using a relay module board that has all the necessary components for reliability such as the transistor before the coil and an optocoupler.
However, I've been having problems with this circuit.
The voltage regulator gets very very hot, even with a heatsink on it. When the relay disengages the lock, the arduino becomes unresponsive and requires a reboot to work properly again. The power supplies I am using are 12v 1000mA. And the electromagnetic locks I am using use up to 500mA when engaged.
My question is: is there a more reliable or easier way to power both the arduino and electromagnetic lock using the same power supply.