Remotely controlled servos

Louis Pearson

Overview

This project consists of a body of 2 servos that work together to move horizontally and vertically, aiming a phone towards the user via Wi-Fi signals from the phone. The project was originally going to use facial recognition to detect the movement necessary to move the servos, but this will have to be a future implementation, as phones make this endeavor a little more difficult. Currently however, the project uses the input of buttons on the phone, or from some other devices, and moves the servos accordingly. This way any device that can connect via Wi-Fi will have access to the movement of the servos.

General view

Hardware

To run this project I utilized the Wi-Fi module, as it allows for convenient usage by the user. I have the module working as an access point (AP) and set up its own TCP server at address 10.10.10.1 that can accessed by other Wi-Fi devices. This server is only accessible through LAN, as multiple connections to the service may result in unexpected results. The microcontroller is used to operate servos by generating PWM for each of them. For this I used two timer channels and a Robotics Servos Kit from Sparkfun Electronics. Finally, the project schematics includes a DC/DC converter that drop the USB bus voltage down to 3.3V to power the Wi-Fi module.

Schematic Assembly

Software

The program starts with house-keeping part of initialization of the microcontroller modules and Wi-Fi module. Then is falls into an infinite loop. At each iteration of this loop the microcontroller is put on sleep to be waken up by the Wi-Fi module. When the data for the servo movements is received by the Wi-Fi module, the microcontroller gets an interrupt request. It reads the received packet and extracts from it the servos movement data, which is transmitted as a HTTP GET request to the TCP server. This data just tells the microcontroller whether it should increment or decrement the PWM duty cycles for each servos, thus moving them in the corresponding direction.

The HTTP server running on port 80 of the module is used to hold the control web page for the user interaction, which is shown below. Once the user clicks on some button, the GET request is composed and forwarded to TCP port 8080 of the module by using the AJAX protocol. The submit button becomes inactive till an acknowledgment is received from the module. It takes about 1 sec to get the acknowledgment, after which the button becomes active again and ready for issuing a new command.

Final Thoughts

This was an extremely fun course. I enjoyed the whole process. Sergei's constant commitment to students questions and work is extremely helpful. I was expecting my project to not be finished by the end of the class, but I am inspired to do more with micro controllers/servos in the future. Who knows, maybe I will complete this project and update this page in the future if possible.

Downloads


Last modified:Mon, Jan 23, 2023.

00083