Prototype of Autonomous Vehicle and Relax Driving using APIS

Call for Papers Engineering Research Journal June 2019

Download Full-Text PDF Cite this Publication

Text Only Version

Prototype of Autonomous Vehicle and Relax Driving using APIS

B.S. Lokesh

Assistant Professor

Electronics and Communication Department, The National Institute of Engineering, Mysuru, India

Thokchom Roshan Singh

Electronics and Communication Department, The National Institute of Engineering, Mysuru, India

AbstractIn a modern world like today, driving becomes essential in almost every part of our life- driving to workplaces, schools, markets, etc. With increase in population, we find a booming increase in the number of vehicles. As a result of this, traffic jams are frequent in cities and towns. In such a condition, people usually face certain manual problems as controlling the basic control systems (i.e. clutch brake, accelerator). This problem can be reduced by implementing automated driving system where driver can relax. In this project, two aspects of an automated car are considered, one in which a following vehicle establishes way points and travel till destination is reached. Here, the robot fetches GPS coordinates dynamically and establishes shortest path using the Directions API of Google Maps API. The other aspect involves sensing the environment in heavy traffic and auto controlling the system. The robot is fitted with ultrasonic sensor for collision detection. A certain extension on whether a certain driver wants to automate his vehicle and follow a random target on same route is added. Hence, this project is focused to bring out automated vehicle to give human driver relaxed driving.


    Automated vehicles have tremendous utility and advances in the field of automobiles. Automation provides things with a certain level of ease for implementation, albeit its high cost. Therefore, considering various features implemented and the cost on a small scale, a three-wheeled vehicular robotic prototype has been designed that will automatically follow a target vehicle till destination is reached. We have focused on two applications. One application is where a vehicle i.e., the Following vehicle dynamically compares coordinates with the Target vehicle until destination is reached. The other application is used in heavy traffic when the driver has to continuously push brake, accelerator, and clutch to move to destination slowly. The robotic prototype under use consists of multiple modules, such as Wi-Fi module which helps it communicate with Google Maps API, ultrasonic sensor to make it determine obstacles, magnetometer to sense direction and follow the route and move smoothly. The Wi-Fi module help connect to ThingSpeak, and the data from ThingSpeak is parsed using JSON coding to get required coordinates.

    Guruaribam Harish Sharma

    Electronics and Communication Department, The National Institute of Engineering, Mysuru, India

    Sindhushree S V

    Electronics and Communication Department, The National Institute of Engineering, Mysuru, India


    Creation and development of automated cars has been a dream since humans last invented autopilot airplane[1] and self- driven ships and boats. There has been significant development in the field of building an automated car, but the advancing road infrastructure[3] and ever-increasing population[4] pose a difficult problem. Driverless cars only existed in fictional books and films. After the invention of digital computers, driverless cars come into existence in the real world. By the 1960s the self-driven car had been dreamed to navigate on ordinary streets on their own[2]. In 2009[5], Google began the self-driving car venture. By 2012 the Google car hits the road for testing. By the passing years, the car is developed and equipped with multiple sensors, radars and lasers. Global Positioning System (GPS), it uses heavily detailed maps, and many other things to safely drive and navigate itself with no human interaction. The car can not only drive itself but it can be parked on its own. It can go on freeways, Cameras are used to find and detect objects[7] that are then processed by the computer within the car. In May 2014[6], Google presented a new concept for their driverless car that had neither a steering wheel nor pedals and unveiled a fully functioning prototype in December of that year that they planned to test in 2015. In summer 2015, Google launched and tested some different features where each prototypes speed is capped at a neighbourhood-friendly 25mph, and during this phase safety drivers aboard with a removable steering wheel, accelerator pedal, and brake pedal that allow them to take over driving if they needed.

    In this paper, we have designed two applications of an autonomous vehicle, which can help the driver to relax for the certain duration of time. This paper presents a concept in which the modified concept of Google car is focused, the Google car has to reach the static destination automatically; in our prototype, we have made the destination dynamic. Here our destination is also a vehicle which is moving on a certain route. Our prototype will follow[8] that vehicle. Another application that has been implemented here was to tackle heavy traffic congestion and allow the vehicle to move automatically during that traffic congestion.


    Figure 1: Block Diagram


    1. Arduino Mega 2560:

      The Mega 2560 is a microcontroller board based on the ATmega2560. It has 54 digital input/output pins (of which 15 can be used as PWM outputs), 16 analogue inputs, 4 UARTs (hardware serial ports), 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 simply connect it to a computer with a USB cable or power it with an AC-to-DC adapter or battery to get started. The Mega 2560 board is compatible with most shields designed for the Uno and the former boards.

    2. Ultrasonic Sensor:

      Ultrasonic sensors are a type of acoustic sensor divided into three broad categories: transmitters, receivers and transceivers. Transmitters convert electrical signals into ultrasound, receivers convert ultrasound into electrical signals, and transceivers can both transmit and receive ultrasound. In this project we are using an ultrasonic sensor of the type HC- SR04. It has 4pins, namely VCC used for power supply, GND for grounding, Trigger pin for transmitting ultrasonic pulses and Echo pins is for receiving the reflected pulses.

    3. GPS Module:

      A GPS navigation device, GPS receiver, or simply GPS is a device that is capable of receiving information from GPS satellites and then to calculate the device's geographical position. Using suitable software, the device may display the position on a map, and it may offer directions. The Global Positioning System (GPS) is a global navigation satellite system (GNSS) made up of a network of a minimum of 24, but currently 30, satellites placed into orbit by the U.S. Department of Defence. A GPS device can retrieve from the GPS system location and time information in all weather conditions, anywhere on or near the Earth.

    4. Bluetooth Module:

      HC05 module is an easy to use Bluetooth SPP (Serial Port Protocol) module designed for transparent wireless serial connection setup. The HC-05 Bluetooth Module can be used in a Master or Slave configuration, making it a great solution for wireless communication. The slave modules cannot initiate a connection to another Bluetooth device, but can accept connections. Master module can initiate a connection to other devices. The user can use it simply for a serial port replacement to estabish connection between any device and the module.

    5. DC Motors:

      A DC motor is any of a class of rotary electrical machines that converts direct current electrical energy into mechanical energy. The most common types rely on the forces produced by magnetic fields. Nearly all types of DC motors have some internal mechanism, either electromechanical or electronic, to periodically change the direction of current flow in part of the motor. The universal motor can operate on direct current but is a lightweight brushed motor used for portable power tools and appliances. Larger DC motors are currently used in propulsion of electric vehicles, elevator and hoists, and in drives for steel rolling mills.

    6. Motor Shield

      This is used to provide the power to move the motors. Motor shield implemented with related Arduino library can run the motors. Also this provides as an extension board wherein we can connect more components to the system.

    7. Wi-Fi Module

      The Wi-Fi module Node MCU provides connection with the Arduino, to connect to ThingSpeak to upload relevant data. Basically acts as the main component of the Communication section


    In this project Arduino Compiler is used for interfacing the various components to the Arduino board Interfaced to the Arduino Mega 2560 board are GPS module, Bluetooth module, motor shield, servo motor, ultra-sonic sensor. Google APIs are used to interact with google service and our device. Google APIs is a set of application programming interfaces (APIs) developed by Google which allows communication with Google Services and their integration to other services. We also use MIT Inventor App to connect to the Bluetooth[10] for the control of the robot.


    Figure 2:Flow-chart of the Following vehicle


    Our project shows how the prototype works on two applications i.e. following vehicle and heavy traffic jam situation. Figure 1 shows the block diagram of prototype Mobile Robot (Vehicle). Our main focus is on Following Vehicle, which detects and avoids obstacles, coordinates with Google Maps API, gets and follows the route. For another application, it checks vehicles around and automatically moves slowly behind the traffic until it gets out of traffic jam situation. The function of the Target vehicle is just to provide the coordinates to Following Vehicle, which are also not static as the Target vehicle is moving towards its destination. This whole project involves the two vehicles first defined as the Target Vehicle and second as the Following vehicle. The implementation involves three main parts- the Communication section, Direction detection and the Automated Following Robot.

      1. Communication Section

        This section involves the Target vehicle fetching its GPS coordinates and sending it over to the Following vehicle using the Wi-Fi. GPS values in NMEA encoded sequence are parsed using JSON decoding to get the latitude and longitude values. The Following Target vehicle also fetches it GPS coordinates. The Following vehicle whenever receives a message through Wi-Fi, the message is sent to Arduino. The coordinates parsed through JSON coding are linked using Google Maps API[9] and Google Navigation to find the direction, as in Figure 3. Directions API will auto-generate the shortest route. This direction is then compared with the Robots current direction and after rotating vehicle in that direction, the vehicle starts moving forward. Thus vehicle will continue fetching the current location received from the Target vehicle after every certain time span and will continue to move in that direction

        and this process continues until the vehicle reaches the destination vehicles location.

        Figure 4: Direction on Google Maps

      2. Direction Detection

        This is the most challenging part of the project. The Google Maps API gives direction in the form of north, south, east, west, north-east, south-east, north-west and south-west. However, the output of the Magnetometer or the compass we use gives direction in x, y and z format. The x, y, z show the Earths magnetic field in horizontal(x, y) and vertical (z) directions. The compass needs to be calibrated for a number of times to get accurate values of x and y. The calibration is done using in-built functions provided by Arduino library. We need these x and y values for getting offsets for the compass. The compass will set two headings- forward heading and backward heading to indicate direction of the vehicle. A library called TinyGPS++ can be used to acquire satellites for the use of GPS. A minimum of four satellites is required for its working. The library also provides the robot with a function to get directions using the data mentioned above. Thereafter, the Following vehicle sets 5-6 way points to start its motion till the destination.

      3. The Automated Robot

    The Following vehicle in the middle of following the Target vehicle will keep on looking for the obstacle that might come. To look for the obstacle, ultrasonic sensors have been used. Ultrasonic Sensors is fixed with a servo motor to rotate the sensor for collision detection. For instance if there is a wall or a pedestrian in front of the vehicle, the ultrasonic sensors at the front side of the vehicle will detect and the vehicle will turn to the safe side, another possible scenario might come in which there are three obstacles; in front, at the right side and at the left side of the vehicle, the ultrasonic sensors will again detect the obstacles and the vehicle will then move backward even if there is an obstacle behind, it will stop for a moment and thus again looks for the obstacles from the beginning thus deciding the route on the basis of circumstances. The algorithm for the robot is depicted as flow chart in Figure 5.

    Figure 6: Proposed Model


    This is an advanced step for autonomous driving vehicles. With the help of this algorithm, the automated vehicle can move about with the guidance from another vehicle and use for transportation. Certain limitations still exists, but with advancement in technology progress can be made towards a better automated vehicle step by step. The potential applications of this robotic vehicle are to use these types of autonomous vehicle on highways or heavy traffic roads. These types of autonomous vehicles can also be used when a driver travels to the new areas. It is an improved navigation system for autonomous vehicles. Moreover, with the emergence of automated vehicles, we have another opportunity to rethink urban life and city design. They will act as a catalyst in technology advancement. Ever decreasing cost of technology and involvement of automotive giants can bring about a huge change.


During the busy days, we can carry on our work inside the vehicles. It can be used for transportation of goods where a single driver can lead a number of following vehicles. During the heavy traffic, the driver can relax as the vehicle is set to cope up with busy traffic. We can use this vehicles for delivery system also. We can add more features to communicate with every vehicles and make it more efficient. We may save time during the busy traffic if we can use precise sensor.


  1. M. Frutiger and C. Kim, Digital Autopilot Test Platform with Reference Design and Implementation of a 2-Axis Autopilot for Small Airplanes, Department of Electrical and, pp. 124, 2003.

  2. M. Weber, Where to? A History of Autonomous Vehicles, 2014. [Online]. Available: toahistory- of-autonomous-vehicles/

  3. D. Helbing, Traffic and related self-driven many-particle systems, Reviews of Modern Physics, vol. 73, no. 4, pp. 10671141, dec 2001.

  4. P. Rau, Target Crash Population of Automated Vehicles, in In 24th International Technical Conference on the Ehanced Safety of Vehicles (ESV), 2015, pp. 111.

  5. Details – google car,, (Visited on 09/08/2016).

  6. A. Fisher, Inside Googles Quest To Popularize Self- Driving Cars, Popular Science, 2013. [Online]. Available: car

  7. K. R. Memon, S. Memon, B. Memon, A. R. Memon, and M. Z. A.

    S. Syed, Real time Implementation of Path planning Algorithm with Obstacle Avoidance for Autonomous Vehicle, in 3rd 2016 International Conference on Computing for Sustainable Global Development, New Delhi, India, 2016.

  8. E. Frink, D. Flippo, and A. Sharda, Invisible Leash: Object- Following Robot, Journal of Automation, Mobile Robotics & Intelligent Systems, vol. 10, no. 1, pp. 37, feb 2016.

  9. Google Maps API, [Online] Available:

  10. Working with bluetooth module and gps, [Online] Available:

Leave a Reply

Your email address will not be published. Required fields are marked *