Table of Contents

Project description

The purpose of this project, called „Remote reverse parking”, is to bring the IoT domain to the automobile industry. In the last years, IoT had a massive jump in popularity and usage in domains like smart homes, electronic devices, but the presence in the automobile industry is in a incipient stage.

The project simulates the behavior of a car that can be parked remotely, without a driver inside the car, using a WEB page connected via Wi-Fi to the car.

For the implementation, I used ESP32 microcontroller, a DC motor, a DC motor controller (L293D integrated Circuit), an ultrasonic sensor (HC-SR04), 2 LEDs, one buzzer and a breadboard power supply module.

Hardware description

In my project I used the next components:

1. Microcontroller ESP32:

ESP32 is a low-power system on a chip microcontroller, development board, that is characterized by a small price, but offering very good capabilities, especially for IoT applications, making usage of the built-in Wi-Fi and Bluetooth capabilities.

Project usage:

Image 1: ESP32

2. HC-SR04 ultrasonic sensor:

The sensor is used to measure distance to an object. It uses one transmitter to send an ultrasonic wave that will travel in air until reaching an obstacle and then will be reflected back to the sensor’s receiver module.

Project usage:

Image 2: HC-SR04 ultrasonic sensor

3. DC Motor, L293D motor controller and breadboard power supply module:

The DC motor is standard, with operating voltage between 3V – 6V.

L293D IC is a motor controller capable to drive 2 DC motors, and is used to control the motor speed.

The breadboard power supply is used to generate 3.3V or 5V output, from a 9V-12V external source, for example a battery, and is connected directly to the VCC and ground pins of the breadboard.

Project usage:

Image 3: DC motor, L293D motor driver and Breadboard Power Supply

4. LEDs and buzzer:

Project usage:

Image 4: Yellow LED and Active Buzzer

The implementation on the breadboard is presented in the next images:

Image 5: Breadboard implementation

Image 6: Real breadboard implementation

The electrical diagram of the circuit is presented in the next image:

Image 7: Schematic

Software description

The code for the project is implemented using „Arduino IDE”.

Software implementation key features

For the project, ESP32 board is set to operate in „Station Mode”. This means that the board is connected to a Wi-Fi router, retrieves the IP address and creates a web server based on it. The web server can be accessed by another device connected to the same Wi-Fi network.

To facilitate the connection to Wi-Fi, 2 libraries are used:

  1. „WiFi.h” – Provides dedicated Wi-Fi methods for connecting the ESP32 to internet;
  2. „WebServer.h” – Provides methods to set up the web server and handle HTTP requests.

The distance to an obstacle will be showed in the web page, and since the value is not fixed, is changing, I had 2 options, either refresh the web page at a certain fix time period, or update only the distance in the background. Since it is a more cleaner and correct way, I choose the second option.

To achieve the auto-refresh of the distance value, I used „AJAX” (Asynchronous JavaScript and XML), a technique used to update only portions of a web page, fast and dynamic, without refreshing the hole page.

Code modifications required:

  1. Create a new function, linked to the web server, using „.on” method, that will handle the distance change,
  2. Integrated a JavaScript section in the HTML code, that will call, every second, the function mentioned before, and the displayed distance value will be updated in the web page.

Software implementation overview

We can split the code functionality in 3 parts, representing the functioning states, what will be presented to the user in the web page and how the software manages the hardware.

First part

When the microcontroller is booted and the program starts, after the connection to the Wi-Fi is established, the main web page can be accessed, see the preview image below:

Image 8: Home web page

In this step, all the hardware components are turned off.

From this step, we can go on and start the car.

Second part

After the car is started we go to the second web page, where the option to start the remote parking is available.

In this stage the LEDs will start to blink, noticing visually the user that the car is running.

From here 2 options are available, turn off the car and go back to „First part” or start remote parking and go to the „Third part”

Third part

When the remote parking is started, the web page will be updated, and the start button for remote parking can now be used to stop the parking.

When getting closer to an obstacle, a pop-up warning message will appear on the web page, noticing the user that an obstacle is detected and the distance to it, as shown below:

Image 9: Remote parking started - web page

From the hardware control side, the DC motor will start to run at constant speed, and will decrease the speed when the distance to obstacle, measured with HC-SR04, is decreasing. Also the buzzer will generate sounds in the background.

Next available user options are: stop the remote parking, during the parking process or after the parking is done, and go to „Second part”, or stop the car completely and go to „First part”.

The work flow and software implementation of the project is described in the next diagram:

Image 10: State diagram

Further development

Having a solid and tested starting point, I plan to continue developing the project in both hardware and user interface directions.

First, I want to switch from a basic web page interface to an Android/IOS Application, that will make the user-car interaction more easy. Also functionality for front parking will be added.

Secondly, on the hardware side, I want to add one more ultrasonic sensor, used for the front parking, and maybe even switch to more accurate distance sensors or even cameras.

Conclusions

Implementing this project gave me the opportunity to work and learn how to use an Arduino controlled development board, ESP32, with Wi-Fi capabilities. The internet and wireless connections are now part of our lives more than ever before, and will still be in the future, so learning to take advantage of this capabilities is very benefic.

Also, the IoT domain is in a continue expansion, making the human interaction with electronic devices more easy, and I think the domain chose by me for the project, automotive industry, can take advantage from integrating IoT solutions, more than in present.

Source code, Demo video and Presentation

https://we.tl/t-LU5gt92oTn

Reference pages