Design and Implementation Intelligent Adaptive Front-lighting System of Automobile using Digital Technology on Arduino board

ABSTRACT


INTRODUCTION
Night driving presents many constraints for drivers, essentially when taking turn. In conventional lighting systems, when a vehicle takes a turn, there are still obscure (in front of the vehicle) and areas covered by the brightness of the low beam headlamps. Also, in these same systems, the right disposition of low beam headlamps of a vehicle can disturb drivers coming in the opposite direction, crossing the vehicle and cause accidents. Thus, there is a need so that lighting of the dipped-beam headlamps of vehicles is also adapted to the conduct at the level of the bends.
On current smart vehicles, lighting systems benefit from technology called Adaptive front lighting system AFS [1][2][3][4][5]. AFS represents an additional security system offering optimized vision for the driver in the particulars of the conduct that is, poor visibility from the road or turn. The AFS is by adjusting the angle of lights crossing or road as well as their intensity based on several variables such as the vehicle's speed, the angle of the turn or even climatic conditions. This article describes a new AFS lighting module. In this module, the front lighting system of the vehicle comprises low beam headlamps that are fixed but arranged at precise angles.
The brightness of these lamps is adjusted according to the steering angle using a procedure based on the digital pulse width modulation technique (PWM) using the ARDUINO programmable card. In comparison with the prior art, the arrangement of lamps is not allowed to use stepper motors [6] or any other rotation system, thus reduces power consumption and avoids the problems of the engine failure. Moreover, the purpose of this article is a system that assembled them into a single module. Figure 1, shows that the current AFS system is based on a stepper motor that rotates low-beam headlamps according to the steering wheel angle, in such a way that does not exceed two axes a maximum angle is 10 degrees to the right and 20 degrees to the left.

RESEARCH METHOD 2.1. New Architecture of Proposed Car Light Parabola
In our work, the architecture of the vehicle lighting system is composed of four lamps.Taking the left parabola as an example, the first lamp on the right corresponds to the high beam headlamps and the other three lamps correspond to the low beam headlamps as shown in Figure 2 and Figure 3. Thus, in the proposed architecture, the passing light is replaced by three lamps, which are fixed but oriented according to predefined angles with respect to the horizontal axis of the car.
Taking the left parabola as an example, the first lamp is oriented at an angle of +10 degrees and Lights up the right.
The second lamp is oriented at an angle of -20 degrees and Lights up the left side, for the third lamp in the middle is oriented at an angle of 0°.
Concerning the right parabola is designed symmetrically with respect to the left parabola. For this purpose, Figure 2, Figure 3 and Figure 4 show the different lamps of the proposed parabola and their angles of orientation. Figure 4 shows essentially the lamps for the parabola left and right of the car as well the trajectory of the lights which they generate for the left parabola as follows: a. LHBH: Left High Beam Headlight, It presents the high beam left.

The Proposed Lighting Process
In Figure 5, one of the essential parts of our system is analog-to-digital conversion, ARDUINO receives the analog data from steering wheel sensors and converts them into a digital value to transmit them for processing and Circuit PWM adjusts the brightness of the high beam lamps and low beam lamps.

Arduino in AFS Architecture
In Figure 5 the analog-digital converter (ADC) located inside the ARDUINO board. It is used to convert the analog data coming from the rotation sensor linked to the steering wheel, in order to transmit them to the ARDUINO, which will modify the luminosity of the lamps using the technique PWM. To do this, we chose a 10-bit converter. Figure 6, shows how the binary model is assigned to the direction.The numbers determine the decimal representation of the 10 bits of the data supplied by the analogto-digital converter (ADC). For example, if the cockpit is at 512, the ADC will provide the binary value '1000000000'.

Principle of Operation of the System using the PWM Technique
Pulse width modulation (PWM) is a powerful technique for controlling analog circuits. PWM is employed in a wide variety of applications, ranging from measurement and communications to power control and conversion.
The PWM control is used in the control of hybrid DC-DC converts [7][8][9][10], where the DC voltage is converted to a variable average value or in the drive control of the inverters Variable speed electrical machines.
A PWM signal is characterized by its period T and its cyclic ratio D defined by Equation (1) D= (1) With: 0≤D≤1 The output signal is calculated in Equation (2) (2) In Figure 7, the PWM technique Allows controlling the frequency and the electric power given to the stepper motor [11][12][13][14].
In our system, we used this technique to control the electrical power applied to the lamps of the car's lighting parabola. The PWM circuit adjusts the brightness of the low-beam lamps according to the type of state it receives, as shown in Figure 5. The lamps are adjusted in sixteen levels ( Figure 8)  For sixteen PWM signals levels generated by the ARDUINO programmable Board are presented in Figure 8.  Figure 8 shows, that if the vehicle in a straight road, the analog to digital converter ADC associated with rotation sensor gives a decimal value between 505 and 515, ARDUINO gives a maximum power (level 16; 100% power) to MLBH while the light of LLBH and RLBH lamps is off (level 1; 0% power).
When the ADC provides a decimal value between 906 and 1024 (turning right), ARDUINO gives maximum power (level 16; 100% power) to RLBH and LLBH lamps while the light of MLBH lamps is off (level 1 0% power).
When the ADC provides a decimal value between 873 and 906 (turning right), ARDUINO gives a power level 2 (0.4% power) to MLBH lamps and a power of level 15 (96% power) to RLBH lamps while the light of LLBH lamps is off (level 1; 0% power).
When the ADC provides a decimal value between 840 and 873 (turning right), ARDUINO gives a power of level 3 (7.8 % power) to MLBH lamps and a power of level 14 (88% power) to RLBH lamps while the light of LLBH lamp is off (0% power).
When ADC provides a decimal value between 807 and 840 (turning right), ARDUINO gives a power of level 4 (11.8% power) to MLBH lamps and a power of level 13 (84% power) to RLBH lamps while the light of LLBH lamps is off (level 1; 0% power).
When ADC provides a decimal value between 774 and 807 (turning right), ARDUINO gives a power of level 5 (15.7 % power) to MLBH lamps and a power of level 12 (78%) to RLBH lamps while the light of LLBH lamps is off (level 1; 0% power).
When ADC provides a decimal value between 741 and 774 (turning right), ARDUINO gives a power of level 6 (23.6% power) to MLBH lamps and power of level 11 (68% power) to RLBH lamps while the light of LLBH lamps is off (level 1; 0% power).
When ADC provides a decimal value between 708 and 741 (turning right), ARDUINO gives a power of level 7 (31.4% power) to MLBH lamps and power of level 10 (47% power) to RLBLH lamps while the light of LLBH lamps is off (level 1; 0% power).
When ADC provides a decimal value between 675 and 708 (turning right), ARDUINO gives a power of level 8 (40% power) to RLBH lamps and a power of level 9 (43% power) to RLBH lamps while the lights of LLBH lamps is off (level 1; 0% power).
When ADC provides a decimal value between 642 and 675 (turning right), ARDUINO gives a power of level 9 (43% power) to RLBH lamps and a power of level 8 (40% power ) to LLBH lamps while The lights of LLBH lamps is off (level 1; 0% power). When ADC provides a decimal value between 609 and 642 (turning right), ARDUINO gives a power of level 10 (47% power) to MLBH lamps and a power of level 7 (31.4% power) to RLBH lamps while the light of LLBH lamps is off (level 1; 0% power).
When ADC provides a decimal value between 590 and 609 (turning right), ARDUINO gives a power of level 11 (68% power) to MLBH lamps and a power of level 6 (23.6% power) to RLBH lamps while the light of LLBH lamps is off (level 1; 0% power).
When ADC provides a decimal value between 575 and 590 (turning right), ARDUINO gives a power of level 12 (78% power) to MLBH lamps and power of level 5 (15.7 % power) to RLBH lamps while the light of LLBH lamps is off (level 1; 0% power).
When ADC provides a decimal value between 550 and 575 (turning right), ARDUINO gives a power of level 13 (88% power) to l MLBH lamps and a power of level 4 (11.8% power) to RLBH lamps while The light of LLBH lamps is off (level 1,0% power).
When ADC provides a decimal value between 525 and 550 (turning right), ARDUINO gives a power of level 14 (88% power) to MLBH lamps and a power of level 3 (7.8 % power) to RLBH lamps while the lights of lamps LLBH is off (level 1; 0% power).
When ADC provides a decimal value between 515 and 525, ARDUINO gives a power of level 15 (96% power) to MLBH lamps and a power of level 2 (0.4% power) to RLBH lamps while the lights of lamps LLBH is off (level 1; 0% power).
In the case of a turning to the left, the adjustment of the brightness of the low beam headlights made in a manner symmetrical, analogous to that described in the case of a right-hand rotation. Table 1 presents the simulation results; it shows the system reaction according to the road conditions. If you take a straight road ϴ = 0° the system provide maximum power to the MLBH lamps, and no power in LLBH and RLBH lamps. If you take a left turn, and the angle of the wheels in the following range: 0 < ϴ < 15 the system gives 66% Pmax to the MLBH lamp and 33% Pmax to the LLBH and RLBH lamps.
When the angle of the wheels is within the range: 15 < ϴ < 30 the system gives a 33% Pmax to MLBH lamps and 66% to LLBH and RLBH lamps.
When the angle of the wheels is within the following range:: 30< ϴ < 45, the system gives zero power to the MLBH lamp and 100% maximum power to the LLBH and RLBH lamps. LRBH and RRBH lamps always remain during the taking of a left turn, same reasoning but with an antisymmetric way remains valid for a left rotation.
It is clear that the light follows the rotation of the vehicle's wheels (the wheels rotation) while taking a turn.

RESULTS AND ANALYSIS 3.1. Implementation AFS System on Arduino board
Once the global program is compiled and tested in terms of its execution and connection with the ARDUINO mega 2650 (Figure 9), among its ports we find digital ports 2,3,4,6 and the analog input A0, it will be used in our prototype.
A rotation sensor that delivers an analog signal depending on the steering wheel rotation degree is connected to port A0. The digital outputs 2,3,4,6 are connected to parable lamps mentioned in Figure 3. In such a way the port 2 is connected to the LHBH lamp, port 3 is connected to the RLBH lamp, port 4 is connected to the MLBH lamp and port 6 is connected to the LL lamp.  Figure 10, shows an example of a 7.8% cyclic PWM signal generated by ARDUINO, to control the brightness of the passing beam lamp with our system according to the steering wheel rotation angle.

Discution and Results
The luminosity of the lamps has been measured by a luxometer. Table 2 shows the variation of the luminosity of the Lumen dipped-beam headlamps as a function of the decimal value of digital analaogical conversion quoted in the Figure 6, which is related to the rotation sensor, when turning left. The same reasoning for a right-hand rotation, but this time in an antisemitic way. We see that the luminosity of the passing beam (LLBH, MLBH l, RLBH) changes according to the rotation of the steering wheel that allows the lighting to follow the direction of the bend. Figure 10 shows the prototype of the AFS global system, which consists of two parabolas containing the low beam headlamps: LBLL, LBRM, LBRR, LBLR, LBLM, LBLL and arduino mega 2560 that generates PWM signals to control the luminosity of the lamps (Figure 4). In addition, a real handwheel that gives a signal to the rotation sensor to convert it to a digital analog converter (ADC) for transmission to ARDUINO ( Figure 6).
With this improvement, we have found better results. We have concluded that our system provides full coverage of the road lighting level when driving; the dark spots of vision are eliminated, in addition to the problem of engine, failures present on existing systems on the market have been avoided.

Comparative Study
The value-added improved method is based on the following constraints: In terms of safety, our AFS lighting system offers total illumination of the road according to the different conditions (lighting and extending the driver vision zone) which allows to reduce blind spots of the vision and eliminate all darkness, which causes the reduction of accidents and helps to maintain the life of road users.

529
In terms of Energy efficiency, our system does not use any motorization system like the servo-motor mentioned in article [15] and the stepper motors mentioned in article [16], which does not give a good precesion and a bad coverage of the road at the level of illumination. Our system reduces the energy consumption by taking advantage of the energy consumed by the systems of the motorization. In terms of the cost level, our system use a single box that contains the dipped beam and main beam lamps, there is no motorization system. In terms of the compatibility level, our improved system is compatible with all types of lamps on the market (OLED, LED, halogen, xenon) and it is easy to adapt to the AUTOSARD standard.
The companies (caddialc and bmw) have added to the traditional AFS system (visible), an infrared camera that captures the radiation of living beings (indivduous animals) and displays them for the driver. The major problem is that the two pieces of information (visual and infrared direction) are mixed together in the same area without perturning the driver. Our system provides the driver with good vision and without disturbance when driving at night.

CONCLUSION
In this article, we designed an architecture for an intelligent AFS system on board ARDUINO to maintain the classic light distribution to improve night lighting and user safety. In our system, we have used high-resolution digital PWM technology that allows for better control of the luminosity of passing beam headlamps according to steering wheel rotation. As the light follows the bend on the road, so we were designed a reliable, robust, secure and economical device with energy levels and an intelligent system.
In this article, we have exploited the benefits of the digital PWM technology to improve the AFS system. It offers us a flexible control of the light of the car's lighting, reducing energy consumption, lowering costs and increasing the level of safety.