Academia.eduAcademia.edu

FULL REPORT SMART VEHICLE RECOGNITION PROJECT

2018, SMART VEHICLE TRACKING

https://doi.org/10.1432/journal.000123

Reducing the number of Wallet payments on vehicles to automated process will reduce traffic jam and save time which is the most aspect covered by this project

UNIVERSITY OF DAR ES SALAAM. COLLEGE OF INFORMATION AND COMMUNICATION TECHNOLOGIES (CoICT) DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING PROJECT REPORT CS 499 PROJECT TITLE: Design and implementation of a prepaid smart recognition of vehicles for electronic toll collection system. A Project Report in Partial Fulfillment for the Award of Bachelor of Science in Computer Engineering and Information and Technology. Name of Candidate: Ngeleja, Yona Meshack. Registration Number: 2013 - 04 - 02427 Name of Supervisor: Prof N.H. Mvungi Supervisor’s Signature: ………………. Submission Date: 15th June 2017. i CERTIFICATION. I, Ngeleja Yona M with registration number 2013-04-02427, declare that this report and the work described in are my own work. Any contributions from others are expressed, acknowledged or cited. I declare that, the work in this report was carried out in accordance with the regulations of the University of Dar es Salaam. And it has not been presented to any other university for examination either in Tanzania or overseas. Any views expressed in the report, are those of the author and in no way represent those of University of Dar es Salaam. Student: Ngeleja, Yona Meshack Signature: ……………………………… Date: ……………………………… Approved by; This report may proceed for submission for assessment of the award of B.Sc. in Computer Engineering and Information Technology at the University of Dar es Salaam. Supervisor: Prof N H Mvungi. Signature: ……………………………… Date: …………………… Review Committee Signature: .......................... Date: .......................... ii ABSTRACT. A toll is a fixed charge or tax for a privilege, especially for passage across a bridge or road or ferries. It is sometimes known as tariff and this project shall focus on tolls charged on private and public vehicles crossing the bridge (Kigamboni Bridge: case study). Electronic toll collection aims at eliminating the delays caused by toll collection process. Currently there has been a problem during rush hours especially in the mornings, evenings and in public holidays of movement of vehicles passing the through the bridge due to the time consumed on RFID manual collection of toll tax for each vehicle passing the bridge. This has caused unnecessary time wastage due to the slow movement of traffic plus inefficient collection of the toll that makes the government to lose a lot of money annually. The aim of this project is to design a system which automatically identifies an approaching vehicles by capturing the vehicles number plate and perform the online toll charges for ongoing vehicles without stopping on toll station (Kigamboni Bridge). When the vehicle number plate is captured it is automatically processed and the system opens the gate and a predetermined amount is automatically deducted from his or her vehicle pre-paid account. This translate to reduce traffic congestion at toll stations and maximize the toll tax collection and this is an important advantage of this project also to develop a recommendations for vehicle identification and registration systems with the potentials to go beyond the tolling function to include other desirable transportation system management functionalities. ???state here your achievement??? iii ACKNOWLEDGEMENT First and foremost I thank my most high almighty God for showering me his consistent love, care and courage during my whole period of doing this Project, for his guidance and blessings throughout my life and throughout my time at the University of Dar es salaam. Also I extend my acknowledgements to many individuals for their contribution toward completion of the final year project. I would like to sincerely appreciate my project supervisor Prof N H Mvungi for the help and guidance during the period of the project development. He has provided significant comments and advice on defining the topic and proceeding with the project. His assistance in editing was very greatly appreciated. His enthusiastic nature always encourages me. I thank the Computer Engineering and Information Technology project coordinator Mr. Daudi Mnyanghwalo for his help, suggestions and encouragement to advance with final year project especially on the construction of the project title. I thank my family for their love, morale support and prayer along my study. Their fully support has given me enough strength and inspiration to make this project and in pursuing my ambition in life as well as to complete this project part. A lot of thanks to all the instructors of the College of Information and communications Technologies for the knowledge they provided to me has become helpful and greatly applicable in the project. Finally to all friends and people who I have not mentioned, Just know that you have played some roles in motivating me to make it this far. I am nothing without you all and I know I have done my best to accomplish what I could, thank you and be blessed always. iv TABLE OF CONTENTS. CERTIFICATION. ....................................................................................................................................... ii ABSTRACT............................................................................................................................................... iii ACKNOWLEDGEMENT ............................................................................................................................ iv TABLE OF CONTENTS............................................................................................................................... v LIST OF ABBREVIATION. ....................................................................................................................... viii LIST OF FIGURES. .................................................................................................................................... ix LIST OF TABLES. ....................................................................................................................................... x CHAPTER 1 ............................................................................................................................................ 11 INTRODUCTION. .................................................................................................................................... 11 1.1 Background ........................................................................................................................... 11 1.2 Motivation............................................................................................................................. 11 1.3 Problem Statement ............................................................................................................... 11 1.4 Proposed solution. ................................................................................................................ 12 1.5 Objectives.............................................................................................................................. 12 1.5.1 Main Objective. ............................................................................................................. 12 1.5.2 Specific Objectives. ....................................................................................................... 12 1.6 Significance of the Project. ................................................................................................... 13 1.7 Scope and Limitation of the Project...................................................................................... 13 CHAPTER 2 ............................................................................................................................................ 14 LITERATURE REVIEW. ............................................................................................................................ 14 2.1 Introduction .......................................................................................................................... 14 2.2 Existing System...................................................................................................................... 14 2.2.1 2.3 Disadvantages of the existing System:.......................................................................... 16 Overview of the Proposed System. ....................................................................................... 16 v 2.4 Number Plate and their Properties. ...................................................................................... 17 2.4.1 2.5 Classification of vehicles using the above number plates. ........................................... 18 Database System ................................................................................................................... 19 2.5.1 Types of Databases ....................................................................................................... 19 2.5.2 Database Language used. ............................................................................................. 19 CHAPTER 3 ............................................................................................................................................ 20 METHODOLOGY. ................................................................................................................................... 20 3.1 Introduction .......................................................................................................................... 20 3.2 Data collection ...................................................................................................................... 20 3.2.1 Requirements gathering and analysis ........................................................................... 20 3.2.2 Functional requirements............................................................................................... 20 3.2.3 Non-functional requirements ....................................................................................... 21 3.3 Hardware Requirement. ....................................................................................................... 21 3.4 Phases of implementation .................................................................................................... 21 3.5 Image Recognition phase. ..................................................................................................... 22 3.5.1 Design mechanism to capture the number plate image. .................................................... 22 3.6 Processing and Recognition Phase........................................................................................ 25 3.7 Data storage phase. .............................................................................................................. 26 CHAPTER FOUR. .................................................................................................................................... 27 SYSTEM DESIGN .................................................................................................................................... 27 4.1 Hardware Design ......................................................................................................................... 27 4.2.1. Power supply. ....................................................................................................................... 28 4.2.2 Microcontroller ATmega 328p............................................................................................... 28 4.2.2.1 Arduino UNO Board ..................................................................................................... 29 4.3 USB Sensing camera. ................................................................................................................... 30 vi 4.4 Global System for Mobile (GSM) module. .................................................................................. 30 4.5.1 Database design. ...................................................................................................................... 31 CHAPTER FIVE: ...................................................................................................................................... 35 SYSTEM IMPLEMENTAION. ................................................................................................................... 35 5.1 Hardware Implementation ......................................................................................................... 35 5.1.1 GSM Module Interfacing. ......................................................................................................... 35 5.1.2 Arduino UNO Interfacing ..................................................................................................... 36 5.1.3 LEDs Interfacing. .................................................................................................................. 37 5.1.4 Motor (Gate) Interfacing. ..................................................................................................... 38 5.2 System Integration ...................................................................................................................... 38 5.3 Working of Complete System ..................................................................................................... 38 5.4 System Testing ............................................................................................................................ 39 5.4.1 System Functional Testing ................................................................................................... 39 5.4.2 System Security Testing ....................................................................................................... 39 5.5 Results Analysis ........................................................................................................................... 40 CHAPTER SIX.......................................................................................................................................... 41 RESULT, CONCLUSION AND RECOMMENDATIONS............................................................................... 41 6.1 Introduction ................................................................................................................................ 41 6.2 Conclusion ................................................................................................................................... 41 6.3 Recommendations ...................................................................................................................... 41 REFERENCES. ......................................................................................................................................... 42 APPENDICES .......................................................................................................................................... 43 Appendix A: Time Schedule of the Project. .......................................................................................... 43 Table 6.2 Cost estimation. .................................................................................................................... 45 Appendix C: Sample Source codes ........................................................................................................ 46 vii LIST OF ABBREVIATION. ETC Electronic Toll Collection. CSI Camera Serial Interface. SIM Subscriber Identity Module. IDE Integrated Development Environment. GSM Global System for Mobile. RFID Radio Frequency Identifier. AC / DC Alternating Current / Direct Current. ANPR Automatic Number Plate Recognition. AVR Advanced Virtual RISC. LAN Local Area Network. LPR License Plate Recognition. SPICE Simulation Program with Integrated Circuit Emphasis. SRAM Static Random Access Memory. UART Universal Asynchronous Receiver/Transmitter. VLP Vehicle License Plate. viii LIST OF FIGURES. Figure 1.1 System flow of the Current System…………………………………….…... 5 Figure. 2.1 Number Plate Categories……………………………………………………7 Figure. 3.1 Flow chart of the system operation…………………………………………15 Figure. 3.2 Flow chart for Image processing and Recognition…………………………16 Figure. 4.1 Block Diagram of the System………………………………………………18 Figure. 4.2 ATMEGA 328P-PU Microcontroller………………………………………20 Figure. 4.3 Arduino Uno Microcontroller……………………………………………....20 Figure. 4.4 USB Sensing camera………………………………………………………..21 Figure. 4.5 Database Layout………………………………………………………….....22 Figure. 4.6 Sample of entered vehicle particulars on Database…………………………23 Figure. 4.7 Circuit Simulation…………………………………………………………...24 Figure. 4.8 Web display for the results………………………………………………….25 Figure. 5.1 GSM Module………………………………………………………………..26 Figure. 5.2 Arduino Board Microcontroller……………………………………………..27 Figure. 5.3 Light Emitting Diode………………………………………..........................28 Figure. 5.4 Complete Integrated System………………………………………………..29 Figure. 5.5 Web display for the results………………………………………………….31 ix LIST OF TABLES. Table 5.1 GSM Module pin Connection to Arduino UNO…………………………………..27 Table A 1 Time schedule for semester I………………………………………………………32 Table A 2 Time schedule for semester II…………………………………………………….33 Table 6.2 Cost estimation of the project ................................................................................. 35 x CHAPTER 1 INTRODUCTION. 1.1 Background Most African Major Cities are overpopulated. Taking Dar es Salaam as an example; it has a population of around 5,000,000 people; a figure which is around 10% of the total population of Tanzania. With a good rising speed of development in transportation sector; long road traffic ques especially in the morning and evening has been a common observation. The congestion of automobiles makes the government not to earn billions of money in a year due to the unproductive time wasted on the roads. For the case Kigamboni Bridge, the manual collection of toll tax has been a good cause of congestion at the toll collection station due to the time consuming in the manually operated RFID Technology. In addition to that, the dishonesty of the toll collectors makes the Temeke Municipal Council and the government in general to collect less income. This ultimately makes our government to achieve less than their expected annual development goals. 1.2 Motivation The major motive to develop this project is the need to have an efficient toll collection system at Kigamboni Bridge that will maximizes the annual toll collection amount and that at the same time minimizes the time spent at the toll pay point. This will ultimately make our government to achieve more in its development plans for the people concerned with the increased toll tax collection and reduce time wasted by congestion. 1.3 Problem Statement The manual toll collection system using RFID technology at bridges and ferry has been a cause of congestion of vehicles at the entry point due to the time consumed during toll tax collection. The toll collector has to collect money from a vehicles then he or she has to process the ticket and print it out, scan the ticket return the ticket to the vehicle owner and allow the vehicle pass. The recently used technology for electronic toll tax collecting system is based on RFID technology which uses radio wave to identify cars passing through the toll collection station (Kigamboni bridge: case study) bridge or ferry and the ticket is printed out to authorize payment and scanned again for record management which seems to be less efficient compared to the developed system which will automatically debits toll rate from the car owner's pre-paid account on Smart recognition technology and its application in bridges and highway system is analyzed in this project. 11 1.4 Proposed solution. The proposed is automated prepaid system to detect, process and notify the vehicle owner about the remained balance, repay and if not registered to the system after using/passing the (toll station) bridge because charges will be performed automatically online for those registered vehicles and if they are not registered there will be an alert to register and those vehicles from abroad they will have their private lanes to use with an exception of Ambulance, Police and military vehicles which will use the prepaid lanes with no any email or text notification to register or pay when use the prepaid lanes . 1.5 Objectives. 1.5.1 Main Objective. The main objective is to design and implement a prepaid smart recognition of vehicles for electronic toll collection system (ETC System). 1.5.2 Specific Objectives. i. To design and implement a number plate recognition system for capturing and convert image to variable digits. ii. Designing a database that keeps records of all the registered vehicles that use the tall station, the information contained is the vehicle’s registration number, owner’s address and the billing information. iii. Designing a system which opens the gate after payment has been made and close it after the vehicle has passed. iv. To implement hardware and software parts of the proposed system to reflect the real design process and integrate the software and hardware parts to make a complete control system. 12 1.6 Significance of the Project. The successful completion of the project and its implementation at any specified toll station will have the following advantages;  The driver doesn't have to carry the money each time, He or she will just recharge the account and the amount and will be used at each time of crossing the bridge.  Efficient toll collection that earns the government much income.  Low time spent at the toll pay point  Reduced oil consumption because of the non-stop passing of the toll pay points.  Reduce air pollution due to auto-emissions at the specified station is reduced to large extent and Speedy transportation due to less congestion at the toll collection point. 1.7 Scope and Limitation of the Project. The project concerns with application of a License Plate Recognition system and processing the obtained number plate digits to perform online debits / payment and notify the vehicle owner through email or sms to top-up his/her account and all functionalities will be done without stopping of the vehicle (Toll tax at non-stop vehicles). The design consideration can be applied at any vehicle entry point where toll tax is concern. The system is power dependent and so with the current power shortage, a standby power source should be used 13 CHAPTER 2 LITERATURE REVIEW. 2.1 Introduction Literature review involved taking time to read different documents from text of scholar offline and in web sites. Furthermore, it provides the necessary knowledge and information obtained from various information sources. The reading built up the knowledge and new techniques toward implementation of this project. These readings includes substantive findings, theoretical and methodological contributions to a particular topic, consulting project supervisor, lecturers and other professionals to get a clear knowledge of the system to be implemented. 2.2 Existing System The currently technology used for charges of vehicle at toll stations is operated in a semi-automatic system (RFID system) which employ the number of procedures to perform toll tax charges per single vehicle. RFID is the technology which uses electromagnetic waves that have a wavelength suited for use in radio communication. Radio waves are classified by their frequencies, which are expressed in kilohertz, megahertz, or gigahertz and power. Radio frequencies range from very low frequency (VLF), which has a range of 10 to 30 kHz, to extremely high frequency (EHF), which has a range of 30 to 300 GHz. Radio Frequency Identification (RFID) is an automated data capture method that uses radio frequency waves to transfer data between a reader and a movable item so as to automatically identify it. It is an auto identification technology which uses Radio Frequencies (between 30 kHz and 2.5GHz) to identify objects remotely. This system does the job of detecting, billing and accounting for vehicles as they pass through a toll station using RFID as the identification technology which uses a card and bar code scanner for tickets. 14 Figure 1.1: System flow of the Existing system. Along with the development of vehicle transport the use of highway traffic will be more and more and the toll tax charges form of manual and semi-automatic will not meet demand of the charging management system and many vehicle may be blocked at entrances causing huge economic losses when it reach a certain edge. The use of no parking on the highway shows a great potential in solving these problems. For ETC applications, a sufficient communication time interval is necessary to allow for the complete transfer of all the information between a roadside units (detection components) and server while the vehicles are rapidly passing through the toll station. 15 2.2.1 Disadvantages of the existing System: The main disadvantages of the existing system are:      It is time consuming and therefore causes congestion at the toll station. It is an inefficient toll collection method since some vehicle owner can negotiate with operator. It is highly susceptible to human errors since it is manually operated and dependent on operator speed. It is time consuming hence not suitable for many number of vehicles because a lot of time is wasted in waiting for toll tax collection. It needs an operator to be available at all the time waiting for vehicles. 2.3 Overview of the Proposed System. The proposed system is an Electronic Toll Collection System is just the right solution for the problems and shortcomings of the RFID technology in terms of toll tax collection. An Electronic Toll Collection is a kind of technology that will allows for electronic payment of tolls and it can determine whether a vehicle has been registered or not registered in an ETC toll payment program, alert the enforcers if toll payment violation occurs and debit the corresponding account. Considering the application of an ETC system the driver does not have to stop the vehicle to implement toll payment because an ETC system is an electronic automatism toll collection system that would be used in the highway, bridge and tunnel (If Tanzania design it in the next generation). The use can be extended to parking lots. Its obvious advantage is no parking toll tax collection and the vehicle can be at a high speed throw the toll station instead of which has to slow down before toll station and park to charge. The development of vehicle transport and the use of highway traffic will be more and more and the toll tax form of manual and semi-automatic will not meet demand of the charging management system and many vehicle may be blocked at entrances and exits causing huge economic losses when it reach a certain edge. The use of no parking on the highway shows a great potential in solving these problems. 16 2.4 Number Plate and their Properties. Number plate identification on material and size required so as the sensor may detect and allow the processing of signals to perform functions as the ETC system. Number plate is categorized by the following factors; Material: Aluminum is the most commonly materials used to manufacture number plates in Tanzania because the material possesses great capacity to reflect infrared radiation hence due to its infrared reflector qualities make it the ideal metal for number plate manufacturing worldwide. Size and thickness; 340*180mm, 520*110mm and 240*125mm for different vehicle designs and a thickness of 1mm. Colour categorizations; Number plates are also categorized into four different colours;  Yellow –For private car and trucks on normal activity.  White -This is commonly applicable to business vehicles and cars especially for rental matters and passengers.  Red for non-government and international organizations.  Green This type is commonly used for Police (Prison forces) and Country diplomacies in Tanzania.  Black for military forces (TPDF). 17 Figure 2.1 Number plate Classification 2.4.1 Classification of vehicles using the above number plates. License plate is the identification plate where unique numbers for each vehicle is printed and the VLP are issued by the government through its agencies under control of the ministry of transport and TRA. The VLP must be placed on both front and back side of the vehicle. The following are two main categories on the basis of size and capacity for vehicles passing through the toll station.  Heavy and medium-sized vehicle: This includes bus, truck, dozer, dumper, loader, crane, tanker, roller, pick-ups, van, minibus, mini-truck, minivan etc. having the capacity to carry more than 24 people for passenger vehicle or more than 4 tons for cargo vehicle.  Light vehicle: This includes car, jeep, van, pick-up and min bus. Having the capacity to carry less than 24 people or less than 4 tons. 18 2.5 Database System Database is a shared collection of logically related data and a description of this data designed to meet the information needs of an organization. It is therefore a single repository of data that can be used simultaneously by various users. All data items are integrated with a minimum duplication instead of having several disconnected files with redundant data. The database is also defined as a self-describing collection of integrated records because it contains the organization’s operational data but also a description of this data. In this project, the database system holding all the necessary information related to the vehicles registered to use a toll station. This includes fields like its registration number, the balance, amount paid for the vehicle, details of its registered vehicle and the details of its owner. 2.5.1 Types of Databases There are several types of databases example external database, analytical database, operational database, distributed database, real time database. But all these are all mainly divided into two types;  Relational database: is a collection of normalized relations with distinct relation names. This is a standard of business computing and it uses tables to structure information.  Flat file databases: Flat files are the ones in which the records in the file contain no information to communicate the file structure or any relationship among the records to the application that using the file. Any information about the structure or meaning of the data in the file must be included in each application that uses the file or must be known to each human who reads the file. The manual filing system is suitable we either want to store small or data or when we only want to store or retrieve large data. 2.5.2 Database Language used. MySQL is the database designing languages that used in this project. This is a non-procedural language whereby the user specifies the information that he or she wants rather than how to get the information. In other words, it is a language that does not require the user to specify the access methods. 19 CHAPTER 3 METHODOLOGY. 3.1 Introduction Methodology is the systematic, theoretical analysis of the methods applied to a field of study or the theoretical analysis of the body of methods and principles associated with a branch of knowledge. Generally a methodology represents means, procedure or techniques used to carry out some process in a logical, orderly or systematic way as explained below. 3.2 Data collection Data collection is how information is gathered. The way used to collect data is reading the related literatures and questionnaire with my supervisor (Prof N H Mvungi), different experts, employee in workplaces and companies where tollgates were applied in Dar es Salaam. 3.2.1 Requirements gathering and analysis This done by revising the project about design and implementation of a pre-paid smart recognition of vehicles for electronic toll collection system, understanding the operating environment at the bridge, the charges, managing the payment system in operation, reading literatures and talking with employers of different relevant workplace so as to get the requirements of the system The system to be designed must meet both functional and non-functional requirements. The complete system consists of hardware and software components built together to meet the functionality of the main objective. 3.2.2 Functional requirements The following are the system functional requirements of the system;  The system should be able to identify, recognize and authenticate the vehicle.  The system should be able to detect and recognize the vehicle number plate.  The system should be able compare and check if the number plate exist in database or not existing.  The system should be able to perform online debits and store and keep records.  The system should be able to notify the owner if the number does not exist or insufficient balance. 20 3.2.3 Non-functional requirements Non-functional requirements define the overall qualities or attributes of the resulting system. Non-functional requirements are constraints of the product developed that must meet to make the system useful. These includes the followings.  Performance – The system use short response time, high throughput and easy Utilization.  Usability - The system is easy to use for any user.  Scalability- The system can be extended to increase total throughput under an increased load when resources (typically hardware) are added.  Availability- the system is available for service when requested by the user at any time.  Reliability- the system performs its required functions under stated conditions for a specific period of time. 3.3  Maintainability- the system is maintainable to incorporate other functionalities.  Security- Unauthorized access to the system is not allowed. Hardware Requirement. The list below is the hardware components required to complete the project design and implementation of the smart recognition of vehicles for electronic toll collection system.  Arduino UNO board  GSM Module  Step motor  LED and  Jumpers 3.4 Phases of implementation The procedural development of proposed system components are grouped into five different phases, based on the function carried out by the modules of the prototype as briefly described in this section. 21 3.5 Image Recognition phase. 3.5.1 Design mechanism to capture the number plate image. To capture the image of the number plate and its processing to obtain the variable characters and numbers progressive cameras are highly used type of cameras and is totally recommended because they are able to trap the image with the vehicle on range (focus area) for the vehicle in movement. The detection of the number plate and process the image for Electronic Tollgate Collection (ETC) system may be achieved in both hardware and software by the following stapes. i. The camera is placed short distance ahead the vehicle or truck and capture the image of the number plate fixed on the vehicle by infrared radiations managed by camera with its built-in software. ii. As the vehicle enters and settles in the field of the sensor (Camera). Through the infrared sensor (built-in camera) sense a vehicle and gives a signal to the PC through microcontroller to capture the number plate image of the vehicle and process it. iii. The number plate is then compared to the authorized number in database to confirm its validity and finally provides signal to microcontroller to control the system hardware. iv. The integrated ETC system equipment with software part for the registered vehicles to a database allow the system to perform the following task;  Check if the vehicle is registered or not.  Check the amount if satisfy or not.  Perform online debit transactions.  Notify the Driver (owner) if vehicle not registered, amount not enough. 22 v. The system will perform the tasks as signal sent from or to microprocessor to either open the tollgate or warning signal for amount top-up or unregistered vehicle detection. vi. The system will operate repeatedly as vehicles enter the field of sensor (Camera). 23 Figure 3.1 Flow chart of the system operation. 24 3.6 Processing and Recognition Phase. The steps involved in the overall image processing is represented by the flow diagram bellow; Figure 3.3 Flow chart for Image Processing and Recognition phase. Image Capturing. Image acquisition is done by the USB Sensing camera which captures the image when it is triggered. The positioning of the camera will be structured to get the image of the number plate for the front part of the ongoing vehicle approaching the toll station. Preprocessing; After digital image has been obtained and send to the server system next step is to deal with preprocessing of the image. The main purpose of the pre-processing is to increase the efficiency of character recognition which include the set algorithms applied on the images to enhance the quality while obtaining the correct characters required. It is an important phase in the system 25 3.7 Data storage phase. Vehicle record management in terms of registration, payment and online transaction needs to be stored and kept for verification and proper system operation because vehicles of different type may pass through and with different toll tax amount while neglecting Military vehicles, Police and Ambulances which are treated as toll free tax as they pass the bridge. To manage this variations and different records makes database to exist and support all the functions in record management. 26 CHAPTER FOUR. SYSTEM DESIGN The System design involves the application of theory to product development. The design followed with implementation of the system by connecting and interfacing the hardware components. 4.1 Hardware Design This involves interfacing and connection of hardware components according to requirement specifications to make the complete system. The hardware components required in the system are Arduino UNO board, Power supply, USB camera and microcontroller ATmega 328p, GSM, Motor(Tollgate) and other interconnecting devices Figure 4.1 shows the block diagram of hardware components of the system. The block diagram bellow shows the hardware components of the system interconnected together completing the hardware part of the system. Figure 4.1 Block diagram of the system. 27 4.2.1. Power supply. A power supply is an electronic device that supplies electric energy to all system components. The primary function of a power supply is to convert one form of electrical energy to another. Most of electronic devices operate under rated amount of voltage which range from 5V to 12V. Depending on its design, a power supply may obtain energy from various types of energy sources, including electrical energy transmission systems, energy storage devices such as a batteries and fuel cells, electromechanical systems such as generators and alternators, solar power converters, or another power supply which is either DC or AC. Power supply has a power input which receives energy from the energy source and a power output that delivers energy to the components. 4.2.2 Microcontroller ATmega 328p. ATmega 328p is 8-bit high performance microcontroller of Atmel mega AVR family with low power consumption. It has interface input and output for communication with external components. It mounted on the Arduino UNO board. The microcontroller acts as a central processing unit in the system and executes all the functions in the prototype. In order to execute the instructions microcontroller is programmed in ‘C’ language with the help of Arduino IDE. The microcontroller development board is activated with power supply of 5V by using power adapter or USB from PC. By activating the serial ports in the microcontroller, communication path is established by using UART1 and MAX 232. The high-performance Atmel 8-bit AVR RISC-based microcontroller combines 32KB ISP flash memory with read-while-write capabilities, 1KB EEPROM, 2KB SRAM, 23 general purpose I/O lines, 32 general purpose working registers, three flexible timer/counters with compare modes, internal and external interrupts, serial programmable USART, a byte-oriented 2wire serial interface, SPI serial port, 6-channel 10-bit A/D converter. Programmable watchdog timer with internal oscillator and five software selectable power saving modes. The device operates between 1.8v to 5.5 volts. 28 Figure 4.2 ATMEGA 328P-PU microcontroller 4.2.2.1 Arduino UNO Board In Arduino Uno (represented in Figure 4.2-2),"Uno" means one in Italian. The Arduino Uno is a microcontroller board based on the ATmega328. It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP header, and a reset button. It contains everything needed to support the microcontroller. It simply connects to a computer with a USB cable or an AC-to-DC adapter or battery to get started. Figure 4.3 Arduino Uno microcontroller. 29 4.3 USB Sensing camera. This webcam works with a USB port to be connected with PC. It is an ideal webcam for its plug and play and real-time transmission. Its mini size, easily carrying high resolution and high speed image capture. Technical Specification      High Resolution CMOS Color Sensor. Resolution: 300K Pixels (interpolated 30M) * Video Format: 24bit True Color. Interface: USB2.0, compatible with USB1.1. Transmission Speed: 640*480 25frames/second 2560*1920 15frames/second 6324*4742 15frames/second and Dynamic Range: ≥72db. Imaging Distance: 5CM to infinite, Automatic White Balance, Automatic Color Compensation. Figure: 4.4 USB sensing camera. 4.4 Global System for Mobile (GSM) module. GSM module is a wireless MODEM devices that are designed for communication of a computer with the GSM and GPRS network. It requires a SIM card just like mobile phones to activate communication with the network. Also they have IMEI (International Mobile Equipment Identity) number similar to mobile phones for their identification. A GSM/GPRS MODEM can perform the following operations like receive, send or delete SMS messages in a SIM, read, add or search phonebook entries of the SIM card also it can take, Receive, or reject a voice call when configured. 30 4.5 Software Design. 4.5.1 Database design. Database schema of a database system is its structure described in a formal language supported by the database management system (DBMS) and refers to the organization of data to create a blueprint of how a database will be constructed (divided into database tables). All constraints are expressible in the same language. The table below shows the database layout displaying the relationships between tables in a database on how registration of vehicles to the database will be performed as described below. The database include the following tables; Vehicle_info, Vehicle_type, Balance, Record, Owner, Colour, Ownership Figure. 4.5 Database Layout. 31 4.6 Views on phpMyAdmin. Registration of vehicle information (vehicle_info table) where the vehicle_type_id, ownership_id, owner_id, colour_id are seen as numbers because has already registered and vehicle_info table depends on the above tables. Figure. 4.6 Sample of entered vehicle particulars on Database. 4.7 Schematic design and Circuit simulation This involves compiling and executing the designed circuit of the system by using circuit simulator. Simulation is used to check the performance and correctness of a designed system before building it. Figure 4.3 represents the schematic diagram of the system with the prototypes parts. 32 Figure. 4.7 Circuit simulation. The circuit contains H-bridge, Arduino, power supply, motor and com port and switch. Functions of each component; H-bridge – To allow the motor (gate) to rotate on clockwise or anticlockwise (opening and closing the gate). Arduino UNO – To provide interpretation of signals from or to the gate, camera and other interconnecting hardware. COM PORT – to provide connection to the hardware. 33 4.8 Web interface design for result display. The web page will display the recent four vehicles passed on the bridge Figure. 4.8 Web display for the results. 34 CHAPTER FIVE: SYSTEM IMPLEMENTAION. System implementation consists of Hardware Implementation, System user interface, System integration as well as System testing and result analysis. 5.1 Hardware Implementation This involves connecting and interfacing the devices of each phase prototype independently to Arduino board and tests its functionalities per specified requirements with help of instruction codes uploaded into microcontroller. The sketch of code instructions based on Arduino language which is derived from C-programming used to program microcontroller and MatLab. 5.1.1 GSM Module Interfacing. GSM Module interfacing with the microcontroller is through pins and jumpers to link connection between them. It needs AT commands for interacting with processor or controller which are communicated through serial communication. These commands are sent by the controller/processor and the modem sends back a result after it receives a command. AT commands are used by the modem can be sent by the processor/controller/computer to interact with the GSM and GPRS cellular network. Figure 5.1 GSM Module SIM Card An intention of interfacing this component is to enable the system to notify the vehicle user that he/she has to pay for his auto standing loan or if the balance is insufficient to perform toll tax payment at the station. 35 The message was designed as “Pay your outstanding debt for tall tax.. KIGAMBONI BRIDE”. Table below shows GSM Module pins connection to Arduino UNO Board. Table 5.1 GSM Module pins connection to Arduino UNO Board. GSM Module pin Arduino UNO Board pin U_TXD 10 UNO side U_RXD 11 UNO side GND GND Power side. H_TXD pin to EN pin on GSM No connection 5.1.2 Arduino UNO Interfacing Arduino UNO board (micro controller) enable synchronization between GSM, MatLab, LEDs and Motor. It use the Console cable to connect it with Computer so as to communicate with Database and MatLab for the System to function well. Codes is C programing was used to program the microcontroller chip through its desktop interface by cable. The intention is to make sure all components work together synchronously with the help of built in micro controller. 36 Figure 5.2 Arduino UNO Board (Microcontroller) Micro controller is connected to each component of the hardware part of the system. 5.1.3 LEDs Interfacing. Interfacing the system with LED is to enable the system user to know if the sensor or Gate is receiving operational signals from the microcontroller which is useful on troubleshooting the system since each component is associated with LEDs. LEDs used are Red and Blue, for Red is to show if the tollgate is operating and Blue is to show if the PIR sensor is operating properly. Figure 5.3 Light Emitting Diode 37 5.1.4 Motor (Gate) Interfacing. Motor operates by applying 3.5 volts to 5 volts to the input of the motor making its shaft to rotate It operates basing on the principle that, like poles repel and unlike poles attract while. It is interfaced with the microcontroller which receive signals from MatLab and Database making the motor to rotate at two direction opening and closing of the gate. 5.2 System Integration The system modules combined and integrated together to form one complete working system. Figure 5.5 shows the complete system prototype after integration of the software and hardware parts. Figure 5.4 Complete Integrated System 5.3 Working of Complete System When the vehicle reach the toll station the PIR sensor detect that the vehicle is in position of the toll station and in range thus it notify the microcontroller which respond by sending signals to enable the camera to capture the photo of the plate number with the help of MatLab for image processing to obtain the digits. After the plate number digits has been obtained the MatLab send them to database for interpretation where the system identifies if the number plate of that particular vehicle has been registered or not registered, checking the amount to pay for tall tax, did the vehicle fall on 38 exceptional tax free vehicles and then the signals are sent back to the microcontroller to either open the gate or trigger the GSM Module to send the message notifying the vehicle owner to respond on top-up of the account or repay the outstanding debt of using the toll lanes. Finally the system reverse to the starting point again where it receive signals from another vehicle after the exit of currently processed vehicle from the toll lane. All of the processing actions are handled automatically with no intervention of human being except when unregistered vehicle pass through the lane where it needs a minimal human effort to open and close the gate by only single press of the push baton. 5.4 System Testing The process of testing an integrated system of software part and hardware part was done in order to verify if the system meets the specific objective of the project. The testing conducted in the whole system by comparing the obtained results from what is mentioned on the system functional requirements and non-functional requirements. The following project requirements were carried out during system testing. 5.4.1 System Functional Testing Functional testing verified against the system functional requirements specifications. The following functionalities tested successfully on the system prototype. i. ii. iii. iv. The system compares the current amount in the account and deduct the predefined. The system displays the unregistered status for unregistered vehicles on MatLab gui. The system allows or denies if the amount either satisfies or not. The system captures and keeps the vehicle number plate and time of passing the lane in database. 5.4.2 System Security Testing Typical security requirements testing based on non-functional requirements which include specific elements like confidentiality, integrity, authentication, availability, authorization and nonrepudiation. This system has been constructed that in such a way that only registered vehicles was tested by capturing and comparing the number plate with message invalid card or successful login displayed on MatLab Gui. 39 5.5 Results Analysis The results of the system are the output of the system which depends on the inputs. The desired output obtained when correct input is fed into the system. The results are displayed on the MatLab Gui and web browser where the vehicle passed are displayed. Also the results are stored in small database created in MYSQL Server and can be viewed through web browser in computer later. Figure 5.5 and Figure 5.8 show the sample results obtained from the demonstration during the system functionality testing on MatLab gui and web browser respectively. Figure 5.5 Web display of the results 40 CHAPTER SIX. RESULT, CONCLUSION AND RECOMMENDATIONS. 6.1 Introduction This chapter concludes on the results including failure and success; concerning the pre-paid smart recognition of vehicles for electronic toll collection. 6.2 Conclusion Some of the challenges of this project are making the system work in toll points, each with its specified database for keeping records of the accounts for the respective vehicles. Also the ability of the system to detect a vehicle is irrespective of the weather condition like excessive rain or heat and irrespective of the area of location within a specified distance. Achievements of the project include successfully integrating the other modules with the microcontroller. The microcontroller is therefore receiving signals from the PIR Sensor and Camera whenever it detects a unique and registered vehicle number plate. Also the system database and the graphical user interface has been successfully designed. The Motor Gate lock circuit is also rotating in the specified degree to indicate the opening and closing of the gate after toll deduction The project has therefore been implemented only with minor problems in the controlling the database to microcontroller serial communication for data transmission data between them. 6.3 Recommendations This project can act as a curtain raiser for others to see outside in a sense that, its solid foundation leaves a room for plenty of further developments in improving the system so as to make it serve the people better. Some of the future scopes for improvements are like integrating it with network for quick response lather than keeping the whole program in a single computer also the use sensitive sensors and Camera since some plat manufacturers ignore the quality of number plate for an APR to fuction well. 41 REFERENCES. Beginning C for Arduino and compatible microcontrollers; Ph.D. Jack Purdum. Copyright © 2012 by Jack Purdum. Toll Road News: International Bridge, Tunnel, Turnpike Association Conference: 05/29/2005. http://www.tollroadsnews.com/cgi-bin/a.cgi/LoSDAtB7EdmcEIJ61nsxIA. Material selection and camera type to be used for Electronic Tollgate Collection System https://www.aliexpress.com/price/number-plate recognition-camera_price.html http://www.made-in-china.com/cs/hotchinaproducts/Infrared_Camera.html?gclid=CjwKEAiAgavBBRCA7ZbggrLSkUcSJACWDexAEc3fzF FeJlDSt2PBeVUoGanaxhPDg27N9fs9UzkG8xoC0Jjw_wcB. US Department of Transportation, Intelligent Transportation Systems: 2004 Metropolitan Summary, Toll Collection Lanes with ETC Capabilities. http://www.itsdeployment.its.dot.gov/Results.asp?ID=641&rpt=M&filter=1 Hui, Z. (2013). The design of an electronic toll collection system based on radio- frequency identification. Labs, H. (n.d.). RFID toll Tax. india. systems, S. g. (2004). microelectronic, EM. EM 4100 . www.doc.ic.ac.uk/~ih/doc/stepper/control2/. (n.d.). Retrieved from www.eleccircuit.com/uln2003-control-stepper-motor-by-parallel-port. www.presentationtopics.in. (n.d.). RFID Based automatic toll gate closing and opening with vehicle details logging. Retrieved from www.presentationtopics.in. www.prioritydesign.com.au/em4100_protocol.html. (n.d.). Retrieved december 22, 2013, from www.prioritydesign.com. www.wikipedia.org.wiki/stepper_motor. (n.d.). Retrieved january 22, 2014, from www.wikipedia.org. www.wikipedia.org/wiki/toll. (n.d.). Retrieved 01 01, 2014, from www.wikipedia.com. 42 APPENDICES Appendix A: Time Schedule of the Project. Table A.1 Time Schedule for Semester I S/N ACTIVITIES SEMESTER I WEEK 1 2 3 4 5 6 7 8 9 10 1. Project title refinement 2. Title confirmation 3. Literature review 4. Requirement gathering 5. Preparation of progressive report 6. progressive report submission 7. Mid-semester presentation 8. System design 9. Writing of end of semester report 10. Submission of end of semester report 11. CS 498 Final presentation 43 11 12 13 14 15 16 17 Table A.2 shows the time schedule of the project for second semester Table A.2 Time schedule for semester II S/N ACTIVITIES SEMESTER I WEEK 1 2 3 4 5 6 12. Literature review 13. Implementation of software 14. Implementation of hardware part 15. Preparation of progress report 16. submission of progress report 17. Mid-semester oral presentation 18. Integrating System with Database 19. Writing of final report 20. Submission of CS 499 final report 21. CS 499 Final oral presentation 44 7 8 9 10 11 12 13 14 15 16 17 Table 6.2 Cost estimation. Budget approximation was as follows according to the device price and Resources. S/N 1. 2. 3. 4. 5. DEVICE QUANTITY AMOUNT IN TSHS GSM MODULE 1 75,000 ARDUINO UNO BOARD 1 50,000 OPTIC CD 2 2,000 STATIONERY LED 30,000 2 3000 6. JUMPERS 10,000 7. MOTOR 1 25000 8. USB CAMERA 1 45,000 TOTAL 240,000 45 Appendix C: Sample Source codes /* CS 499 Arduino codes THIS IS CODE IS FOR PRE-PAID SMART RECOGNITION OF VEHICLE FOR ETC SYSTEM CREATED 20 MAY 2017 BY NGELEJA, YONA MESHACK /* 46