Tracking Ball with Arduino Sensor

Hi, I‘m searching for a solution to control Servo motor by movements of head to left and right. Or by tracking an component like a Ball.

some source of inspiration using a MPU