Microsoft Word - fullpdf06012024 Georgian Scientists/ქართველი მეცნიერები ტ. 6 N 1, 2024 20 Georgian Scientists ქართველი მეცნიერები Vol. 6 Issue 1, 2024 https://doi.org/10.52340/gs.2024.06.01.04 Ultrasonic distance measurement and system simulation Nika Sharashenidze1; Nona Otkhozoria2; Tamar Menabde3 1Georgian Technical University sharashenidze.nika@gtu.ge; 2Georgian Technical University https://orcid.org/0000-0002-5837-5345 n.otkhozoria@gtu.ge; 3Georgian Technical University t.menabde@gtu.ge Abstract The article explores the operational principles of a microprocessor distance meter constructed using an ultrasonic sensor module. The schematic model of the level measurement system was developed using the computer simulation program Proteus, facilitating an analysis of the information exchange process. The refined device incorporates calibration and statistical processing of measured information, contributing to the reduction of static errors and minimizing errors induced by random factors. Key words: Ultrasonic, Proteus, Measuring distance Introduction Ultrasonic rangefinders are increasingly employed in robotic devices. Let's delve into the operational principle of a microprocessor rangefinder constructed using an ultrasonic sensor module of the HC- SR04 type, along with the implementation of the corresponding software and hardware. The ultrasonic sensor module comprises two piezoelectric transducers, with one serving as an ultrasonic transmitter and the other as an ultrasonic receiver. Main Part The operating principle is based on measuring the time difference between the ultrasonic signals emitted and reflected from the object, the duration of which is proportional to the distance from the sensor to the object (Fig.1). We know the speed of propagation of ultrasound in air (330-340 m/s) and can calculate the distance to the object: 𝑆 = ∗ , where 𝑉 is - the speed of propagation of ultrasound Georgian Scientists/ქართველი მეცნიერები ტ. 6 N 1, 2024 21 in air, averaging 330-340 m/s, t - the difference in the time interval between the emitted and reflected ultrasonic signals from the object. Figure 1 Ultrasonic principle of distance measurement The measuring range of the distance meter is from 2 cm to 4 m, the frequency of the ultrasonic signal is 40 kHz. Below (Fig. 2) are shown the time diagrams explaining the working principle of the module: Figure 2 Timing diagrams of the operation of the ultrasonic sensor To start the measurement cycle, a positive pulse lasting 10 μSec is supplied to the Trig output, after which the sensor sends a packet of 8 pulses with a frequency of 40 kHz and switches to the mode of receiving the echo signal reflected from the object. A positive pulse is formed on the echo signal generator, the duration of which is directly proportional to the distance from the object to the sensor, which is calculated using the following formula: S (cm) = time (μSec) / 58, where time is the pulse Georgian Scientists/ქართველი მეცნიერები ტ. 6 N 1, 2024 22 duration on the echo signal generator in microseconds, S is the distance to the object in centimeters. The recommended pause between measurement cycles is 60 milliseconds, which is necessary for the complete extinction of the echo signal remaining from previous measurements. Below is the application of the ultrasonic distance sensor built on the PIC16F628A microcontroller: Fig. 3 presents the schematic model of the level measurement system created on the basis of the computer simulation program Proteus, with the help of which the analysis of the information exchange process was carried out. The developed algorithm is written in assembly language. The principle of operation of the device can be described as follows: three blocks are presented. Measuring device Main microcontroller PIC16F873A - U1, seven-segment indicator with four decimal digits, A and B pressure sensor module with equivalent data connection elements. These sensor modules are built on a PIC16F628A microcontroller, contain the same type of elements and are physically located at different points at a distance of several tens and hundreds of meters, which is not reflected in the modeling diagram[1-2]. To initiate the measurement cycle, a positive pulse lasting 10 μSec is applied to the Trig output. Subsequently, the sensor transmits a packet of 8 pulses with a frequency of 40 kHz and transitions to the mode of receiving the echo signal reflected from the object. A positive pulse is generated on the echo signal generator, the duration of which is directly proportional to the distance from the object to the sensor. This distance (S) is calculated using the formula: S (cm) = time (μSec) / 58, where the time represents the pulse duration on the echo signal generator in microseconds, and S is the distance to the object in centimeters. A recommended pause of 60 milliseconds between measurement cycles is advised for the complete extinction of the echo signal lingering from previous measurements. Below, the application of the ultrasonic distance sensor built on the PIC16F628A microcontroller is depicted in Fig. 3. The schematic model of the level measurement system was created using the computer simulation program Proteus, facilitating the analysis of the information exchange process. The developed algorithm is coded in assembly language. The device's operational principle involves three main blocks: the measuring device (Main microcontroller PIC16F873A - U1), a seven-segment indicator with four decimal digits, and A and B pressure sensor modules with equivalent data connection elements. These sensor modules, employing a PIC16F628A microcontroller and containing identical elements, are physically positioned at varying distances of several tens and hundreds of meters, although this spatial arrangement is not represented in the modeling diagram. Georgian Scientists/ქართველი მეცნიერები ტ. 6 N 1, 2024 23 Figure 3 system model The U4 microcontroller and the U5 (U5.C-U5.B) inverter, which consists of the A sensor module, are connected to the RC3, RC4, RC5 and RC6 lines of the PIC16F628A main microcontroller port C. The U2 microcontroller and the U3 (U3.C-U3.B) inverter are connected to the RC0, RC1, RC2 pins of the main microcontroller port C and the RA5 pin of the A port. U2 microcontroller and U3 (U3.C-U3.B) inverter are included in the B sensor module. There are two identical sensor blocks in the system, in which the measured data is stored and converted into a digital format. This data is transferred to the main U1 microcontroller. The sensor block, in turn, consists of a microcontroller, a data transmission circuit and an ultrasonic sensor. Pressure sensors are built from microcontrollers U2 and U4. These sensors are placed in different positions. The main microcontroller U1 is supplied with data of pre-processed parameters and constants, which it processes and displays on a digital indicator. Fig. 4 shows two identical sensor modules placed on different objects. These devices are functionally similar and are connected to each other optoelectronically with the main MCU3 controller, which in turn is built on the basis of the PIC16F873A microcontroller. It is a powerful (200 nanosecond instruction execution) yet easy-to-program (only 35 single-word instructions) microcontroller based on CMOS FLASH and 8-bit microcontroller combines the powerful PIC Georgian Scientists/ქართველი მეცნიერები ტ. 6 N 1, 2024 24 architecture of the microchip in a 28-pin package and is compatible with PIC16C5XXX, PIC12C and PIC16C7X devices. . The PIC16F873A features 128-byte EEPROM data memory, self-program, ICD, 2 comparators, 5 channels of 10-bit analog-to-digital (A/D) converter, synchronous serial port that can be configured as 3-wire serial. All these features make it ideal for solving various tasks easily and efficiently. The developed system consists of the following functional nodes: a power supply unit with several isolated 5-volt CD/DC converters, digital indicators, two independent data transmission channels built on optically isolated optocouplers. Figure 4 Functional scheme of the level measuring system The power supply unit of the main microcontroller is built on a voltage regulator (type 7805CV), with a stable output voltage of 5V, which is connected to an AC/DC adapter, the output constant voltage range of the adapter is 15V. - 9 v. (0.5a.). The supply voltage of the microcontroller is supplied to the data transmission channels by means of isolated transformers. This ensures galvanic isolation of the data exchange channels, and as a result, the sensor modules will be provided with a power source. Capacitors C1 and C2 and quartz resonator ZQ1 are connected to the main microcontroller to generate clock pulses. This ensures a stable clock frequency of the microcontroller. Georgian Scientists/ქართველი მეცნიერები ტ. 6 N 1, 2024 25 The presented device includes calibration and statistical processing of measured information. Both methods help to reduce static errors and minimize errors caused by random factors [3]. References 1. Ashraf AlMadhoun Development Environment for PIC Microcontroller: Proteus and MikroC Step By Step: You will learn the most widely used Software to Program and Simulate PIC Microcontroller in the Embedded Systems, Independently published (April 6, 2020). 2. Nona Otkhozoria, Vano Otkhozoria, & Shorena Khorava. (2022). Search for an extremum using the steepest descent method under the conditions of experimental errors. World Science, (2(74). https://doi.org/10.31435/rsglobal_ws/28022022/7785 3. Z Azmaiparashvili, N Otkhozoria (2021) “Mathematical Model for Studying the Accuracy Characteristics of Devices for Measuring the Resonant Frequency of Oscillatory Systems New Approaches in Engineering Research” 121-131 https://doi.org/10.9734/bpi/naer/v5/10242D. ულტრაბგერითი მანძილმზომი და სისტემის სიმულაცია ნიკა შარაშენიძე, ნონა ოთხოზორია, თამარ მენაბდე საქართველოს ტექნიკური უნივერსიტეტი სტატიაში განხილულია ულტრაბგერითი სენსორული მოდულის ბაზაზე აგებული მიკროპროცესორული მანძილმზომის მოქმედების პრინციპი, კომპიუტერული სიმულაციური პროგრამის პროტეუსის ბაზაზე შექმნილია დონის საზომი სისტემის სქემატური მოდელი, რომლის დახმარებითაც ჩატარებულია ინფორმაციის მიმოცვლის პროცესის ანალიზი. დამუშავებულ მოწყობილობაში გათვალისწინებულია დაკალიბრება და გაზომილი ინფორმაციის სტატისტიკური დამუშავება, რაც ხელს უწყობს სტატიკური ცდომილების შემცირებას და შემთხვევითი ფაქტორებით გამოწვეული ცდომილებების მინიმიზაციას. საკვანძო სიტყვები: მანძილმზომი, ულტრაბგერა, პროტეუსი