Voice Controlled Robot
Hi! My name is Zoe and I am a rising sophomore at Convent High School. My starter project is a junior theremin and my main project is a voice controlled robot that can be controlled with an Android app. Here are the links to my build plan and bill of materials.
Engineer
Zoe Hinks
Area of Interest
Software Engineering
School
Convent High School
Grade
Incoming Sophomore
FINAL MILESTONE
My final milestone for my voice controlled robot was adding many modifications so that I can have more control over the robot. The robot can now make 90º turns if you press and hold the left and right buttons, go forward and backwards for 1 second, and if you shake the phone, the robot will stop. Now, instead of pressing left or right and then stop straightaway to make a 90º turn, you can press and hold the buttons.
Additionally, I added 2 RGB LEDs that light up blue when the robot goes forward, green when the robot goes backwards, and red when it stops. I also added other commands to the voice control so that you can say either “reverse” or “backwards” and the robot will reverse.
SECOND MILESTONE
My second milestone was building the Android app to add buttons and voice control to the robot. First, I designed and built the Android App using the MIT App Inventor. I first designed the app, and then used the blocks feature of MIT App Inventor to program it. I programmed buttons to move the robot forwards, backwards, etc when they are pushed. How this works is, if you were to enter a URL with your IP address and the command into a browser, for example, if you entered http://10.10.10.10/forward, where 10.10.10.10 is your IP address, the robot would move forward, as long as it is connected to the same IP address. So what the app does is, when you press a button, it enters a URL such as the one above into a browser. When I tested this on the Kindle Fire, everything worked fine. However, after I added the code for the voice control, which works in exactly the same way as the buttons except with a speech to text feature, the Kindle Fire displayed an error message saying that there was “No Activity found to handle Intent”. After researching this error, I came across the Google Group for the MIT App Inventor, where someone commented that if you got this error, it means your device doesn’t have text to speech built into it, so I tried using the Android Emulator on MIT App Inventor, but that displayed the same error. Finally, I borrowed an Android phone, downloaded MIT App Inventor, and ran my app, and it worked! My next and final step towards completing my project will be to customize it by adding more commands.
After I had wired the robot, I ran the program to move it, but when I uploaded the code, nothing happened. After 3 days of trying to figure out why it wasn’t working, I realized that the entire time when I had been uploading the code, the program that had been running was the one that I used to make sure the code was uploading properly. After I copied and pasted the actual code into that file, everything ran smoothly.
The final step towards achieving my first milestone was connecting my robot to WiFi so that it will be able to receive voice commands from the Android device via the app. I ran the program to connect it, and everything worked, except for when it printed the IP address, which I need for the Android app, it said it was 0.0.0.0, which is obviously incorrect. However, because IP addresses are the same for every device connected to a given WiFi network, I found the IP address of my computer instead, and I will use that when I need it for the Android app.
First Milestone
My first milestone was physically constructing the robot, wiring it, enabling it to move, and connecting it to WiFi. Because the H-Bridge L293D didn’t come until monday of the second week, I first assembled the robot. Next, I wanted to upload code to the NodeMCU to blink an LED, but my code wouldn’t upload using the Arduino software, so I used another program, called PlatformIO, which works with Atom, to upload my code. After I made sure it worked, I wired the robot. How the circuit works is, on the NodeMCU, there are GPIO (general purpose input/output) pins, which are sending electricity to the L293D in a certain way depending on your code, and when the L293D receives those outputs, it will send electricity through one of the wires connected to the motor, which will cause it to spin in a certain direction. For example, pins 0 and 2 control the left motor, so when the wire coming from GPIO 2 is high, and the wire coming from GPIO 0 is low, the left motor spins counterclockwise, pushing the robot forwards.
After I had wired the robot, I ran the program to move it, but when I uploaded the code, nothing happened. After 3 days of trying to figure out why it wasn’t working, I realized that the entire time when I had been uploading the code, the program that had been running was the one that I used to make sure the code was uploading properly. After I copied and pasted the actual code into that file, everything ran smoothly.
The final step towards achieving my first milestone was connecting my robot to WiFi so that it will be able to receive voice commands from the Android device via the app. I ran the program to connect it, and everything worked, except for when it printed the IP address, which I need for the Android app, it said it was 0.0.0.0, which is obviously incorrect. However, because IP addresses are the same for every device connected to a given WiFi network, I found the IP address of my computer instead, and I will use that when I need it for the Android app.
Starter Project
My starter project is the junior theremin. It has 2 microcontrollers, called the 555 and the PIC12F508. The 555 is a timer chip, and in this circuit, it turns a light on for a certain amount of time and also tells the speaker to play notes of certain frequencies. The other microcontroller, the PIC12F508, receives input from the buttons, and if both of them are pushed, it changes the mode, or if it’s in discrete mode, pushing one of them moves the notes either up or down an octave. Additionally, there is a buzzer that outputs the sound and LEDs that light up when a note is played. There are also two capacitors that ensure that there is always current so that the microcontrollers don’t restart. There is another capacitor that acts as a filter in conjunction with a resistor to target a specific frequency. The rest of the resistors make sure that each part of the circuit only gets the amount of current it needs so that it doesn’t overheat. In addition, there is a linear voltage regulator that takes an input voltage and produces a regulated output voltage. Finally, there is a wire that electricity flows through as part of the circuit, and when your electric field comes close to it, it disrupts the circuit, so the theremin makes a sound.