On April 15, 2020, Indonesia confirmed that there were 4,839 cases of COVID-19 transmission, there was a mortality percentage of 9.5% (459 people), PDP under treatment as many as 3,954 people, with 426 patients who recovered. Often there is excess capacity in public spaces because it is very difficult to limit users. Public spaces must have a system that can support these restrictive activities. The system must be able to detect visitors coming in and out of the area which will then calculate the number of people and set restrictions on the number of visitors using a solenoid door. The solenoid door will be set so that it can automatically lock when the public room is at maximum capacity. Current technology makes it possible to classify digital images. The image classification algorithm that can be used is Naive Bayes. Naive Bayes classifies based on promentality and Bayesian theorem which assumes that each variable is independent. The system is able to detect users both entering and leaving the room. The results show that the monitoring system can be displayed on a GUI with readings from the camera and ultrasonic sensors.