Accurately estimating the number of people is a useful information to monitor the occupancy level of spaces due to the COVID-19 pandemic in order to keep social distancing. Automated counters are responsible for accurately counting people movement. This paper proposes a cost-effective automatic counting system based on a microcontroller through an infrared sensor integration to monitor occupancy of indoor spaces. In order to evaluate the proposed system in real-world scenarios, experiments were carried out at the main campus of the University of Campinas—Brazil. For the first case, two prototypes were installed at both the front and rear door of a bus in order to count the number of passengers boarding and alighting on the vehicle during its operation. In the second case, three prototypes were installed in the university restaurant ticket gates in order to count the number of people entering during lunchtime. Experimental results showed an accuracy of 91.45% and 98.65% for Cases 1 and 2, respectively. The results are promising, showing that the device has potential to be used for different proposes, such as controlling access to public and indoor spaces, public transportation planning, occupancy monitoring, and security system.