https://www.summet.com/blog/2019/03/0...
This is a simple mechatronic system that activates a servo when motion is detected or every X seconds when no motion is detected. Software programmable servo motion limits, delay time, active time, etc are all handled via a simple Arduino sketch.