1. Introduction
Indoor positioning and monitoring system have become crucial for the industries that need to monitor workers in large environments such as warehouses, factories, and construction sites. GPS technologies are ineffective in indoor locations due to signal attenuation and multipath effects by the walls, ceilings, and metallic structures [
1]. Further more multipath reflections and signal blockages severely affect GPS accuracy, making it unreliable for critical indoor applications [
2]. So the wireless methods used to locate the indoor localization in real-time are ultra-wideband, wi-fi fingerprinting, and Bluetooth low energy RSSI based, those methods are used for indoor position monitoring in real-time. Bluetooth Low Energy with RSSI are offers a promising alternative for indoor positioning and Monitoring systems due to its very low energy consumption, hardware availability, and ease of deployment with existing devices [
3]. Bluetooth system based indoor positioning uses Received Signal Strength Indicator (RSSI) measurements to estimate distances by using the RSSI to Distance calculation Formula, RSSI values are noisy and highly sensitive to environmental interference [
4]. Without appropriate filtering techniques, raw RSSI data can result in significant positioning errors [
5]. To identify these challenges, our project proposes a BLE-based IPS using ESP32 modules that perform periodic BLE scans and Measure the Targeted devices to collect RSSI data. The collected data is filtered using Kalman filters to reduce noise and improve distance estimation [
6]. ESP32 devices communicate securely with a Local server over an encrypted UDP protocol. The server processes incoming data, decrypts it, applies filtering, estimates distances through a log-distance path loss model, and calculates the two-dimensional position of a target using a least-squares trilateration algorithm [
7].This Project provides the cost effectiveness, Largescalability, and real-time monitoring, making the ideal for indoor industrial applications. This Project compared to another Methode like Ultra-Wideband (UWB) systems, which are costly and require specialized hardwires for Implementation [
8], BLE provides a lightweight, accessible solution. Moreover, secure communication and filtering techniques make the Project system robust against noise and packet loss, ensuring reliable asset tracking Methode and enhancing safety in healthcare and logistics environments [
9].
2. Related Works
García et al. developed the project in a robust UWB-based indoor positioning system for complex industrial environments to find the indoor position, using methods such as multi-sensor data fusion, sequential Monte Carlo filters, and multipath mitigation for focusing on antenna placement and signal processing for better performance even in highly metallic areas [
10].Mazuelas et al. gave a fresh approach to real-time RSSI measurements, WLAN fingerprinting, and Bayesian estimation for real time indoor positioning systems enhancing strength without modifying Wi-Fi infrastructure [
11]. Sadowski and Spachos developed an IoT-based indoor position system using the RSSI fingerprinting method, applying Kalman filtering for the RSSI, and indoor localization with Wi-Fi and Bluetooth technologies to improve strength in vibrant industrial environments [
12]. Tinh and Mai developed a mobile indoor positioning system model by integrating Wi-Fi RSSI with smartphone motion sensor data like Pedometer sensors, and then applying Kalman filters for motion-aided position refinement on smartphones [
13]. Benaissa et al. estimated the Bluetooth Low energy signal reception for indoor localization and monitoring with different receiver and beacon placements, finding that antenna the height and angle dramatically affect localization precision in the indoor position system [
14]. Nandika et al. developed a project about the BLE-based indoor monitoring system tailored for elderly patients, showing real-time patient tracking using lightweight wearable devices with cheap infrastructure [
15]. Tandiawan et al. proposed an RSSI-based indoor-to-outdoor positioning system integrating Extended Kalman Filter, Double-Difference Correction (DDC
), algorithms, reducing noise in RSSI readings and improving transition tracking between indoor and outdoor spaces using the RSSI-based path loss modelling [
16]. Schroeer developed a real-time UWB multi-channel positioning system emphasizing multi-channel synchronization, position estimation algorithms, and TDOA measurement optimization for optimizing the system for harsh industrial scenarios by improving synchronization among devices and channels [
17]. Li et al. proposed a Bluetooth/PDR integration algorithm for indoor positioning, using PDR (Pedestrian Dead Reckoning) combined with BLE RSSI Kalman smoothing to overcome signal instability issues inside complex indoor layouts in smartphone-based localization [
18]. Kalbandhe and Patil introduced an indoor positioning approach based on Bluetooth Low Energy leveraging signal strength mapping, RSSI-distance calibration, and strategies scalable architecture ideal for mobile-based navigation inside multi-story buildings with low cost and easy-to-develop with hardware [
19].
3. Methodology
This Methodology, we explain the proposed method of our project, as shown in
Figure 1.
The block diagram outlines the Indoor Positioning System using three ESP32 devices as BLE receivers, one ESP32 as a tag, and a local server. The tag continuously broadcasts BLE signals, which are received by the fixed ESP32s and sent data to the server via UDP. The server applies a Kalman filter to smooth the RSSI values, estimates distances using a log-distance path loss model, and calculates the tag’s position through trilateration. Also, the system has Real-time visualizations of device status, RSSI trends, distance estimation, and the indoor layout to help ensure accurate and efficient tracking.
3.1. Communication Framework
To develop the communication framework, three ESP32 modules were programmed to connect via Wi-Fi and communicate with a local UDP server. The ESP32 Devices use AES-128 encryption and SHA-256 hashing to implement authentication procedures for secure data transfer. The server provides a unique SESSION_TOKEN to authenticated users during successful verification sessions so all subsequent data transmission does not require repeated authentication procedures.
3.2. Ble Scanning and Data Acquisition
For BLE scanning and RSSI data acquisition, each ESP32 module waits for a scan command from the server before starting the Bluetooth Low Energy (BLE) scan. The ESP32 initiates the scan upon receiving this command from the server. To optimize power consumption and reduce unnecessary network traffic, the scanning process is event-driven, rather than continuous, and is activated only by the server command. Once the target device (identified by its MAC address) is detected, the ESP32 collects five RSSI samples, averages them, and transmits the result to the server using AES-128 encryption. The server sends an ACK if the data is successfully received from the ESP32. If the server does not acknowledge the transmission (no ACK), the ESP32 attempts to resend the data once.
3.3. Data Processing
To process the received data, the server first timestamps incoming packets using NTP synchronization and decrypts the data. The time synchronization using NTP synchronizes RSSI data from multiple ESP32 receivers within the same scan cycle, improving the trilateration technique accuracy. After decryption, the Kalman filter is applied to smooth and stabilize the RSSI values for each receiver individually. The filter is initialized with a state. x₀ = 0, state transition F = 1, measurement matrix H = 1, initial covariance P₀ = 1000, measurement noise R = 15, and process noise Q = 2.0. This filtering technique significantly enhances the reliability of the RSSI values before they are used for further distance estimation or localization calculations. The filter operates in two main steps: Prediction and Update.
Prediction: The prediction step estimates the current state based on the previous state and the process model.
Error Covariance Prediction:
Update: The update step refines the predicted state by incorporating new measurements.
3.4. Distances Calculation
To estimate distances from RSSI values, the server applies the log-distance path-loss model individually for each receiver. This model is used to estimate the distance between the target device and the receivers based on the received RSSI values, considering signal attenuation over distance with a logarithmic relationship. The model uses the path-loss exponent n=2.89 and a reference RSSI value dBmref = -58.5. The method retrieves relative distances from receivers by converting filtered RSSI through defined path-loss parameters.
The distance is calculated using the
log-distance path loss model:
3.5. Trilateration
To calculate the target’s position, trilateration is performed using distance estimates obtained from three fixed receivers placed at known coordinates: Receiver 1 (1.20, 0.00 meters), Receiver 2 (8.70, 0.00 meters), and Receiver 3 (5.80, 6.70 meters). Trilateration determines the target’s (x, y) position by solving the equations.
where (x
i, y
i) are the known coordinates of each receiver, and d
i are the estimated distances from the receivers to the target. The intersection point of the three circles represents the target’s estimated location. Accurate distance estimations are crucial for minimizing positional errors and achieving precise localization.
To solve the trilateration cost function, the server uses SciPy’s Least Squares optimization method. This method adjusts the target’s (x, y) position to minimize the difference between the measured and calculated distances. By repeating this process, it finds the best-fit position that matches all three distance estimates, improving the accuracy of localization.
Cost function that the optimization minimizes is:
Figure 2 shows a typical trilateration setup, where three receivers are placed at known coordinates, and the target’s location is derived from the intersection of the three circles.
3.6. Data Monitoring and Dashboard
To monitor the system status in real-time, two visualization methods were developed. The real-time plotting of RSSI values, distance trends and estimated positions is handled via Matplotlib. At the same time, a terminal-based dashboard built with Curses provides displays including ESP32 connection status together with the last heartbeat time and RSSI reading as well as last scan duration and error count through color indicators.
4. Results and Discussions
4.1. Kalman Filter Distance Estimation Test Report
In
Section 4.1, we estimate how a Kalman filter enhances RSSI-based distance estimation by first adjusting the path loss exponent (n = 2.89), reference RSSI at 1 m (–58.5 dBm), and Kalman noise parameters (R = 15, Q = 2.0), then converting the filtered RSSI into distances and comparing them with true distances from 1 m to 7 m (
Table 1), which reveals a markedly smaller estimation gap. Following error analysis (MSE, percentage error in
Table 2) shows reduced absolute and squared errors across all ranges, and overall statistics improve dramatically—Mean Absolute Error (MAE) falls from 1.769 meters to 0.265 meters, Root Mean Square Error (RMSE) decreases from 1.954 meters to 0.311 meters, and Mean Squared Error (MSE) reduces from 3.820 to 0.097—lowering the average error rate from 47.66% to 7.12%, thereby ensuring the Kalman filter’s effectiveness in producing more accurate and reliable indoor distance estimates.
Raw vs. Kalman-Filtered RSSI and Distance: As shown in
Figure 3 and
Figure 4, raw RSSI (red) fluctuates heavily and yields larger deviations from the ideal distance (dashed line), whereas Kalman-filtered values (green) track the ideal much more closely, confirming the filter’s effectiveness.
4.2. RSSI Signal Stability Analysis
RSSI values collected from Receiver_1, Receiver_2, and Receiver_3 were subject to fluctuations due to environmental factors. A Kalman filter was applied to smooth the raw data, enhancing the signal stability. The real-time comparison between raw and filtered RSSI values is shown in
Figure 5.
4.3. Distance Estimation from Filtered RSSI
Using the filtered RSSI values, the distance between each receiver and the target BLE device was estimated using the log-distance path loss model. The distances were continuously updated in real time, with variations displayed for each receiver over time. These real-time distance estimations are illustrated in
Figure 6.
4.4. Target Localization Through Trilateration
The target BLE device’s position was estimated in real-time using trilateration, employing distance estimates from Receiver_1, Receiver_2, and Receiver_3. The intersections of distance-based circles determined the location of the device. The indoor layout, receiver positions, and the estimated target location are shown in
Figure 7.
4.5. Real-Time Monitoring Dashboard
A real-time dashboard was built using the Python curses library to monitor the ESP32 receivers during BLE scanning and data transmission. It shows live updates such as ESP32 ID, RSSI values, session status, and heartbeat timestamps. Color indicators for device status (ONLINE, UNSTABLE, OFFLINE) help quickly identify issues, as shown in
Figure 8.
4.6. Discussion
The ESP32-based indoor positioning system was tested with fixed and moving BLE devices. The implementation of Kalman filtering made RSSI signals more stable which enabled distance measurements under 1.2 meters accuracy. The use of SciPy least squares method in trilateration yielded exact 2D location determinations. Time-sensitive UDP communications along with heartbeats operated in real-time to provide reliable ongoing operation with zero packet loss.
6. Conclusions
This project successfully developed an ESP32-based Indoor Positioning and Monitoring System using BLE RSSI and UDP. By integrating BLE scanning, Kalman filtering, and UDP communication, the system achieved accurate and real-time RSSI data collection and processing. Distance estimation was refined using the log-distance path loss model, and the target’s location was calculated through trilateration. Real-time monitoring with a curses-based dashboard and Matplotlib plots gave clear visibility of device status and performance. Secure communication was ensured through authentication protocols, AES encryption, and heartbeat mechanisms, maintaining continuous and reliable device-server connections. The system effectively used ESP32’s Wi-Fi and BLE features, offering a scalable and flexible solution for indoor positioning. Despite challenges like signal fluctuations, noise, and packet loss, the application of filtering techniques and session management greatly improved system robustness. This work demonstrates that low-cost and real-time indoor localization is achievable even in complex indoor spaces.
Future improvements could include adaptive filtering and machine learning to boost RSSI stability and distance accuracy. Adding more receivers and using multilateration would help scale the system for larger or multi-floor areas. Enhancing UDP communication with hybrid protocols and developing a better graphical interface would improve usability. Extensive real-world testing will help fine-tune system settings, making the solution more robust for smart indoor positioning applications.
References
- Mautz, R. (2009). Overview of current indoor positioning systems. Geodezija ir kartografija, 35(1), 18-22. [CrossRef]
- Mautz, R. (2012). Indoor positioning technologies. ETH Zurich. [CrossRef]
- Benaissa, B., Hendrichovsky, F., As, M., & Yoshida, K. (2025). BLE Signal Reception and Localization Performance with Varying Receiver and Beacon Setups. Future Internet, 17(2), 54. [CrossRef]
- Sadowski, S., & Spachos, P. (2018). Rssi-based indoor localization with the internet of things. IEEE access, 6, 30149-30161. [CrossRef]
- Le Dortz, N., Gain, F., & Zetterberg, P. (2012, March). WiFi fingerprint indoor positioning system using probability distribution comparison. In 2012 IEEE international conference on acoustics, speech and signal processing (ICASSP) (pp. 2301-2304). IEEE. [CrossRef]
- Csík, D., Odry, Á., Pesti, R., & Sarcevic, P. (2024). Impact of Antenna Orientation on Localization Accuracy Using RSSI-based Trilateration. Analecta Technica Szegedinensia, 18(2), 22-29. [CrossRef]
- Mazuelas, S., Bahillo, A., Lorenzo, R. M., Fernandez, P., Lago, F. A., Garcia, E., ... & Abril, E. J. (2009). Robust indoor positioning provided by real-time RSSI values in unmodified WLAN networks. IEEE Journal of selected topics in signal processing, 3(5), 821-831. [CrossRef]
- Mazhar, F., Khan, M. G., & Sällberg, B. (2017). Precise indoor positioning using UWB: A review of methods, algorithms and implementations. Wireless Personal Communications, 97(3), 4467-4491. [CrossRef]
- Ammar, O. A., Farouk, M. H., Abdelghani, A. A., Ahmed, Y. M., Mohamed, Y. S., & Anis, A. M. In-Vehicle Localization System for BLE Enabled Devices. International Journal of Computer Applications, 975, 8887. [CrossRef]
- García, E., Poudereux, P., Hernández, Á., Ureña, J., & Gualda, D. (2015, March). A robust UWB indoor positioning system for highly complex environments. In 2015 IEEE International Conference on Industrial Technology (ICIT) (pp. 3386-3391). IEEE. [CrossRef]
- Mazuelas, S., Bahillo, A., Lorenzo, R. M., Fernandez, P., Lago, F. A., Garcia, E., ... & Abril, E. J. (2009). Robust indoor positioning provided by real-time RSSI values in unmodified WLAN networks. IEEE Journal of selected topics in signal processing, 3(5), 821-831. [CrossRef]
- Sadowski, S., & Spachos, P. (2018). Rssi-based indoor localization with the internet of things. IEEE access, 6, 30149-30161. [CrossRef]
- Tinh, P. D., & Mai, T. T. N. (2020, August). Mobile indoor positioning system utilizing wifi rssi and motion data. In 2020 4th International Conference on Recent Advances in Signal Processing, Telecommunications & Computing (SigTelCom) (pp. 98-102). IEEE. [CrossRef]
- Benaissa, B., Hendrichovsky, F., As, M., & Yoshida, K. (2025). BLE Signal Reception and Localization Performance with Varying Receiver and Beacon Setups. Future Internet, 17(2), 54. [CrossRef]
- Nandika, R., Hidayat, A., Nasution, A., & Putra, A. (2024). Implementation of Indoor Positioning System for Monitoring Geriatric Syndrome Patients Based on Bluetooth Low Energy. JECCOM: International Journal of Electronics Engineering and Applied Science, 2(2), 68-76. [CrossRef]
- Tandiawan, R., Wibowo, S., & Ainul, R. D. (2024). An Indoor to Outdoor RSSI Based Positioning System Using EKF with Different Distance Correction Algorithm. Journal of Communications, 19(8), 365-374.
- Schroeer, G. (2018, September). A real-time UWB multi-channel indoor positioning system for industrial scenarios. In 2018 International Conference on Indoor Positioning and Indoor Navigation (IPIN) (pp. 1-5). IEEE.
- Li, X., Wang, J., & Liu, C. (2015). A Bluetooth/PDR integration algorithm for an indoor positioning system. Sensors, 15(10), 24862-24885. [CrossRef]
- Kalbandhe, A. A., & Patil, S. C. (2016, December). Indoor positioning system using bluetooth low energy. In 2016 International Conference on Computing, Analytics and Security Trends (CAST) (pp. 451-455). IEEE. [CrossRef]
|
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).