In the video he connects the servo directly to the ESP so we did the same. It was difficult to control the servo since first we needed to is how we were going to control the servo. We needed to have it move in correlation to the direction that the control would give it. this was accomplished through having the servo move a certain amount of degrees when the joystick moved a similar amount on the web server. The second thing to figure out how to make and use a web server. It was very difficult to set up and with a lot of help from Mr. Dubik, we were able to use the web server. The web server takes the code programmed into the ESP and makes it into a web page that can be accessed if connected to the same wifi as the ESP through a IP address given in the serial monitor when code is first uploaded to the ESP. That was a big issue, there was another more annoying one in that there was a very visible delay between the command on the web server and the servo moving. The issue clearly wasn’t hardware since there was only one output pin to the servo from the ESP and the power pins so we checked the code. In the code there was a line that gave a slight delay from the web server to the servo moving. To fix this we just removed the line of code that gave that delay.
When converting the project to a bigger scale to get a working module we had to use a bigger servo so that the wheels could be turned. To do this we used the 9 gram servo to have a better center control and a stronger steering mechanism. There was one issue when switching it out with the two servos where the 9g servo wasn't responding well to the inputs on the web server. To solve this problem we made sure that the code didn't need to be changed for the new hardware and that the ESP would take the changed code by putting it into bootloader mode. After doing both of those things the 9g servo was responding to the web server with no delays and exact synchronization with the controls.
1.5 Gram servo used origanally
9g servo used in final design
Servo being controlled by web server
In the video the guy uses a custom PCB and lots of surface mount components to control the DC Motor. With the limited time and a more efficient way of doing things the PCB was replaced with a Mini Motor Board. This allowed the motor to move when needed to. From there the two input pins were put in the GPIO pins 4 and 5 on the ESP to control the motor. From there I first got it to work by taking Noah’s code for his stepper motor and changing it to work with the DC Motor with the prompt on ChatGPT requesting it to change the code to work for a DC motor instead of a stepper motor. This allowed me to control it to turn on and turn off through a joystick control code on a web server that was in Noah's code. The web server used to control the DC motor works similarly to the one mentioned in the servo part of this document. I thought that I might have to change it more afterwards when bringing both codes together but it worked all the same thankfully.
When the project got scaled up there was no change in code or struggles with the bigger DC motor.
Mini Motor Shield used for DC motor
Video of small dc motor being controlled by web server
First I tried to just have ChatGPT take both codes and put them together on the same webpage. This didn't work out well for me though. The web page looked fine and the servo and LED still worked but the DC Motor didn’t. I checked if the pin outs were correct and even switched them around to see if that was the issue but I found no change. The weird thing was that when the Servos control pin was changed it still worked, so I checked all the wiring and found nothing wrong with it. The power pins were correct, the motor was connected to the motor shield correctly, and the input pins were in the correct place. I checked the code again to see what it might be instead. Turns out we had to change the pinouts from the breadboard to different ones but it worked afterwards. To control both we used a antenna connected to the ESP which allowed the ESP to connect to the WiFi and in turn create the web server that allows us to control the motors
With the scale up the combination wasn't very impacted and when tested together the two controls worked well together after the servo issue mentioned above was fixed.
Original electronics layout
Video of both motors being controlled from the same web server and joystick
In the video the guy uses one ESP to control the car and another to show a display from the car. To use the camera we first tried using his code to see how to use a web server. There was an issue where we couldn’t use it through the Wi-Fi but that was fixed when IT took down the gateway stopping us from using a web server. Before that though Afterwards the display from the camera showed up onto the web server clearly. To make the ESP work with a camera it needed a camera addition and a small antenna to connect to WIFI.
Antenna used on both ESPs
Video of camera displaying to web server for video feed
An incomplete part of the project but an important one. The necessity was to replace the breadboard with a protoboard and to minimize the size of the wiring to give the project a complete look. We were unable to switch the electronics over to the protoboard due to time constrictions when we were going to switch it over.
Halfway Progress
Final Result