Method to implement the proposed system is divided into 3 phases which are Prototype design of Ultrasonic sensor based distance detection using Arduino, Bluetooth communication and android application, ESP32 CAM with YOLO Object detection. The Block diagram of proposed system is depicted in Fig. 1 and Fig. 2 :
A. Protype design of ultrasonic-based distance detection using Arduino:
It utilize an Arduino board for ultrasonic distance detection. Arduino is commonly used for interfacing with sensors and actuators due to its ease of use and versatility. Ultrasonic sensor is a device and its functionality is to measure the distance of an object using sound waves. The device operates by emitting an ultrasonic sound wave and then detecting its reflection off the item. The time delay between the transmission of sound and receiving of the sound is used to calculate the distance using the formula :
![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUsAAAAtCAYAAAAnbUltAAALC0lEQVR4Ae2cjZUTuRKFSYEYSIEcCIEYSIEMyIAMiIAISIAEyIAc5p1v3n7spUZt9xhsj71X5/SqW6o/3Srdlu1hXz20FYEiUASKwFEEXh2VqEARKAJFoAg8lCxbBEWgCBSBHQiULHeAVJEiUASKQMmyNVAEikAR2IFAyXIHSBUpAkWgCJQsr1ADP378ePjw4cPDly9fruD9+S4/ffr08OrVq8fr27dvzzdwQAPbb968+WX/gOhNTJ0Tqz0AkCdieGmNurGGnhvfu3fvHnWpk3O0r1+/Prx///7hWG2XLM+B/gGb379/fyQH+ltqHz9+fCzYvxkzm+b169cPvDwoVDbFPbRzYCUuP3/+fMzDamNLSGz+l9iIC8JcxX4s3rdv3z4S2jG5U+epQXwcOsCULE9F9wQ9Ch1yOKVYTnD3V1U4Cf9NMhMLiOXe2t/GKvHx5Jpjt3IPEUGWpzT0Pn/+fIrqbh1rcusgc1rku91XMBGg0Dnurxpv3fw4yluOpJFANh/FArHw7MkF+VVi8aOtlQw6xIFN7c6Ypg3s7CE21kHs2OXFsNJh0xifMeDvUCNmP46hg/48BcyYc5574vEkq6952gFf/azw5gQy2/S7BytzmPXgGDGtmriKGb24GXO+0Oaas8bUw6e4rGppT62sYmVs1gLxc81mjRMHa2INjNmIgfF5yFjpoZv4iSl+06YYZo3gD/nE0BjoS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OUpyEm3aYk3CJG2LjIj6+byWW1M+19b4IFIEikAg8IUuIydNgCkIykJMNwoGYIB2bp9L5Ed557K5sc0JM0tJO2tafRIlNyC59HSI/iRqb2MIO8XPfVgSKQBE4hsATsoS4koAwsCIqZJI8dcRpEBvMQXrZVrY9RSZpQWTTNv7Ql0CNSb2VnfQN2UOOXJAqpD3jS3nuU0fd2SPTVgSKwP0j8BtZeqKTgFg+5ARxQTASFeOQTX7EnVDNf1a1so0OJ0oIyIaP1QkRf9i0TbKedpSzx0eeXh1vXwSKQBHYg8C/LPXP/5E4T3T+6AJ5zVOYhAZpIUefZAa5pS1PfpAh98zT0IPIsA9JQ8Cc1hjnQpaGv/wIji/k0GOcGLSDPM9J5sRifMQAceb8o5P+pwgUgSKwgcAvsoR0ICQIxwuCgVTyRKkdiAc5T2sQW+pLZMpDhM7nHLZ5xhYEyjMklh/Z0WU+CdvvHInD+NBDDl1t6T/Xt5pXrn0RKAJFYIXAL7JcTXasCBSBIlAE/o9AybKVUASeiYBfF/lJqZ9UngngjYqXLG80cQ37egjwtREE6ffpfBXF1z/5nfr1oqvncyFQsjwXsrV7twhAlvPHQciS8bb7RaBkeb+57couhAA/MPZkeSGwr+imZHlF8Ov6PhDgLzL4yxH/KuM+VtVVTARKlhORPheBZyDg3xOXKJ8B2o2KlixvNHEN+/oIlCivn4NLRlCyvCTa9XU3CPgPJ/IfStzN4rqQJQIlyyUsHSwC2wjwT2n506EkSu77a/g2ZvcwU7K8hyx2DRdFwD9G5xfwvEqWF03DxZ2VLC8OeR0WgSJwiwiULG8xa425CBSBiyNQsrw45HVYBIrALSJQsrzFrDXmIlAELo7A/wB8Uw38S+39PAAAAABJRU5ErkJggg==)
As indicated in Fig. 3, HR-SR04 consists of 4 pins, which are Vcc (5V Supply), Gnd (ground), Trig (trigger) and Echo (Receive). The model has 5V DC operating voltage and operating current of 15mA.
Connect an ultrasonic sensor, such as the HC-SR04, to the Arduino board. Utilize an Arduino controlled servo motor to facilitate rotational motion. Establish the connection between the servo motor and the Arduino board and set up the configuration to enable rotation of the motor in response to the data received from the ultrasonic sensor. Modify the positioning of the servo motor according to the identified items in order to direct the camera towards particular regions of interest. Develop Arduino code to transmit ultrasonic pulses and calculate the duration it takes for the pulses to return after striking an object. Determine the distance to the object by measuring the time it takes for the ultrasonic pulses to make a round trip to the object and back.
B. Bluetooth Communication and Andriod application ;
Android application is developed using Android studio and Arduino IDE. It establishes a Bluetooth connection with an Arduino device that is equipped with an ultrasonic sensor for the purpose of detecting objects. The Arduino consistently monitors distance and transmits the data to the Android application over Bluetooth. Upon detecting an obstruction, the android application (refer to Fig. 4) generates an alert to tell the driver through a voice message. The message provides information regarding the discovered obstacle and its distance from the vehicle. An Android application utilizes the speech synthesis capabilities of the Android device to transform text notifications into audible voice messages. Subsequently, these vocal messages are emitted via the device's speakers or linked audio system, ensuring the driver receives timely and clear notifications of possible obstacles on the road.
C. ESP32 CAM Module with YOLO Obstacle detection :
ESP32 is a microcontroller with Wi FI built in capabilities and it can be interfaced with camera module (refer to Fig. 5 ) to capture image of the obstacles. Implement YOLO model to perform obstacle detection on the captured images.
YOLO(You only look once) is an object detection algorithm that utilizes deep learning techniques. The system analyzes real-time photos and accurately identifies items. The YOLO v2 model utilizes Convolutional Neural Networks (CNNs) to carry out both object identification and classification tasks. The YOLO v2 network comprises a primary network for extracting features and a detection head for precisely determining the location of objects within an image.
ESP32 captures images using the connected camera module and preprocesses by YOLOv2 model. The preprocessing steps for the input of the YOLOv2 network include scaling, normalization, and conversion to the suitable format. The ESP32 utilizes the YOLOv2 model inference algorithm mentioned in Fig. 6 to analyze the collected images and identify things. During this procedure, the pre-processed images are fed into the neural network and the resulting output is examined to detect objects and determine their positions within the image. The output of the YOLOv2 method for object detection consists of bounding boxes that surround the discovered items. These bounding boxes are accompanied by class names and confidence values.