Boxed Layout

header ads

Electronic Security System using PIC18F4550 with RTC

This is a project that I made using pic microcontroller its an Electronic PIN Code Security System with real time clock and user define pin code features, this page contains all the details to make one yourself.
ITS WORKING AND CONCEPT:
Well by turning Security System on, it will ask for a PINCODE to open gate, (its 140595) if you enter it correct, the door will open. Door is opened for 1 min only, then its closed again. If you enter pin code wrong Security System will give you 3 more chances, if all chances are wasted then it turns buzzer on, and asks for alternative code to stop buzzer, if this alternative code (i.e. 1984) is entered correctly then:
1) It stops buzzer
2) Resets original code which was 140595
3) Asks new code to replace original code which was 140595 (not more then 6 digits)
now the gate will be opened by this new code.
Suppose a wrong alternative code is inserted then System asks to wait for countdown of 1 min during which all buttons are disabled and buzzer keeps ringing.

VIDEO:



Ready? Okay lets make it..!

Before we get started, I am assuming that you already have basic knowledge of C language and have worked on MikroC pro before and that you know how to glow an LED, how to interface a LCD with a PIC Microcontroller.

Step 1: Gathering Components

FOR PROJECT:
S.No. | QUANTITY | COMPONENT | INFO
1) 1 16x2 LCD Pin 14 to Pin 1 then Pin 15 and Pin 16 pins package.
2) 1 PIC18F4550 Microcontroller
3) 1 PCF8583 Real Time Clock (RTC) IC
4) 14 Reset Buttons Instead of Keypad I used reset buttons
5) 1 9v Battery Main power supply.
6) 1 10K Ohm Pot For setting contrast of LCD
7) 2 3.5mm audio jacks for externally connecting buzzer and gate
8) 1 100uF Capacitor Ceremic cap for using with pin1 of controller.
9) 1 32.682kHz Crystal For PCF8583 IC
10) 1 DC Power Jack If using project with a DC adapter
11) 1 IC7805 For converting 9V to 5V
12) 1 1K Ohm resistor for using with pin1 of controller.
13) 3 10K Ohm resistor for using with pin1 of controller and RTC IC
14) 13 220 Ohm resistor each button will use 1 220 Ohm I'll explain later
15) 1 3V Cell for using with RTC IC
16) 1 Switch
17) 1 PCB Board your choice if your comfortable on verro its fine.
18) 1 8 pin DIP for RTC IC
19) 1 40 pin DIP for PIC184550 or you can Zip socket if you want
20) 1 3V Cell holder
21) 1 9V Battery holder
22) 1 male header for soldering with LCD
23) 1 female header for soldering on PCB or verro where LCD will be placed.
OTHER PARTS:
20) Breadboard for testing
21) Soldering iron
22) Soldering wire
23) PIC Programmer (or PICKIT2)
24) Etching solution (for PCB)
25) PCB Drill
26) Multimeter
One think you'll notice I haven't included a crystal for PIC Microcontroller right ? Well thats because I used internal Oscillator of PIC18F4550

Step 2: Testing Schematics & Programming



I tested the code using Proteus, 
You can Download coding files, schematic, PCB design files from here:

Step 3: PCB Etching


I will recommend you to build this project on PCB don't use verroboard.
Print this PCB, it was designed on Cadsoft Eagle by me. If you have cadsoft eagle installed open up brd file (download below) and generate file according to your requirement of page size.
Otherwise I have attached two files on is of A4 and other is A5, print and check place components then print your PCB. I am asking this because there may be a page scale factor.
NOTE:
You can power up project by either a battery which is to be connected to the connector near to 7805, watch out for polarity. OR you can power up project by an adapter through the DC Power jack. The power sources can be switched by the switch, when switch is pushed the circuit powers up from external source through connector, when button is pushed outside the circuit powers up from DC power jack.

Step 4: Soldering Components


Solder all components, see the pictures attached.
One thing I have to tell you, since proteus is ideal thats why the buttons are connected directly to the microcontroller pin without a resistor.
But in practical we have to use resistors with each button.
Like suppose, in this project if you press button 4 one time, on proteus you'll get 4 on LCD, but if you press it in real life you'll get 44444444 on LCD due to noise. To remove this bounce effect pcb contains 220 Ohm resistor with every button.

Step 5: Programming RTC IC PCF8583


Okay this is a little tricky thing but since code is provided it won't be that tricky. I did not gave .hex file for programming RTC IC since you have to generate it to set you required time.
Open up your software IDE for PIC, I normally use MikroC Pro for PIC and select PIC18F4550, copy and paste the code provided in the files.
If you haven't downloaded click here.
Generate a hex file from Mikroc Pro for PIC after compiling then burn it to pic microcontroller PIC18F4550
Place it on the pcb soldered with all components, turn it on. The LCD should display "Setting Time..." then when it displays "Time Set!" turn power off. Remove PIC microcontroller from DIP you have successfully programmed PCF8583 RTC IC. 

Step 6: Burn Main Code

Well the hex file is already provided in Step2 you can burn it to your PIC18F4550 through PIC Programmer. The file name is maincode.c, hex file is also provided.

Step 7: Testing and Result



Attach an LED to the lower right 3.5mm audio jack and a buzzer to the upper right 3.5mm jack. Place your programmed PIC18F4550 on pcb and turn power on.

When correct code is entered it gives logic 1 to lower led, I assumed when giving logic 1 to led it opens up gate.

You Electronic Security System should be ready now...! And if you have done every thing write it should work fine.

Enjoy!

Post a Comment

0 Comments