AbstractSmart homes, live streaming IoT devices, and smart sensors can all be optimised to enhance energy efficiency. In order to offer a cheap alternative to the traditional real-time monitoring systems, this study proposes a sensor-based occupancy system. The evaluation in real time of the number of occupants in buildings/ rooms /houses is reflected in the energy usage. Sensor data can provide insight into many characteristics of a considered environment. The sensor dataset considered was collected with the aim of determining how many people are present in a given space/room. The sensor data does not portray the people present in the room, but rather their impact on it (e.g. CO2/ noise/ light level changes). The dataset was cleaned and preprocessed to optimise model performance. The results obtained by training several classifiers yielded accuracies that reach 98%-99%. The research provides an end-to-end solution for the considered problem, through data preprocessing/feature selection/outlier removal and model training/evaluation. Hyperparameters were tuned for more than twenty models. All chosen models and features were ranked based on performance and robustness. A novel solution for optimising sensor placement has also been proposed by this study, to further improve sensor-based monitoring systems.