Hello Arduino community! I’m new here and not sure if this is the right place to ask, but this is my first time working with the ESP32 or any IoT-based projects, and I have a question.
For my capstone project, I’m planning to use an ESP32 and I’m wondering about the feasibility of implementing geofencing for a hybrid Queue Management System. In this system, users go to a physical kiosk to get a ticket, and that ticket contains a QR code they can use to track their queue digitally through a web app.
Essentially, I want the ESP32 to act as a beacon so the web app can detect it and send a signal to the server indicating that “this user is within the service area.”
Would this approach work, or is there a better way to achieve proximity detection using ESP32?
The ESP32 does have the ability to send data packets (ESP32NOW) as if it were a beacon and you can measure the received signal strength with another ESP32.
However there are significant issues with using this as a location method as the received signal strength will vary significantly depending on the objects between the phone and receiver. If these objects, such as people, are moving around the problem is even worse.
I also considered using GPS, but it doesn’t work reliably indoors. My main goal is to prevent a person from wandering too far from the service area, which is why a beacon-based solution is more suitable
Many ESP32 boards come with Bluetooth/WiFi and an on board chip antenna, Bluetooth LE range is between 3 and 10 m, depending on a variety of circumstances.
Experiment with a pair to learn about the difficulties of distance estimation and position determination by radio indoors, before making further plans.
As for the target area, I checked it again this morning and found that it is a roughly 25 meters × 20 meters indoor space—a little bigger than I originally thought. It is divided into sections, following this sequence: an indoor waiting area at the center, followed by wooden panel walls separating the office teller section, and reinforced concrete walls at the back that connect to an outdoor student lounge. Please ignore the measurements in the image, as they were not taken accurately but it is what it looks like.
I’m considering placing both the BLE beacon and the kiosk in the hallway corridor. The BLE component would function as a geofencing layer, using RSSI (Received Signal Strength Indicator) to estimate proximity and provide spatial context. This allows staff to monitor whether students are near the designated service area and not just abuse the digital queue monitoring.
If range becomes an issue, I’m considering deploying an additional ESP32 beacon to extend coverage, since everything is connected to a web application.
Very familiar with that construction. I once worked at a computer service bureau with Burroughs main frame computer. They rented space in a pharmaceutical warehouse. Very, very secure. The company wanted to run a local area network using coaxial cable, but could not find a way to get the cable out of the computer room since it was solid concrete walls and floors. I raised a panel in the ceiling and next day came to work with a star drill and a hammer. Put a hole through one of the concrete blocks in a minute and there went the coax cable. Not secure at all! So, if you need to pass a cable from room to room, it is really easy to make a hole!
If the transmitter is handheld, say like a mobile phone, then objects in the path to the beacon can have a major impact on the indicated RSSI.
If someone is for instance holding the transmitter like a mobile phone and facing the beacon from say 6M away and then turns around so their back is to the beacon, their body screens the signal and the beacon may see the RSSI drop by 10dbm to 15dBm at 2.4Ghz.
A drop in RSSI of 15dBm would lead the beacon to assume the person has now moved to 36M away when all they have done is turned around, or some other people have moved into the path.
The indicated 10dbm to 15dBm drop is based on practical tests.
I’ve also taken that into consideration and found a few potential solutions. Since you can’t stop people from being made of water, the issue needs to be handled within my web app logic.
One approach is RSSI smoothing using a moving median instead of a simple average, since a median filter helps ignore outlier spikes caused by someone walking past the beacon.
I can also apply weighted averages, where more weight is given to the strongest signals received over the last few seconds—for example, if the signal was -65 dBm a second ago and suddenly drops to -80 dBm, the system can assume the user is still near but temporarily “shadowed.”
Another method is adding hysteresis, where “Out of Range” is not triggered immediately but only after the signal stays weak for a consistent period (around 3–5 seconds), reducing false triggers from quick movements.
Using multiple beacons is another option, since having two ESP32s makes it harder for the human body to block both signals at the same time, allowing the system to rely on the strongest available signal.
Additionally, I’m considering limiting how far the BLE signal can travel by adjusting the transmit power so it primarily covers the intended area. This helps establish a coarse boundary for the system, but it will still be combined with filtering techniques like RSSI smoothing and hysteresis to avoid false “out of range” detections. This is likely the approach I’ll be choosing for now.
I would also be open to further suggestions or improvements on this approach.