I get 24V from the barrel jack.
The electromagnet is controlled using PWM.
Here, I made a mistake and the diode direction is reversed. (The diode is placed to protect from back EMF.)
When I plugged in the power it maded a sound and the power adapter shut off automatically.
After this, I removed the electromagnet and plugged the power in again, but now the adapter always shuts off after some milliseconds.
Before I tried the electromagnet, the power adapter worked well and thed LED turns on. After I connected the electromagnet with the wrong diode direction, it stopped working.
I know I made a mistake with the diode, but I am not sure if this can destroy the circuit. If so, how? If I simply fix the diode position, this will be solved?