The motor drive circuit uses a very simple UART command structure. Numeric strings are sent by the connected computer and converted to a numeric value that indicates the angle that the servo should be pointed toward. Servos are controlled via the duty cycle of a PWM signal, so the incoming angle is converted into a duty cycle that is used to adjust the output PWM signal to the servo.

The computer that connects to both the antenna and the motor controller is programmed using Python, since it allows a wide range of computers to be used including a PC, OS X, Linux, and even a Raspberry Pi, which could make this project portable.

The Python script starts by opening two serial ports (one for the motor driver and the other for the ESP-01 module) and then configures the ESP-01 module. Once configured, the program starts by commanding the ESP-01 to scan for Wi-Fi networks, finding the network that is our explorer, and then reading the signal power. This reading is passed to a variable that is used to store the highest recorded signal strength, and then the program runs a for loop. This for loop runs 20 iterations, and upon each iteration, the antenna is moved slightly, and a new signal reading is taken.

When these 20 readings are done, the program then points the antenna to the angle that gave the highest reading, and the antenna should now be pointed toward the explorer.

Construction