Design of an Obstacle and Location-Based Detector with Microcontroller System

— Out of seven billion of the world’s population, two billion and two million that amounts to 31.43% have visual impairment or blindness according to the World Health Organization (WHO) statistics report. Hence, the need to develop a wearable device with reduced size, efficient power usage, and for more comfortability of the visually impaired or blind people. This work aims at designing an obstacle detection system using an ultrasonic sensor interfaced with an Arduino board to track location, alert patient, and send location messages of visually impaired patient to guardians as a feedback mechanism using a GPRS and GSM module. The C programming language was used as the instruction code to interface Arduino device to carry out given tasks. At the design level, the circuit was first tested on Proteus software for simulation purposes before its hardware implementation. The results obtained from the test show the variation of distance as the patient approaches the obstacle, and messages received when a fix was obtained. This design concept would help reduce danger across the way of those with sight defects and allow them to go to familiar places without any aid smoothly.


I. INTRODUCTION
The world population is estimated to be 7 billion; about 2.2 billion of the population have a visual impairment or blindness, out of which about 48% have a preventable visual impairment. Most of the visually challenged people are above 50 years of age [1]. Impairment is classified as severe and mild challenges; the serious challenge includes severe and total blindness, while mild challenge includes mild and moderate cases. People having difficulties with eyesight traditionally had to be guided, which is not convenient for both the patient and the individual helping the patient in most cases [2]. Walking sticks are alternatives in guiding patients, as demonstrated in Fig. 1. Such an approach requires skill and training phase, which allows patients to be acquainted with the surroundings but has limited capabilities and drawbacks based on the non-intelligence and inability of the walking stick to provide vital information for the patient. Fig. 1 shows a man who is visually impaired using a stick trace to navigate his path. This method is steadily revolutionizing into modern-day obstacle detection systems where sensors are interfaced with intelligent systems to analyze data structures [3], [4], and build algorithms to detect objects or terrain types that impede motion [5], [6]. Submitted  Obstacle detection can be used in various areas such as robot manipulators, crewed, or uncrewed vehicles for land, sea, air, and space [6], [7]. Obstacle and hazard detection are synonymous. Hazard detection is often applied to aircraft or spacecraft in the landing zone, as the distance between the spacecraft and the landing zone is calculated to avoid crashlanding; this involves the use of the sensor [6]. In each case, a world representation is developed in the form of a mathematical model in which the sensor easily interacts with the patients and the obstacles to minimize a collision. In obstacle detection, distance measurement is essential. Many physical quantities are known to be measured using measuring instruments such as tapes, scales, balances, rulers, while others are measured using sophisticated equipment like optically and electro-magnetically controlled devices. Sir James Watt deployed an optical measurement device to obtain long-distance measurement of light. At the same time [8], proposed the use of electromagnetic devices in measuring distance based on the duration of time taken by the radio waves to travel to-and-fro the object.
The ultrasonic sensor is an obstacle detection device that finds application in measuring depths, variations of wavelengths, underwater, and sewage blockage detection. The system can further be enhanced to achieve real-time tracking and localization capabilities when interfaced with a GSM/GPRS/GPS module, a controller [9], and the Internet of Things (IoT) enabled monitoring devices [10], [11]. The obstacle sensation obtained from the echo terminal of the ultrasonic sensor after transmitting high-frequency sonar waves is processed in the microcontroller to calculate its time interval and distance to the obstacle. The controlling section gathers all the information regarding the working prototype, especially the calibrated thresholds, and alerts the patient with There are four major components in obstacle detection and location tracking system; the components are ultrasonic sensors, Global Positioning System (GPS) module, Global System for Mobile Communication (GSM) module, and microcontroller. One of the components for obstacle detection is the ultrasonic sensor. Ultrasonic sensors are inexpensive and commercially available to measure short distances of an obstacle [3], [4], as shown in Fig. 2. Ultrasonic sensor models differ in measurement ranges as a result of the sensitivity of the ultrasonic signal received (as echo) in response to the emitted pulsed signal via the "trigger pin" as it travels within the environment. The object distance is obtained from the time it takes the emitted signal to return, with respect to its speed [8]. Mathematical expression for this relation is given in equations (1) Also, recalling that where s is the speed of sound (≈340 m/s), 2D is the distance to-and-fro between the sensor and the object, τ is the total time taken, λ is the wavelength and ƒ is the frequency of operation of the device. The Ultrasonic distance meter similar to radar in principle, involves interpreting and attributing echoes of radio or sound waves from an obstacle to a particular echo signature [12], [13]. Ultrasonic sensors generate high-frequency sound waves in the ultrasonic range of 18 kHz to 40 kHz [13], [14]. Distance measurement using an ultrasonic sensor in air adopts continuous wave and pulse-echo technique. The pulseecho or time-of-flight method requires a burst of pulses sent through a transmission medium which is reflected by an object kept at a distance. This method is subject to a high signal attenuation when used in an air medium. In this case, the target is meant to have a proper orientation; that is, it must be perpendicular to the direction of propagation of the pulses. The continuous-wave technique goes on and off in a nonstopping manner, which consists of strings of brief pulses of sinusoidal radio frequency oscillations [15]. The second component is called the Global Positioning System (GPS) module, shown in Fig. 3. GPS is a known functional Global Navigation System (GNSS). This GPS employs a constellation range of 24 to 32 Medium Earth Orbit satellites; It transmits precise microwave signals that allow global positioning system receivers to determine the location parameters [16]. The GPS receiver captures the signals from at least three satellites to calculate distance, thereby using the triangulation technique to compute its two-dimension (latitude and longitude) position. Alternatively, using at least four satellites to compute a three-dimension (latitude, longitude, and altitude) position [3], [16], [17] for indoor localization; hence GPS is a vital technology for giving the device its position. It operates based on the following algorithm in equations (4)- (8), to track the latitude and longitude position of the receiver: With the message transmit time (̃− − ), where the satellite time is , the receiver clock bias from the accurate GPS clocks employed by the satellite is and the time of message reception indicated by the on-board receiver clock is ̃. Hence the exact reception time is: The message is assumed to travel at a speed of light ≈3×10 8 m/s.
A pseudo-range for ( = 1,2,3, … ) is also defined as: For ′ ′ satellites, the geometrical distance or range between the receiver and the ℎ satellite is given as: where , , represents the receiver's position and represents the clock bias [16].
To obtain ( , , ) or ( , , , ) of the GPS receiver, at least three or four equations representing the signals from the satellite are required.  The third component is the GSM module. A GSM (Global system for mobile telecommunication) module is a unique type that permits specific SIM cards. The system operates over a subscription to a service provider. [18], [19], carried out a signal model and analysis of GSM on the MATLAB/Simulink environment, referring to the channelization algorithm on its receiver. GSM uses a process known as circuit switching which permits establishment of path between two devices [15]. Immediately the two gadgets are linked, a constant stream of digital data is relayed. GSM networks consist of three major systems namely Base Station (BSS), Switching System (SS), and the Mobile station (MS) [15], [16].
The SIM808 is a two-in-one function module based on the latest GSM/GPS from SIMCOM and GSM/GPRS Quad-Band network [20], [21]. General Packet Radio Service (GPRS) is a packet-oriented mobile data standard on the 2G and 3G cellular communication networks of GSM. It allows the transfer of data and uses location details provided by cellular networks to determine the receiver location.
Lastly, the microcontroller, as shown in Fig. 6a and 6b, the microcontroller is the heart of this device. It is interfaced with the SIM808 module to interpret the location data obtained from GSM/GPS. A microcontroller stands as system on a single integrated circuit comprising data memory, processor core, converter that is Analog to Digital (A/D), programmable input/output devices for handling digital and analog sensors or output indicators [22], [23]. In this device, the user programs the microcontroller to stimulate the GSM in message forwarding mode when a request is sent.
The microcontroller used in this work is Arduino Nano microcontroller, Fig. 6b, which has one of its output terminals linked to an alert system called buzzer shown in Fig. 4, while the others to the trigger of the ultrasonic sensor and the SIM808 module. The use of IR sensors, and other environmental monitoring sensors, which interface with the microcontroller to detect location information automatically, can advance the use or applicability of this device significantly [24]. The program codes are written in assembly language. These codes operate at a pulse frequency of 40 kHz, a pulse train of 25 microseconds, and a waiting time of about 25 pulses to avoid direct echoes for about 20 microseconds. If the echo does not arrive, 48 microseconds times, then the waiting loop is broken, and the pulse train sequence begins again. When it occurs within this time, the display appears continuous and flicker-free. The programming is carried out on an Arduino IDE (Integrated development environment), a cross-platform application written in Java. Arduino board is based on ATmega328, shown in Fig. 5. The current models have 14 digital input/output (I/O) pins connected to different extension boards, universal serial bus (USB) interface, and six analog input pins. They help to activate the pre-installed program within the Arduino until a new set of code is uploaded. The most official versions of the Arduino board available is Arduino Uno R3 and the Arduino Nano V3. A Storage device is added to the board using expansion cables or shield for larger tasks.
The system targets a wearable smart device [17] with a reduced form factor and efficient power [25], [26], worn on the patient's waist. Hence a two-dimensional state method for highway vehicle detection is required [26]. Fig. 6 a. An Arduino Uno Board [22]. Fig. 6 b. An Arduino Nano Board [22].

II. RESEARCH METHOD
The materials needed for this project divided into two major parts: navigation (ultrasonic sensor, buzzer) and tracking (SIM808-GSM/GPS/GPRS module) components, as depicted in Fig. 7, representing the overall system diagram. Other components have combined usage for the two components itemized, such as the Arduino Nano microcontroller, jumper wires, switches, Li-ion battery, credited SIM card.
The conceptual design divided into two sections: simulation/ software coding section and hardware implementation. A modular approach is employed to analyze the overall system design by linking all the subsystems together. The system design and implementation are broadly divided into four segments: power and charging circuit, sensing circuit, controlling circuit, and message sending/ tracking circuit. The off-the-shelf power supply components consist of the battery cells, which include two 3.7 V/ 7800 mAh Li-ion in series, and 9 V Hi-Watt battery, which is used to power the Ultrasonic, SIM 808 module, and Arduino board respectively.
The simulation section consists of an algorithm developed to extract the visually impaired patient's position from a nearby obstacle via the ultrasonic sensor and check for the location of the patient and send an SMS using the GPS/GSM module. This section's goal was achieved using the Proteus 8 Professional schematic software tool and Arduino IDE (runs C programming). A HEX or COF file is generated from the Arduino IDE after highlighting the compilation box in preferences pasted in the program file within the edit component for simulation while uploaded from the Arduino IDE to the hardware controller.

B. SIM808 Module
The SIM808 module is a subsystem that handles the combined operation of GSM and GPRS/GPS [29], [30]. This module is used to obtain the exact location of an individual in the form of Longitude and Latitude. It gives a link to track the individual via a google map application on a mobile device. This device's operation is achieved with the help of a mobile communication center to send/receive messages and calls and available satellites to track the location. In the simulation, the modules are connected as separate entities, whereas in hardware, the combined operation is on the SIM808 board.
Unlike the simulation scenario, the ultrasonic sensor automatically detects the variation of distances without the help of a potentiometer. The sensor's operation depends on the supply voltage that makes it active and the instruction codes from the microcontroller, which sends HIGH/LOW pulses through the trigger and echo pin. SIM808 module has three power input interfaces, the DC044, Vin, and Lithium battery interface. The DC044 and Vin uses a 5-26 V, and at 5 V the current of 2A is used. The lithium interface, on the other hand, uses 3.5-4.2 V. On powering the system (ultrasonic sensor, microcontroller, and SIM808 module), indicators appear on the microcontroller and SIM808 boards. A button is required to be pressed for about 2 seconds to activate the SIM module's operation. A slow flash from the module indicates the module is registered to a network and a call/message can be placed through it via the GSM terminal and the Longitude, Latitude location derived via the GPS.

III. RESULTS AND DISCUSSIONS
The results obtained highlight the simulation outputs in Arduino IDE serial communication port (COM4), virtual layout on Proteus 8 Professional, and hardware implementation of the device.

A. Software Results
The result of the simulation in Fig. 8 illustrates the interfacing of the ultrasonic sensor and the microcontroller using a potentiometer to vary it is range from an obstacle. The simulation is successful only when the Proteus library for the ultrasonic sensor and the instruction code from Arduino IDE is uploaded to the virtual components in Proteus 8 simulator.
A virtual terminal similar to a COM port connected to the TX and RX pin of the virtual Arduino board is used to view the code's working as the range varies. Pins D5, D6, and D7 in the circuit diagram represent the buzzer, ultrasonic sensor echo pin, and trigger pin, respectively, as they connect with the Arduino Nano board's digital pins. One leg of the buzzer is linked to the digital pins D5 of the Arduino Nano while the other leg is connected to the ground (GND).

B. Hardware Results
The circuit diagram shown in Fig. 9 reflects the incorporation of the GSM/GPS module into the system. The receiver pin of the GPS module is linked to the transmitter pin of the Arduino Nano microcontroller and the transmitter pin of the GPS module linked to the receiver pin of the Arduino Nano microcontroller.
The receiver pin of the GSM module is separately connected to the Arduino Nano during the simulation. The transmitter pin TXD connected to pin D10 and receiver pin RXD to pin D11 of the Arduino Nano board, respectively. The simulation requires the various libraries for ultrasonic sensor, GSM module, GPS modules, and the instruction code from Arduino IDE uploaded into the virtual components in Proteus 8 simulator before a complete test can be carried out. Fig. 10, 11, and 12 illustrate the ultrasonic sensor's hardware testing results, the GPS, and the overall system design. A USB 2.0 to USB 2 mini B cable is used to upload the codes from Arduino IDE to the hardware Arduino Nano microcontroller. Fig. 13, illustrates the final circuit design when connected and fixed into the packaging casing. The sensor part is kept in front, and the battery, which is the source of power supply for the Arduino and SIM808 kept inside it. The completed design contains a waistband used to hang it around the waist presented in Fig. 14.

IV. CONCLUSION
This paper provides a solution to the problems encountered by the visually impaired patient with the use of an Arduino based system containing an ultrasonic sensor and SIM808 module for detecting obstacles and getting the aerial location of the patient per time. The obstacle detector's model and design operate with a low power requirement on the Arduino that makes it scalable to a waist-held device. The results obtained from the tests show the variation of distance as the patient approaches the obstacle. The set limit of distance between the patient and the obstacle announces a collision alert with a buzzer. A message triggered when there is a missed location or destination by sending an SMS alert, which would contain the longitude, latitude, and a link, which would direct the guardian of the patient to the location of the patient with a google map link. The design contains a waistband used to hang it around the waist.