The subject of this project is to make a system that measures how many people are in the room. The ESP32 microcontroller card will observe the bluetooth signals in the room and record the data coming from the bluetooth devices to its system and try to determine how many bluetooth signal generating devices are in the room. Since the devices producing the Bluetooth signal will be above the people, the number of people in the room will also be measured. This project was conceived to prevent the spread of the recently emerged COVID-19 virus.
The steps can be listed as follows:
- Activate the IDLE Screen.
- Connect to the Internet.
- Activate the tracking screen.
- Start the Bluetooth scan.
- Increase the counter when the device enters the room.
- Decrease the counter when the device leaves the room.
- Activate the alarm screen when the counter reaches the maximum capacity value.
- Activate the buzzer.
- Switch to the tracking screen when the device leaves the room.
- Decrease the counter.
- Turn off the buzzer.
The steps can be listed as follows:
- When the beacon is detected, initialize it.
- Compare the RSSI value from the beacon with the value from the internet, if the system decides that the beacon is inside the room, assign it to the input status.
- Compare the RSSI value from the beacon with the value from the internet, if the system decides that the beacon is outside the room, assign it to the output status.
In order for the system to understand the exit from the room faster, a weighted moving average filter is used instead of the normal filter. In this way, the calculation was made in such a way that the weight of the latest data received was the highest, and the response speed of the system against possible situations was increased.
The capacity control system can be controlled remotely regarding to the data it receives from the internet. It can provide room control according to different room size and capacity management needs. There are two different types of data it receives from the Internet. This data is reached under two headings. These topics can be explained as follows:
Maximum device data is the data that takes a value between [1,5] and tells how many beacons the system should give an alarm when it detects in the room.
The range data takes a value between [-50, -100] and compares the signal from the beacon with its own data and allows the system to decide whether the beacon is in the room or not.
The Capacity Control System project has been successfully completed as a system that can monitor RSSI-based devices in the room in real time, can be controlled via the website or mobile application, and can give an alarm when the maximum human capacity is reached in the room. In order to realize these, Bluetooth and WiFi modules of the ESP32 microcontroller card were used. Since it has different tasks from each other, task division has been made on the system by using the FreeRTOS operating system, code readability and the speed of executing commands of the device have been increased. By using a weighted average filter on RSSI signals, the noise on the signal is reduced and the device is able to make more accurate decisions about room tracking. Finally, on the internet connection side, the device can be controlled over the internet with the MQTT Broker provided by Ubidots.