Smart Gate: a Modular System for Occupancy and Environmental Monitoring of Spaces