History
My previous project was serious and complex: a programmable wireless thermostat. Thanks to you, it has been viewed more than 3000 times on the Project Hub, and I am very grateful to you.
My goal now is to exceed 5000 views. So I had to imagine a project that would be funnier, more original, simpler and easier to replicate than the thermostat. And totally useless.
So I decided to make this pair of eyes that follows the movements of an object that moves in front of it. It follows the lateral movements, and the eyes converge when the object comes closer.
And if you're reading this, you clicked. This is great for my goal and I thank you for it.
The project




The two eyes are painted on two ping-pong balls which are sticked on two servo motors. Two ultrasonic sensors measure the object's position. An Arduino Nano Every board reads the measurements from the ultrasonic sensors and controls the sevo motors accordingly.
The servo motors are SG90 micro servos and the ultrasonic sensors are HC-SR04. These are very common and very inexpensive devices. The Arduino board may be of another model than the nano Every, provided that 5V is available to power the servo motors and the ultrasonic sensors.
Hardware


The servo motors and ultrasonic sensors are sticked on a plate according to the arrangement shown on the following plan:

The position of the X ultrasonic sensor can be different, for example to follow larger objects. In this case, the constants A and B must be adjusted in the software to reflect the actual position of the X ultrasonic sensor. These two values must be less than 200 cm.
The connections to be made are as follows:
The grounds of the servo motors and of the ultrasonic sensors must be connected to the ground of the Arduino board and their power supplies to +5V.
The trigger input of the X ultrasonic sensor is connected to digital input/output 2 and its echo output to digital input/output 3.
The trigger input of the Y ultrasonic sensor is connected to digital input/output 5 and its echo output to digital input/output 6.
The left and right servomotors controls are connected to digital inputs/outputs 8 and 10 respectively. Left and right refer to Big Brother's eyes, his left eye is on your own right.
The following diagram shows the connections to be made:

Technical Details & Enhancement
This project uses ultrasonic sensors (HC-SR04) to detect an object's distance and lateral position. The Arduino calculates the object's coordinates and maps them to servo angles for the two eyes. This creates the illusion of being watched.
To make the movement look more organic and "alive," the software should not instantly snap the servos to the new calculated angle. Instead, by using a loop to increment the servo angle by 1 degree with a small delay between steps, the eyes smoothly *sweep* towards the target. This smooth, deliberate motion drastically increases the realism and creep-factor of the project.
Software
The software is extremely simple, less than 70 lines. No library is required.
Have fun.