Light Tracking Gimbal
Preface Based on my previous project ( Joystick Control Gimbal ), I slightly modified it into a Light Tracking device. It took me about two days to fine-tune the Light Tracking Gimbal to move smoothly and hold its position while light source is not moving. Goal of this tutorial Let's see the video below to see what's the final result of this tutorial. Gimbal Panel Area There are Top Left, Top Right, Bottom Left, and Bottom Right. In each area, there is a light sensor. Programming Logic: Get reading from 4 photo sensors I sample each sensor 10 times and then get the average value to ensure the readings are more stable Get average of each side Top side value = (Top left + Top right) / 2 Bottom side value = (Bottom left + Bottom right) / 2 Left side value = (Top left + Bottom left ) / 2 Right side value = (Top right + Bottom right ) / 2 Compare all four sides to see which side has bigger value Move the servo towards the big