Main Content

DIY Keypad Entry System with PIC16 Microcontroller and Solenoid

Nothing is more irritating than someone going through your cupboards or your personal space. If you (like myself) feel that it needs to stop then worry no more! In this project, you will learn how to build a 12-key keypad entry system that only unlocks itself when the correct passcode has been entered. At the heart of the circuit is the PIC16F84 (but this could also be the PIC16F88 or the PIC16F819) which reads the key presses, and controls the solenoid and the beeper. Each key has a diode to prevent multiple key presses from causing interference and the microcontroller scans one row at a time. When the microcontroller detects that the enter key has been pressed it will check to see if the entered code is equal to the passcode. If the code matches the system, it activates the solenoid and this allows for the door, cupboard, or whatever you want to lock to open. The system releases the solenoid only when the micro switch has been activated, which is used to detect when the door has been closed. When buttons are pressed, the microcontroller also makes a short beep occur on the buzzer. If the wrong code is typed, the buzzer will make 3 beeps to indicate that the code is incorrect. If the code is correct, the beeper makes 9 short beeps and engages the solenoid to indicate success. The power regulation circuitry is provided by a 7805 with all the needed reverse protection, EMF protection, and smoothing. The buzzer and solenoid are also in parallel with diodes to prevent damage from occurring to the transistors that control them.”

Link to article