# Simple Ultrasonic-Based Localization System for Mobile Robots
## 3 System Design  
There are several ultrasonic localization systems (ULS) that achieve high accuracy but are more complex, expensive, or difficult to apply. The goal was to design a real-time and simple, easy to apply, and cost-effective ultrasonic localization system (ULS) for indoor spaces, especially warehouses with tall furniture and narrow corridors. The basic principle is based on sending ultrasonic waves from a transmitter (Beacon) to a receiver (Tag) and measuring the distance between them by determining the time it takes for the ultrasonic signal to travel this distance. The system designed in this way is capable of measuring the relatively precise distance between the beacon and the tag. In the case of placing at least three beacons somewhere on the ceiling, it is possible to determine the 3D coordinates of the tag using trilateration calculations. Since it is a system intended to be inexpensive and not hardware-intensive, and multilateration would increase the number of beacons on the ceiling surface, trilateration is being considered. With multilateration, beacons would need to be closer to each other due to the weakening of the ultrasound signal outside the transmitter beam angle (loss greater than \(-\)10 dB). The proposed method of beacon placement, unlike most similar systems, consists of deploying multiple triangular patterns of beacons on the ceiling (see Figure 1). By creating triangular patterns, it is possible to fill the entire operational space of the mobile robot in the room. An advantage compared to most similar systems is better coverage of the space with ultrasonic waves. Warehouses typically have tall furniture (shelves) and narrow aisles. Furniture then obstructs the direct propagation of ultrasonic waves from the beacons to the tag, which is located on the robot. The proposed method of distributing triangular patterns of beacons is more demanding in terms of the number of beacons, but the beacons have only one transducer (unlike, for example, [23], where there are up to five transducers). This results in an beacon power consumption below 20 mA, which ensures trouble-free operation for at least 20 days using, for example, a 3S LiPo battery pack with a capacity of 1 Ah. Of course, the operating interval can be significantly extended by optimizing the processor's operation during downtime or when the mobile robot is not working. These energy-independent beacons from central electrical power can be placed on the ceiling without additional wiring. The block diagram of the beacon and tag is shown in Figure 2.  
The tag must be capable of communicating and triggering the transmission of ultrasonic waves from the beacons at the most precise timing for synchronization. Communication is facilitated by the nRF24L01 module, which can be configured to ensure direct and clearly defined communication, where we can rely on known delays to minimally impact the resulting measurement (1 mm travels ultrasonic waves in less than 3 us under normal conditions). Control and data transmission settings are at a level where almost the entire data transmission is managed with the lowest possible delay interval and without any communication retries in case of data loss. In the event of data loss, the consciously controlling and computational microcontroller ensures communication retries. The STM32F303 microcontroller has been used for this purpose. The distance measurement process from  
Figure 1: The layout of the basic tag pattern relative to the room dimensions. Figure 2: Ultrasound measurement principle. the beacon to the tag proceeds as follows: The beacon always dictates the basic clock. It also determines which of the tags should send the ultrasonic signal. Therefore, synchronization is ensured using this principle. Now the RF signal is transmitted via the nRF module and the assumed delay for transmission and processing of the signal by the beacon, a timer for measurement is triggered in the tag.