Development of a microcontroller based automobile speed limiting device and alarm control system

Road accident due to overspeeding is a common occurrence in a developing nation such as Nigeria. Therefore, the need for a device capable of notifying a vehicle driver when the allowed speed limit of an area is exceeded arises. In this work, a microcontroller based automobile speed limiting device and alarm control system was designed and developed. The core components employed for the system design include Arduino Nano microcontroller, 1602 liquid crystal displays (LCD) module, light-emitting diodes (LEDs), buzzer, 18650 battery, I2C, infrared detectors and push buttons. Data gathering and circuit designs were implemented with microcontroller as focal point using suitable design models. Performance test was carried out on the developed system and the device’s reading error was determined. The developed automobile speed limiting device and alarm control system was functional and performed satisfactorily during testing. The reading error of the device was evaluated as 5.83%. The developed speed limiting device, apart from being suitable and efficient for vehicle speed measurement, could also be deployed for general applications requiring speed measurement.


INTRODUCTION
In recent years, society and people have profited enormously from rapidly improving road systems. At the same time, automobile industry has manufactured and sold mechanized vehicles capable of operating at extremely high velocities. High-speed travel of an automobile can prompt more mobility and less time to be spent on a journey [1]- [3]. However, high vehicle speeds have unfavorable impacts, primarily regarding road accidents and subsequent deaths, injuries and material damage in addition to environmental hazards created such as noise and fumes discharge from exhausts of the vehicles.
Greater utilization of automobiles can adversely affect the way of life and human well-being, for instance, the cardiovascular well-being of the community [4]. Individuals living in main metropolitan areas begin to pine for lower speeds of automobiles on their roads and there is a developing interest to protect the environment, provide a better quality of life for the populace living in the area, and likewise to guarantee the well-being of those living close to the streets: pedestrians, bicyclists, children, and individuals with decreased mobility [5].
There are definite rules and regulations laid out by authorities about driving automobiles on roads, and these are specific to different countries. These rules also differ on various roads ranging from federal to 196 state roads. The most common rule in any country is the speed limit on certain roads where a driver of an automobile will be in violation of the law if the speed of his automobile exceeds the allowed limit on that particular road being plied [6], [7]. Speed limits are one important approach to accomplish appropriate speeds [8], [9]. In a speed management conference organized by the European Conference of Ministers Transport [5] in 2006, it was discussed that speed limits in most urban areas should not exceed 50 km/hr with 30 km/hr zones promoted in areas where vulnerable road users are especially in danger. Researches have shown that the speed limits in addition to traffic calming measures are extremely effective at decreasing accidents, including injuries, with decreases of up to 66% having been illustrated by implementing the speed limit rule [10].
Globally, around 1.35 million people meet their death annually due to road accidents with an additional 50 million individuals harmed from road traffic crashes [11]- [15]. While the reason for crashes is dependent on quite a number of factors, it is by and large agreed that speed limit infringement and inappropriate speed are the greatest contributors of incidents of road traffic trashes and their severity [16], [17]- [19]. Although all highways have signboards indicating maximum speed limit for the sake of both driver's safety and that of the pedestrian, still drivers disobey highway speed limit [20]- [22]. The driving behavior of drivers depends on three key indicators including the average speed, the difference with the speed limits and the accelerator stroke [23], [24]. An increase in the speed of an automobile leads to the increased distance of movement during the driver's response time with the halting distance, consequently increasing the danger from any driver's error. Despite the gigantic proof of the connection between speed and crash risk and severity, the conduct keeps on being unavoidable among drivers across the world [25]. Therefore, in view of the inherent dangers of vehicles overspeed on roads, this work aims at developing an automobile speed limiting device incorporating an alarm control system that can assist in signaling a driver when the allowed speed limit on a particular road being plied is violated.

AUTOMOBILE SPEED LIMITING DEVICE AND CONTROL SYSTEM
The automobile speed limiting device and control system is a speed limit control system that involves a road monitoring and speed limit control in the vehicle which receives signals from the installed transmitter by the roadside. The device can automatically reduce the speed of cars and restrain all vehicles equipped with the said speed limit control system to the various stipulated and posted maximum speed limits [25]. Some of the potential benefits associated with the use of automobile speed limiting device and control system include greater time to recognize hazards, reduced distance travelled while reacting to hazards, reduced halting distance of the vehicle after application of the brake, increased ability of other road users to determine vehicle speed and time before collision, increased ability of the driver to maintain control of the vehicle among others.
According to literature, series of studies have been carried out with respect to the development of an automobile speed limiting device and control system with different technologies employed. Kodali and Sairam [26] presented design and implementation of a global positioning system (GPS) based car speed limiting device. The device could determine vehicle's current location and the maximum allowed speed in the area of the road being plied. Enokela and Agbo [27] developed a microcontroller based car speed controller for automatic control of vehicle's speed within limit stipulated for a particular zone by a regulating body such as the federal road safety commission (FRSC) in Nigeria. The system was able to compare the preset speed limits with the actual speed that is derived from the speedometer of car for effective speed control. Khondaker and Kattan [28] designed an algorithm called the variable speed limit control algorithm which simultaneously maximizes the mobility, safety and environmental benefits in a connected vehicle environment. Mishra et al. [29] designed a radio frequency (RF) based speed control system for vehicles to alert drivers in places where the highway department has placed the speed limit signboards. Olei and Polak [30] worked on an intelligent speed adaptation system which has the capability of notifying drivers of the speed limit of each road section.
Going by the literature, the previous models require part, if not all, of the device to be placed in people's car. The implication is that these systems will cost a whole lot of money to be implemented by the government of a country. It also means the drivers can easily tamper with the device in their cars either by adjusting the speedometer setting to give false readings, blocking the device from RF or even removing their car's GPS system since it is well known that not all cars have GPS systems. Therefore, the car speed limiting system developed in this work seeks to get rid of the two major shortcomings of the past models which are high cost and inherent ease of manipulation by the vehicle drivers.

METHOD 3.1. System overview
The block diagram showing the links between different units of the speed limiting device and alarm control system developed is shown in Figure 1. The power supply unit provides the required 12 V DC supply for the operation of the Arduino Nano microcontroller which serves as the brain of the overall system. All computations and data gatherings are done by the microcontroller. The infrared (IR) sensors detect the speed of moving vehicle when it enters the speed limiting zone and send signals to the microcontroller for further action. The outputs of the microcontroller, vehicle speed and speed status, are displayed on a 1,602 liquid crystal displays (LCD) module.
The alarm unit which comprises negative-positive-negative (NPN) transistor and buzzer is responsible for sounding an alarm whenever the speed of a vehicle exceeds the pre-set limit as detected by the microcontroller. The light emitting diode (LED) indicator unit gives an indication of the speed status of a vehicle passing through the speed limit zone. This unit also serves as an extra form of notification to populate the alarm and LCD units to allow vehicle drivers see their speed status immediately when passing through the speed limit region. Two different LED indicators were used. The red LED will be triggered ON whenever the speed of a detected vehicle has exceeded the pre-set limit while the Green LED will be ON if a vehicle speed is within limit. The green and red LEDs were controlled through the microcontroller. Speed limit calibration unit involves the use of push buttons to set the speed limit which serves as the threshold speed for the moving vehicles.  Figure 2 shows the circuit diagram of the power supply unit. The unit was designed using four rechargeable 18,650 lithium-ion cells, each rated 3.7 V, 3,800 mAh. The four cells were arranged in a series-parallel configuration to give a total rating of 7.4 V, 7,600 mAh. The 7.4 V was then fed through a DC-DC bulk converter to step the voltage up to the required 12 V. The arrangement was used to power two sections of the system: the Arduino microcontroller and the NPN transistor TIP 120. The 12 V DC output from the power supply unit was fed to the microcontroller via its input pin, Vin. The microcontroller in turns provides 5 V via its 5 V output pin to drive the two infrared sensors IR1 and IR2 and I2C module.

Speed detection unit
The schematic of the speed detection unit is presented in Figure 3. The two sensors IR1 and IR2 were placed 10 cm apart during the design phase, the distance which was later scaled up to 5 m for real time usage. When a moving vehicle reaches IR1, the sensor gets activated and sends a high signal (logic 1) to the microcontroller. The microcontroller acknowledges the signal and then saves the time t1 in seconds it receives the signal. When the vehicle reaches IR2, another high signal (logic 1) will be sent to the microcontroller and the time t2 in seconds the signal reaches the microcontroller will be saved. Using the scaled distance of 5 m and the time interval Δt between IR 1 and IR 2 , the speed S in ms -1 at which the vehicle travels from IR1 to IR2 was estimated from (1) and converted to kmhr -1 using (2): where d is the distance in meters between infrared sensors IR1 and IR2, where ℎ −1 is the speed travelled in kmhr -1 between the two sensors. Once the speed of the vehicle is obtained, the microcontroller compares the speed with the pre-set speed limits ranging from 30 to 70 kmhr -1 .

Alarm unit
The circuit diagram of the alarm unit is shown in Figure 4. The NPN transistor TIP120 is used for amplifying the low power signal (5 V, 40 mA) from the digital pin 2 of the Arduino Nano microcontroller to trigger the buzzer with power rating of (12 V, 330 mA). The model equations guiding the selection of resistors R1 and R2 in the circuit of where hFE is the transistor current gain, IC is the collector current, IB is the base current, R1 and R2 are the resistors forming a voltage divider circuit at the base of the transistor, 1 is the voltage across R1, and VArduino is the Arduino Nano microcontroller voltage. The use of (4) and (5) in (3) results in (6) from which (7) is obtained: Using hFE, R1 and R2 as specified in the datasheet of NPN transistor TIP120 as 2600, 10 and 1 kΩ respectively and VArduino as 5 V, the collector current, IC, to drive the buzzer was obtained from (7) Figure 5 shows the circuit diagram of the display unit. A 16 by 2 LCD module was used to display the status of the system and the speed status of the moving vehicle. The first row of the module displays status of the system which could be active or inactive, depending on the functionality of the microcontroller to receive prompt response from the IR sensors when a moving vehicle is sensed. The second row of the modules shows the speed status of the vehicle passing through the system.

LCD unit
The LCD was interfaced with the Arduino microcontroller via a I2C communication module. The I2C module helps reduce the numbers of pins required for interfacing the LCD to the Arduino Nano microcontroller from 16 pins to 4 pins. Analogue pins 4 and 5 of the microcontroller were used for the serial data transfer.

LED indicator unit
The circuit diagram of LED indicator unit is presented in Figure 6. The 5 V supplied by the Arduino digital pins is sufficiently large enough to damage the red and green LEDs as the LEDs require a maximum where RL is the resistance of the LEDs at maximum voltage VLmax and maximum current ILmax, RS is the resistor connected in series with the LEDs to achieve maximum current rating ILmax of LEDs. Using VLmax, ILmax and VArduino as 2.4 V, 20 mA and 5 V respectively, RS was obtained from (10) as 130 Ω. This resistance indicates that a resistor of at least 130 Ω in value needs to be connected in series with the LEDs to prevent them from burning. However, due to the market availability, RS was selected as 220 Ω. This is the value of R3 and R4 connected in series with the green and red LEDs respectively. These resistancess prevent the LEDs from working at maximum ratings continuously for a long period of time which can lead to inefficiency and quick breakdown.

Speed limit calibration unit
The circuit diagram of the speed limit calibration unit is shown in Figure 7. Five different buttons B1, B2, B3, B4 and B5 were used to set a unique speed limit suitable for various locations. The buttons B1, B2, B3, B4, and B5 were used to set the threshold speed of the system from 30 to 70 kmhr -1 at an interval of 10 kmhr -1 . In addition, a blue LED was interfaced in series with reach of the buttons to indicate the currently activated speed limit button. Hence, the system will act based on the activated or pre-set speed limit.  Figure 8 shows the overall designed circuit of the speed limiting device and alarm control system. The circuit comprises the various designed sub-units including power supply, speed detection, alarm, LCD, LED indicator and speed limit calibration units. These units were integrated and developed for the actualization of the goal of the work.

Testing of the developed system
The speed limiting device and alarm control system was tested after the implementation of the overall design. Performance test was carried out on each sub-unit of the design. The fully developed system was also tested along three selected routes in Abeokuta metropolis of Ogun State, Nigeria to examine its functionality. The selected routes are Federal University of Agriculture, Abeokuta (FUNAAB) gate to motion ground, Block industry to FUNAAB gate and Olorunsogo to Moore junction. Speed of 30 vehicles was randomly measured with 10 vehicles considered on each of the selected routes.

. The developed system
The constructed model of the microcontroller based automobile speed limiting device and alarm control system is presented in Figure 9. Figure 9 shows the various external features of the system such as the LCD screen, LED indicators, speed limit calibration button, buzzer and infrared sensors. Figure 10 on the other hand presents the internal circuitry of the system where various components are interconnected. Figure 11 shows the results of performance test on each sub-unit of the developed system. From Figure 11, it was observed that each of the system's sub-units including the speed detection unit, alarm unit, LCD unit, LED indicator unit, power supply unit and speed limit calibration unit was operational and performed satisfactorily when tested. The results of speed measurements using the developed system along FUNAAB gate to motion ground, Block industry to FUNAAB gate and Olorunsogo to Moore junction are shown in Figure 12.  Figure 11. Performance testing of the developed system From Figure 12, it was observed that four vehicles exceeded the speed limit of 30 kmhr -1 allowed on Route A which represents Block industry to FUNAAB gate road. Equally, three vehicles exceeded the speed limit of 40 kmhr -1 allowed on FUNAAB gate to motion ground road designated as route B while four vehicles exceeded the speed limit of 60 kmhr -1 allowed on route C which represents Olorunsogo to Moore junction road. For each of the overspeeding conditions recorded during testing, the system's buzzer gave a warning sound. Moreover, comparison of the measured speed with the theoretical estimated speed of the considered 30 vehicles along the three selected routes revealed that the developed system has an absolute error of ±5.83%, indicating that the developed system is suitable for speed measurement applications. Figure 12. Speed measurement using the developed system on three different routes

CONCLUSION
Globally, negative impacts of road accidents with the associated deaths, injuries, material damage among others resulting from vehicle's speed exceeding the allowed speed limit on any route call for great concern. This work designed and implemented a microcontroller-based automobile speed limiting device and alarm control system. The device is capable of alerting a vehicle's driver the speed status on any road being plied, provided the acceptable speed limit on such road has been pre-set on the system. In addition to being cost effective, the developed system is simple and robust. The device can be deployed for use in different locations with different speed limits. In terms of ruggedness, the device has been tested and proven to withstand extreme weather conditions like heavy rain, extremely high temperature, vibrations, and noise. Hence, functionality during harsh weather conditions can be guaranteed. The system is, however, only equipped with an alarm and indicator LEDs to identify over speeding vehicles. As a result, there is still a need for traffic officials to be present at speed limit regions as the device can only help identify an over speeding vehicle and then notify the officials in order to take necessary actions. To improve system, it is recommended that technologies like machine vision be integrated to the system. The implementation of machine vision will enable the device to easily capture information of over speeding vehicles such as car plate number, face of driver, car model and color and then sent to the authorized personnel for further actions.