## 2 Materials and Methods
### Low-Cost Distance Sensor  
HC-SR04 is a low-cost distance sensor based on the sonar concept methodology with a distance measuring range of 20 to 4000 mm and a resolution of 3 mm. The Arduino interactswith this sensor by digital pin, which is connected to the transmitter and the receiver. For the initiation, the Arduino sends a voltage pulse to the pin, which changes the digital pin from a low to high situation for a moment. This change sends a signal wave through the ultrasonic transmitter. As soon as the signal is sent, the pin status returns to low. When the transmitted signal bounces off of the targeted object toward the sensor's ultrasonic receiver, the receiver sends a voltage pulse to the digital pin, making it high again. The Arduino estimates the location of the targeted object by multiplying the interval time of the elevated pin by the speed of the sound. Since sound speed depends on ambient temperature and humidity, these data should also be estimated in every ultrasonic distance estimation. When the environmental temperature increases, the kinetic energy of air molecules and the sound velocity increase as well. Sound velocity also has a direct relation to humidity.  
To estimate the sound velocity, the temperature and humidity were measured by DHT22. The sound speed is calculated from Equation (1) [54].  
\[\text{Sound }-\text{ velocity }=331.4+(0.606\times\text{temperature})+(0.0124 \times\text{humidity}) \tag{1}\]  
where sound \(-\) velocity and temperature are measured in m/s and degrees Celsius, respectively. Humidity is given in relative terms (%) and shows the ratio of water vapor in the air at a given temperature. Figure 4 shows the ultrasonic, temperature, and humidity sensors.  
Two of the most widely recognized ToF sensors (VL53L0X and VL53L1X) have been used in this project. These sensors have a distance measuring range of 2 and 4 m, respectively, with a 1 mm resolution. VL53L0X and VL53L1X communicate with the Arduino through an I2C communication port. This communication port consists of a Serial Clock Line (SCL) and a Serial Data Line (SDA) pin, which can be connected to various digital sensors (those which have SCL and SDA pins) simultaneously as long as the connected sensors have different addresses. There are two different connection ways to connect a number of ToF sensors to a microcontroller: (1) by default address changing [25] or (2) through a multiplexor. Default address changing with VL53L0X and VL53L1X circuits involves using a few lines of code to change their default addresses to other addresses [50;55]  
Figure 4: The used low-cost sensors of the project: HC-SR04 (ultrasonic sensor), DHT22 (temperature and humidity sensor for calibrating the ultrasonic sensor), TCA9548A (multiplexor), VL53L0X (ToF sensor), and VL53L1X (ToF sensor).  
(TCA9548a). A multiplexor connects the sensors with the same address to Arduino. Up to 64 similar sensors can be introduced to the Arduino [56]. Although the first methodology seems more accessible and cheaper, it is not as reliable or stable as the second method. Moreover, if a ToF sensor in the first method gets damaged, burned, disconnected, or stops working for any reason, the whole system stops working until the problem is solved or the burned sensor is replaced. To improve reliability, this research connected the I2C sensors to the microcontrollers through a multiplexor.