Download Solenoid Door Lock: Fritzing New!

Place a 1N4007 diode directly across the two terminals of the solenoid. Ensure the cathode (the side with the silver stripe) connects to the positive 12V line, and the anode connects to the Drain pin. This safely dissipates back-EMF spikes when the lock turns off.

Without protection, this spike will destroy the transistor.

bool checkUID(byte *uid) for (byte i = 0; i < 4; i++) if (uid[i] != validUID[i]) return false; download solenoid door lock fritzing

You must connect the Ground ( GND ) pin of your Arduino to the Negative ( - ) terminal of the external 12V power supply. Without this shared ground reference, the MOSFET cannot properly read the digital trigger signal from the microcontroller. 🛠️ Optimizing the Schematic and PCB Views

Note: If you cannot find a specific graphic for the lock, you can use a generic "Solenoid" symbol in Schematic view or a generic 2-pin connector in Breadboard view. Place a 1N4007 diode directly across the two

Add a across the solenoid terminals to protect the circuit from reverse voltage spikes. 4. Best Practices for Solenoid Projects

Correct wiring diagrams prevent short circuits that can burn out your Arduino or solenoid. Without protection, this spike will destroy the transistor

The RC522 module's pins connect directly to Arduino:

The breadboard view accurately mimics the look of the metallic frame, mounting holes, and wire leads of a standard 12V cabinet or door solenoid.

For a visual reference, many tutorials (like the one at ArduinoGetStarted.com) include a Fritzing‑generated diagram that clearly shows these connections.