Yes, a twilight sensor is designed for this purpose. However, it’s important to consider the maximum signal range, which is 160 meters in free space.