Development of a Prototype Autonomous Electric Vehicle

The paper presents an Autonomous Electric Vehicle with obstacle avoidance system. This research work made use of ultrasonic sensors, the principle of distance measurements and calculations as well as detecting obstacle on its path. The device consists of three ultrasonic sensors that detect object for each left, right and front of the vehicle, based on developed and installed codes in the Arduino microcontroller and displays the range using ISIS Proteus 8 electronic modelling software. The minimum and maximum range of object detections is 2cm to 400cm respectively. However, the measured distance was from 25cm to 150cm and the corresponding calculated distances using oscilloscope waveforms are 28.10cm and 148.3cm. The difference between the measured and calculated distance was 5.4% on average. GPS navigates the vehicle autonomously to its destination using an algorithm for navigation based on reactive behavior. The vehicle is powered by rechargeable batteries (4 lithium ion batteries) which are charged using external power source by connecting into electricity grid. Furthermore, a solar panel has been utilized as a secondary source of power to charge the batteries. This reduces the dependency of the vehicle on external power sources. The vehicle is capable of moving for about 20m to and fro and avoiding obstacle on its path.


INTRODUCTION
An autonomous car or vehicle is also called a self-driving car or driverless car or robotic car. Whatever the name but the aim of the technology is the same [1]. Autonomous Vehicle (AV) research was accelerated through the Defense Advanced Research Projects Agency's (DARPA) Grand Challenges Program in the US in 2004 [2]. The challenges resulted in AVs capable of traversing dessert terrain in 2005, and in 2007. Researchers also managed to place AVs on urban roads through the DARPA's Urban Challenge Program [3]. AVs powered by autonomous technologies, without requiring human control are, according to many, just around the corner. And the implications are vast [4]. Recent advances in computational capabilities, both in terms of hardware and algorithms, communication architectures, and sensing and navigation devices have made it possible to develop autonomous systems that exhibit a high degree of reliability in their operation [5]. Thus Electric vehicles (EVs) are automobiles operated by an electric motor as a substitute for an Internal Combustion Engine (ICE). This is facilitated by the incorporation of engines that use stored energy in batteries that are frequently loaded in electrical power supply (generally 240 V) to operate these cars. EVs are therefore referred to as cars with zero emissions (ZEVs). Generally speaking, most EVs have fewer moving parts and require minimal maintenance; no oil change, overhaul or timing requires, and no exhaust is required. In perspective of the above, it could be said that EVs with their very quiet operation are much more energy effective than gasoline motors [6].
In developing an autonomous electric vehicle, navigation of the vehicle has been the most basic and yet most challenging task. This is because moving the vehicle to the desired place is priority as it moves, hence navigation become useful in any design of a moving vehicle especially for outdoor application where automatic supervision is needed, for example, in places where it might be risky for humans to be. Fully autonomous vehicles are being researched and developed such as the Google driverless car, cyber cars in the frame work of European projects [7], automated vehicles in the A utopia program [8], and vehicles targeted for competitions, like the DARPA Urban challenge [9] and DARPA Grand challenge [10].
A Global Positioning System (GPS) receiver had become a significant breakthrough in the development of moving vehicles. Around 1990, the GPS became available in a limited capacity for civilian use, and the possibility of rapid and accurate vehicle location and navigation sparked a flurry of activity. In 1995, the system reached full operational capability [11]. The advent of the GPS has afforded Autonomous Vehicle systems engineers a powerful new means of obtaining accurate navigation data that is required for precise tracking of given inertial trajectories [12]. A simple GPS receiver with better accuracy provides an easy means of developing moving vehicles. However, since the GPS only provide the heading control and the global coordinates of a current location, it is required to implement a hardware and software system that can navigate the vehicle. The main advantage of using GPS is that the data gathered does not depend on previous readings and therefore errors in localization do not grow over the course of time.
However, studies have been done in order to tackle the limitations of GPS technology. One of them was the use of a map-based navigation for an outdoor environment [13]. The robots positioning is obtained using odometers and differential GPS (DGPS) measurements and an extended Kalman filtering framework is used to correct the positioning data. Through testing the authors found that even when DGPS position measurements were highly inaccurate, however, the heading data was still reliable. Though testing of the DGPS data still has to be done around areas with large natural obstructions like trees [14]. It is expected that Autonomous Vehicles represent more opportunities to develop innovative in-vehicle technology for entertainment or information purposes that will require a cockpit design adaptation and modification of the car controls for more flexibility of movement within the vehicle [15].
A number of methods for developing autonomous electric vehicles have been reported. For example, design of a simple autonomous electric vehicle that includes GPS-based navigation and uses ultrasonic sensors and image processing to prevent collision was made [16]. The deliverable product is a self-navigating unmanned vehicle that drives to userdefined destination coordinates that are transferred wirelessly to the vehicle. GPS and compass modules are used to navigate the vehicle while an efficient collision avoidance system is also being established. From the results obtained, the vehicle was able to detect nearby stationary or moving obstacles within 100cm with the help of image processing; but the work utilizes battery sources only for power. Hence there is need to consider other power means.
Another method is by means of multi-beam Laser Imaging Detection and Ranging (LIDAR) sensor for surrounding reconstruction and obstacle detection [17]. The vehicle was able to drive autonomously from one waypoint to another using a GPS module. However, this approach has two limitations. One of them is that the sensor requires reconstruction before obstacle detection. Secondly, is limited to one source of power.
Other methods include development of intelligent electric vehicle for unmanned autonomous driving algorithm [18]. This intelligent electric vehicle directly controls traditional steering device and acceleration/brake pedals through electrical signals with electronic actuators which were equipped at each component. Also, various sensors were utilized to recognize surrounding situations, obstacles, and road boundary instead of human. The setback of this approach was that the system is expensive and obstacle avoidance is possible at a very close distance.
Development of Autonomous Smart Card to help people with carriage transportation such as luggage and groceries was also reported [19]. The autonomous vehicle was able to perform two main tasks such as following a user, and avoiding obstacles in real time. The setback of this approach was the lack of GPS to navigate autonomously and uses only battery source for power.
Lastly, it was reported that Electric Vehicle can be powered either by a single or multiple source combination and driven by a single or multiple algorithm [20]. From the output acquired, the vehicle can be driven by either a single or a combination of multiple sources; however, the work centred on optimizing power management system and not navigation. Therefore, there is need for GPS navigation.
In this journal, three ultrasonic sensors that detect object for each left, right and front of the vehicle will be implemented, based on developed and installed codes in the Arduino microcontroller and displays the range using ISIS Proteus 8 electronic modelling software. Also, GPS receiver will be utilized to calculate the vehicle's position by precisely timing the signals sent by the GPS satellites. A marked improvement in this research is the use of rechargeable batteries to power the vehicle, and a solar panel has been implemented as a secondary source of power to charge the batteries.

A. System Description
The basis of the method used in this paper is based on Figure 1. The description of each stage is stated under. Input Keyboard: This is the main driver circuit of the vehicle, by applying logic 1 to the microcontroller, dc power supply (Vcc) initiate the system. Global Positioning System (GPS) [21]: The GPS receiver calculates its position by precisely timing the signals sent by GPS satellites. The receiver utilizes the texts it gets to determine the travel time of each message and to calculate the receiver distance from each satellite. Ultrasonic distance sensor [22]- [24]: The ultrasonic range modules are used to calculate obstacle distance from the car. These sensors have a maximum range of 400cm and maximum effectual angle of 150 [25]- [27] Each sensor is connected to AVR and power supply via a 4 pin wire connector. ATmega32 Microcontroller [28]: It is available in 40 pin dual inline package (DIP) and has modified Harvard RISC architecture. It contains 32 programmable input/output lines with USART and SPI ports. Atmega32 was selected because of its low cost, easy availability, reliability and compatibility with C language programs. ATmega328 microcontroller [9]: The microcontroller is a DIP of 28 pins. It is a single chip created by Atmel 8-bit AVR RISC Base microcontroller that combines 32kB ISP Flash memory with read capacities while writing. Motor driver IC: L293D motor [30], [31] driver IC was used and acts as an interface between microprocessor in the vehicle and motors in the vehicle. The motor driver consists of two H-bridges and Journal of Robotics and Control ISSN: 2715-5072 561 Aisha Abdul Mohammed, Development of a Prototype Autonomous Electric Vehicle is the easiest circuit for managing a low-current control signal and then turning it into a higher-current signal that can drive the engine. DC Motors: These are electromechanical instruments that use the interaction of magnetic field and conductors to transform electrical energy into rotary mechanical energy. For traction purposes, a 5V DC motor was used for heading navigation. Liquid Crystal Display (LCD): LCD is an electronic display instrument that works by applying a variable electrical voltage to a layer of liquid glass, thereby causing changes in its optical characteristics. In this paper, LCD functions to display the longitude and latitude.
Light emitting diode (LED): LED is a semiconductor light source that emits light when current flows through it. It determines the sensor trigger when there is an object and to activate the vehicle brake. Energy storage battery: A 6V rechargeable Li-ion batteries are used to supply power to the autonomous electric vehicle, in which LM7805 voltage regulator was utilized to provide a constant voltage to charge the batteries during the day time. Solar panel: This is an instrument that utilizes photovoltaic effect, in order to convert radiation from the sun directly into electrical energy. It is a supplementary energy act as a backup when the battery runs down during the night. The solar cell used in the vehicle is multi-crystalline due to its faster rate of conversion of energy.

B. System Hardware Design
The system was designed in modules. The following modules can be identified from Figure 2: power supply, input interface, output interface and other supporting module.
Power Supply: A voltage regulator 7805 was used in the power supply to give precisely 5V voltage and a maximum current of 1A, which is required by the microcontroller, HD44780 and the interface circuit. C1 and C2 were used to ensure good dynamic performance of the regulator. The maximum current in the ATMEGA 32 & 328 is 40mA, while the peak current required by the solar panel is 500mA. The maximum current demands from the rest of the sub-systems are as follows Crystal Oscillator 30mA, Ultrasonic Sensor 30mA, LCD 7mA, DC Motor 1&2 300mA, and Motor driver IC 100mA.
Input Interface: This module consists of the ultrasonic sensor, dc motor 1&2, motor driver IC, port pull-up resistor (R1) and capacitors (C1, C2) for crystal oscillator. The HC-SRO4 ultrasonic sensor was used to determine the distance of an object due to its excellent non-contact range detection with high accuracy and stable readings in an easy-to-use package from 2cm to 400cm.
Considering that the maximum output current sunk by any I/O pin is 25mA; for safety one-tenth of the current (2.5mA) is allowed to flow. Then calculating the resistance value gives by equation (1) (1) Thus, R1 was chosen to be 10kΩ.
Dc motor 1&2 was chosen for traction purposes, a 5V DC motor was used for heading navigation.
L293D motor driver IC was used to acts as an interface between microprocessor in the vehicle and motors in the vehicle for managing a low-current control signal and then turning it into a higher-current signal that can drive the engine.
The oscillator design requires the use of parallel cut crystal. Therefore, for a 4Mz crystal a 15PF capacitor is to be used for C1 and C2. Thus, a value of 22PF was selected for C3 and C4.
Output Interface: For the output components HD44780 was chosen due to its low power consumption, compact and light.
Other Modules: The ((MCLR)) ̅ pin is tied up through a resistor R2. The recommended value is between 1kΩ to 10kΩ. Therefore, a 10kΩ resistor was chosen.

C. System Software Design
The software design for the ATmega32 and ATmega328 were programmed using Micro C in an MPLAB environment. The flow chart for the system is presented in Figure 3.

III. RESULTS AND DISCUSSION
Apart from the solar panel and mechanical parts (DC motor wheels and it base), all the components were arranged and soldered on a rectangular Vero board with dimension of 12cm x 8cm. Having done with the construction all components were tested for before the packaging. The picture of the whole assembly is as shown in Figure 4.
During communication sequence between the microcontroller and ultrasound of the system, all measured waveforms and test values showing the acquired results are illustrated in Figure 5-9, with oscilloscope settings at: Channel 1Vertical knob at 200mV/div., Channel 2 Vertical knob at 500mV/div., and Horizontal knob at 5ms/div.  The equation relating the return echo pulse width () to the device calculated distance (d) is given by equation (2): A sample of the device calculated distance with reference to Figure 4 is as shown below: Echo Pulse width, = 0.326 div x 5ms/div =1.63ms = 1630µs. Therefore, the device calculated distance in cm = 1630 58 = 28.10cm .

Fig. 4. A Proto-type Autonomous Electric Vehicle
Error analyses were performed between the devices calculated values and the measured (experimental) values using the formula of equation (3). The results were shown in Table 1. From table 1 it can be seen that a distance of 25 cm is measured using an ultrasonic sensor of 28.10 cm with an echo pulse of 1630 and an error of 11.03%. A distance of 30 cm was measured using an ultrasonic sensor of 32.76 cm with an echo pulse of 1900 and an error of 8.42%. A distance of 50 cm was measured using an ultrasonic sensor of 51.72 cm with an echo pulse of 3000 and an error of 3.33%. A distance of 100 cm was measured using an ultrasonic sensor of 99.14 cm with an echo pulse of 5750 and an error of 0.87%. A distance of 150 cm was measured using an ultrasonic sensor of 148.3 cm with an echo pulse of 8600 and an error of 1.14%. From the graph shown in Figure 10, the measured and the calculated values are linearly dependent on the echo pulse width. Table 2 shows the results for obstacle avoidance test. The data in Table 2 shows that as the distance covered by the electric vehicle increases, the GPS position (longitude and latitude) also increases. Besides, there are little discrepancies between the assigned and measured threshold values, where a maximum error of 1.67% was recorded.

IV. CONCLUSION
An autonomous electric vehicle was implemented using ATmega32 and ATmega328 microcontroller. An additional feature is the use of ultrasonic sensor technology, possesses exceptional linearity, even over lengths up to 400 centimeters, with repeatability up to 0.002% of the measurement range. The vehicle is fully autonomous and after the initial loading of the code, it requires no user intervention during its operation. When placed in unknown environment with obstacles, it moved while avoiding all obstacles with considerable accuracy.