A Practical Design of Anti-Theft Car Protection System Based on Microcontroller

: Problem statement: This study presents a new design for an anti-theft protection System as an inexpensive solution to protect cars from theft and from non-authorized users by using microcontroller-based system. Approach: Three stages of protection to strengthen the security of the car: Firstly, when the user access the car by the car key and entered the wrong password, the power is remain disable. If the power shifted by others, the second level comes by disabling the starter motor from being turned on, so the stolen keys cannot turn the car on. Results: Assuming that the thief or non-authorized person connected the starter motor directly to the car battery, the car well not turned on because the directional valve is set to the case where the fuel is fed back to the fuel tank and no fuel is pumped into the engine, which is the third security level. Conclusion/Recommendations: A microcontroller is programmed using C language, a directional valve is controlled by microcontroller to take the proper valve position to allow the engine to start or not. This system is worked properly and tested successfully.


INTRODUCTION
A new international Interpol Statistics revealed that 4.2 million vehicles reported stolen in 2008 from 149 countries around the world. U.S statistics shows that a car is stolen every 28.8 sec, adding up to more than 1 million cases of auto theft each year. Vehicle theft has become the nation's first property crime, costing more than $7.4 billion a year. One of insurance companies in Jordan said, striking that the phenomenon of car theft is not a private problem but had turn to insurance companies, especially if the type of insurance is comprehensive, there are 25 insurance companies in Jordan and are daily dealing with an almost fixed rate of 3-10 communications about car stealing. Many car owners rely on a car alarm system to protect their vehicles from criminals. Unfortunately, even the most sophisticated car alarm systems are not enough to prevent auto theft (Hunter and Ashjaee, 1988;Reynolds et al., 1990). Wahab et al. (1997) described a real-time vehicle location tracking system which uses the current technologies of Global Positioning System (NAVSTAR GPS) to provide continuous position and velocity tracking of moving vehicle (Alaqeeli et al., 2003), presented a novel signal acquisition and tracking method that reduces the number of operations, simplifies the HW implementation and decrease time needed.

MATERIALS AND METHODS
This new method is very fast processing of incoming GPS samples that satisfies real-time requirements (Bullock and Krakiwsky, 1994), stated that Digital road maps are being used increasingly throughout the world as they become more available. Five major digital road map suppliers are focusing their efforts on producing databases that support vehicle navigation functions. Of a total of 147 vehicle navigation systems in the world, 89 use in-vehicle maps, of which, 35 employ map matching and 31 offer real-time route guidance. Vehicle navigation systems are limited by the maps they use, so the availability of inexpensive, complete and seamless navigable digital road maps remains as an impediment to the wider use of vehicle navigation systems. Car thieves who are well-trained in exposing the vulnerabilities of auto security are often able to bypass these top-of-the-line car alarm systems and get away with the car or truck. Even the best car alarm systems fall short trying to consistently protect your vehicle from harm. At the same time, there are limits to what law enforcement can do to keep our cars safe from unwanted intruder. Nowadays, a lot of cars are being stolen due to the missing of security systems, or sometimes because of the weak security and alarm system that can be either accessed or disabled. So, a new and more efficient carsecurity system is presented here which may add extra advantage over the existed systems (Wahab et al., 1997). This system is a password protected system, which enables only the car owner to switch and drive it. In addition, it prevents the car from being switched on or let the motor starts when illegal enter. These details will be discussed clearly, but here a general view of the system as shown in Fig. 1.
As shown in Fig.1, the driver uses the keypad to enter the known password following the instructions displayed on the LCD. The entered data is processed by the control circuit, which compares the entered data with those stored in its memor (Alaqeeli et al., 2003;Bajaj et al., 2002). According to data processing, the control circuit is able to actuate one of two choices, first choice, if the entered password is true; firstly, the power of the car is activated, secondly the motor starter is enabled such that the engine can be turn on, thirdly the directional valve changes its direction and the fuel will enter the engine as shown in Fig. 2. Second choice, if the entered password is wrong, then the user is able to re-enter for maximum of three error entries, after that the alarm system is activated and the system will be locked and the user needs to enter a special code (PUK: Personal Unblocking Key) given when mounting the system, through which the driver can reset the system for initial password of (00000000).
System features: This system adds more security options for the existing traditional systems. These security options lie in three levels. Firstly, when the user access the car by the car key and entered the wrong password, the power is remain disable (i.e., the electrical options are not activated such as ignition system, fuel pump, injectors and other main options). If the power shifted by others, the second level comes by disabling the starter motor from being turned on, so the stolen keys cannot turn the car on. Assuming that the thief or non-authorized person connected the starter motor directly to the car battery, the car well not turned on because the directional valve is set to the case where the fuel is fed back to the fuel tank and no fuel is pumped into the engine, which is the third security level.

PIC microcontroller:
The digital implementation of the proposed system is achieved using PIC18F4620 PIC microcontroller. This type of microcontroller is chosen because it has low cost, reliable, easy to use and capable of performing a wide range of tasks. The required tasks by the proposed system are carried out via software using C language or any of its derivatives. Flow charts of C language are introduced and detailed descriptions below. Moreover, the approach uses Clanguage to program PIC microcontrollers is also presented. The microcontroller's ability to store and run unique programs makes it fairly flexible. For example, one can program a microcontroller to perform functions based on predetermined situations (1/O-line logic) and selections. The microcontroller's capability to carry out mathematical and logic functions allows it to imitate complicated logic and electronic circuits. Other programs can make the microcontroller behave like a neural circuit (a functional entity of interconnected neurons that influence each other similar to a control loop) or a fuzzy-logic controller. Microcontrollers are accountable for the "intelligence" in most smart devices on the consumer market. It is usually the brain of any system. The pin diagram of the PIC18F4620 chip, which is utilized in the present study, is shown in Fig. 3. Figure 4 shows the connections of the reset button and crystal oscillator to the microcontroller pins (VDD, MCCLR/VPP/THV, OSC1/CLKIN and OSC2/CLKOUT). The reset button provides additional protection to the system.

Circuit layout and construction:
It is advisable to pay some attention when constructing a microcontroller circuit to prevent frustrating circuit problems from occurring. With low frequency circuits in the kHz range, the layout is not critical as the effect of circuit board and parasitic capacitances and inductances is negligible. At higher frequencies, in the region of tens of MHz, these effects become more pronounced, so that bad wiring can actually prevent a circuit from working. These are the rules that are considered when constructing the PIC circuits: • Type in the program • Compile the program into a binary file • Simulate the program and debug it • Load the binary program into the PIC's memory • Wire up the circuit.
• Switch on and test.
The structure of the PIC program: It is suitable to put comments into programs to indicate the purpose and operation of the code and to facilitate maintenance at a later stage (Harrison, 1998). • Display a welcome screen until a key is pressed • Enter the password of the system via the keypad • Compare the entered password with the stored one in the EEPROM

Fig. 5: Electrical Distribution System
• If the password is true then the electricity and the fuel line is enable, to switch the car on • Number of allowable error passwords is 3, then the alarm system is turned ON • When closing the driver door, the system is activated again • The user is able to change the password • Programming Language in this study is CCS C COMPILER.

Electrical distribution:
A normally open relay after the ignition switch is installed as it shown in Fig. 5. This relay will cut off the electrical current from the switch to the ignition system, Electrical Control Module (ECM), the main sensors and to other subsystems which the engine needs it to start. So that even if the engine meshed with the wheel and let it to rotate or try to start the engine in somehow it will not work. If the user inserts a correct password the control unit will close the relay so that the ignition system and the other subsystems will be enable then the engine will be to ready to starting.

Starting system:
A normally open relay is installed to cut off the current flow to the starter motor as shown in Fig. 6. So that even if the ignition relay is switched on due to fault in circuit the starter relay will protect the starting circuit. If the user inserts a correct password, the control unit will close the relay so that the starting circuit will enable the driver to start the car engine. Figure 6 shows a simple diagram of how the car starting system is controlled by using the direction valve.  Fig. 7 and 8, only occurs when password is successfully checked. If the user enters incorrect password the valve keeps feeding the return line (i.e., the engine line is closed), but if enters the right password in this case the microcontroller send signal to the solenoid valve to change the fuel direction (i.e., it opens the engine line and blocks the return one). Traditonal car alarm system: Any car alarm system consists in general from sensors and alarm unit, (i.e., lights and buzzer). Modern car alarm systems consists of the followings parts as shown in Fig. 9: Sensors such as switches, pressure sensors and motion detectors. A siren, often able to create a variety of sounds. An RF receiver to allow wireless control from a key. An auxiliary battery so that the alarm can operate even if the main battery gets disconnected . Finally a computer control unit that monitors everything and sounds the alarm.

RESULTS AND DISCUSSION
In this study the alarm system is used to be activated (i.e., buzzer and LEDs flasher) when the wrong password is entered for three times.
Hardware implementation: Figure 10 presents the algorithm which describes the system logic and explains processing and comparison operation.

Keypad operation:
To get the keypad reading, the microcontroller will send data on port A and reads another data on port B. Data that are sent by port A is a sequence of 0111, 1011, 1101 and 1110. All bits are 1 except one 0 bit. At the same time port B reads data from columns Fig. 11.
When no key is pressed, port B reads 1111, but when any key is pressed port B will read 0111, 1011, or 1101 depending on the pressed key.  Table 1: Keypad inputs and readings Columns rows 0 1 1 1 1 0 1 1 1 1 0 1 0 1 1 1 1 2 3 1 0 1 1 4 5 6 1 1 0 1 7 8 9 1 1 1 0 * 0 # To explain how keypad works an example of pressing the key 6. Now as said before port A will continue to send the sequence of 0111, 1011, 1101 and 1110 and port B will read 1111 since no keypad is pressed. Then when key "6" is pressed then row 2 is electrically connected to column 3 and due to the very fast scanning (50 times sec −1 ), port B will read 1101 when the output at port A is 1011. From these two readings, 1101 means that the pressed key is in column 3 and 1011 indicates that the key is in row 2. Finally, we know that the pressed key is the result of crossing row 2 and column 3 which is "key 6". All the probabilities of pressed keys are written down in Table 1.

Liquid Crystal Display (LCD):
Alphanumeric LCD 2×16 is used because only to display some instructions as "Enter BUK code…" or notes as "Welcome ".In general, alphanumeric and graphical LCD's have the same pin configuration. They have 14 pins and sometimes there are extra 2 pins for backlight. Figure  12 shows the pin configuration of 2×16 LCD. Figure 13 shows connection of screen pins to microcontroller, depends on the software library used in our code, the used "LCD.c" library which is found in CCS C compiler.  Push button connection: When using a push button in circuit, we connect it between power supply and ground through a resistor. When the resistor is between the output and power supply, it is called pull-up resistor and when it is connected between the output and ground it is called pull-down resistor. Its function; pull-up or pulldown is to limit the current passing from power supply to ground when the button is pressed. Figure shows push buttons connections in our project see Fig. 14. From Fig. 14, it can be noticed that a 10k resistor is connected between the output and ground, so it is called pull-down resistor. When the button is not pressed we read 0V at output because no current passes through the resistor and when it is pressed, we read +5V because a current passes through the resistor causing in voltage drop on it. As shown in Figure, we used the three push buttons as "Enter the password", "Exit" and "reset" buttons and connected to interrupt pins on the microcontroller.

Push buttons function:
First push button to run the order entered the password (i.e., allowed the user to enter password), second one to run order exit of instantaneous situation, third to run reset order (i.e., backed the system to default profile).
LEDs: LEDs are just tiny light bulbs that fit easily into an electrical circuit. But it doesn't incandescent bulbs, they don't have a filament that will burn out and they don't get especially hot. They are illuminated solely by the movement of electrons in a semiconductor material.
In this study different colures of LEDs are used as indicator to show which circuit is activated and if the password correct or wrong. As shown in Table 2.
Buzzer: Buzzer or beeper is a signaling device, used as indicator or alarm. Initially this device was based on an electromechanical system which was identical to an electric bell without the metal gong (which makes the ringing noise). Often these units were anchored to a wall or ceiling and used the ceiling or wall as a sounding board. Another implementation with some AC-connected devices was to implement a circuit to make the AC current into a noise loud enough to drive a loudspeaker and hook this circuit up to a cheap 8-ohm speaker. Nowadays, it is more popular to use a ceramicbased piezoelectric sounder which makes a highpitched tone.

CONCLUSION
The system which obtained is an enhancement of the standard one (an anti-theft protection System) because of the three stages (three levels of protection). By using this enhanced system the engine of the car is turned off not only by electrical reasons but and by the means of fuel. The new designed system is inexpensive, the system is workable and it is tested successfully.