If lights turn off when you walk by, it is likely due to a motion sensor or occupancy sensor installed in the area. These sensors are designed to detect movement and activate or deactivate lights accordingly. When you walk within the sensor's range, it senses your motion and triggers the lights to turn on. However, if you don't continue moving or if you move out of the sensor's range, it may interpret the lack of motion as a signal to turn the lights off again.
Motion sensors work by using various technologies such as infrared, ultrasonic waves, or microwave signals to detect changes in the environment. When you pass by the sensor, it detects the disturbance in its field and sends a signal to control the lights accordingly.
This technology is commonly used in areas where energy efficiency and convenience are important, such as hallways, stairwells, bathrooms, or outdoor spaces. It helps to save electricity by automatically turning off lights when they are not needed.
If you frequently experience lights turning off when you walk by, it's most likely due to the presence of motion sensors in those areas.