DIY Security system
Security systems are available now days from almost any type of outlet; hardware stores and even some grocery stores. Unfortunately, the rising crime in our neighbourhoods has made the need for security as necessary as buying drain cleaner.
Getting systems like these installed professionally however, can be expensive and at time frustrating since all you get is a very non-configurable stock standard, off the shelf home security system.
Over the next couple of postings, we are going to be looking at how to plan and construct a simple key pad system. The scope of the project is to also demonstrate how a single project can be started on one PCB i.e. the ProtoDev 18 and then as requirements change, expanded to use the ProtoDev 40.
First, let’s look at some of the key elements of our security system.
The most obvious starting point is the key pad itself. This will, in the long run be the user’s main point of interaction with the system.
The keypad we will use is a straight forward unit which is basically a 4 x 4 matrix of keys. In most respects this is simply what a key pad is. The keys are arranged in columns and rows. Depending on how your library works, for example the columns are driven one by one and the software waits for a button to be pressed. When the button is pressed, the circuit between a column and a row is completed and that completed circuit is decoded to represent a known value.
The software is waiting for a correct sequence of key presses and the user would be required to enter the full sequence for a correct entry to be acknowledged.
Once the user has entered the required number of digits, this is compared with the complete code stored in memory for the item under lock and “key” can be accessed.
Some additional features can be added to the software, as follows:
• Key entry must be done in a set period of time or the key pad resets itself
• If an incorrect entry takes place three times the keypad locks itself from further use
The Microcontroller and Software
The first step in the project is to use a simple 18 PIN device. Unfortunately these devices are a bit short on I/O so the initial system code will basically manage the keypad and then 1 or 2 outputs. The plan is to use a PIC16F628 which is one of the devices you would receive when purchasing a ProtoDev 18 and later the code will be migrated to the PIC16F887. Again, a device we deliver as part of the deal in the ProtoDev – 40.
The role of the software for phase 1, would be to
- Monitor the keypad for a keypad entry
- When an entry is made, compare the entry with a known value
- When the entry is correct active the output
- When wrong deny entry
- Add keypad time outs
- Add keypad lockouts
- Monitor additional I/O to ensure that other configure systems are not compromised
All of the above will be squeezed into a PIC16F628 and then later we will upgrade the project to a PIC16F887 for expanded functionality.
Once the code is entered correctly, the microcontroller must do something with the code. In the simplified system, it will activate an output. The output drives circuitry that releases a magnetic lock and access is achieved.
Since your insurance company will most likely want a certified system, this system is best suited for an outhouse or even just a cabinet that needs to be secured.
Stay posted as there is more to follow!