Reese K

For my main project, I created a voice controlled robot. The robot is controlled using an android app I made using MIT app inventor. I also added neopixels, which are lights that I coded to turn particular colors and form patterns depending on the direction of the robot’s motion.

School

Castilleja

Grade

Rising Junior

Final project

I faced a lot of challenges over the course of this project. The main two were finding a working microcontroller and getting the motors to run the same speed. There are multiple microcontollers that could potentially work for this project, including a nodeMCU and feather huzzah. I spent quite a bit of time trying to understand why nodeMCUs weren’t working: one burnt, one got very hot, and another couldn’t get code uploaded to it. After that I tried the feather huzzah, which ended up working for me. I also had trouble because the two motors I used ran at different speeds, meaning my robot turned slightly when it tried to go straight. A way to fix this issue is by using PWM, which means using analogWrite when coding the motors. However, this method didn’t work for my motors, so I am still trying to figure out a way to make the motors the same speed.

turnsignals
finalrobotschematic

Reflection: 

From doing this project, I learned many ways to troubleshoot why a part isn’t working. Since many of my microcontrollers and other parts stopped working, I learned that there are many different tools to figure out which part of the project is going wrong. If a physical part stopped functioning I learned to use a benchtop power supply to test if power was the issue and a multimeter to test where the problem was in a circuit. If my code wasn’t doing what I wanted it to, I used the serial moniter in arduino to test where the code was having problems by using serial.println to see how far through the microcontroller got.

From doing this project, I also learned about the types of engineering I enjoy. Before this project, I had only worked with prototyping and building parts, but through creating this robot I also learned about electrical engineering and computer science. The electrical engineering part of this project was not something I really enjoyed; however, I did enjoy programming. In the future, I will probably stick with mechanical engineering and some computer science as well.

Complete Bill of Materials: 

Adafruit feather huzzah

Dual H-bridge motor driver L293D

Motor robot car chassis kit

9V battery

5V portable battery

Adafruit neopixels

Wires

 

Here is the final code.

robottopview

Modifications

Since I still had time once I finished my main project, I decided to add neopixels to my robot. Neopixels are a strand of smart LED’s which you can program to be different colors and patterns. In order to do this, you need to download a library from adafruit which has examples for the neopixels that you can build on. I programmed the neopixels to display a different color for each direction. I also added turn signals, so when the robot goes right or left, the neopixels also show flashing leds in the direction the robot is turning. When the robot goes in reverse, the lights fade through the rainbow which is an example from the adafruit library.

One challenge I encountered when working with neopixels was that I wanted to use two separate strands. I originally thought I would have to control the neopixels using separate code by connecting the two strands to different pins of the microcontroller. However, I figured out that if I made the strands the same length, I could run them off the same pin and code. If I were using strips with a different number of pixels, they would need separate code because much the code I used relies on the number of pixels.

Here is a link to the final code which includes the neopixels.

Third Milestone

Here is a link to a video of the robot being voice controlled through the app.

My third milestone was creating an app which makes my robot move by connecting with my microcontroller over wifi. I created an app using MIT app inventor which makes apps for android phones or tablets. The app has buttons and a voice contorl feature which the user can use to control the robot. The app recognizes when any of the buttons are clicked or voice control is used and tells the microcontroller the command. In order to communicate, the microcontroller connects to wifi and displays its IP address, which the app uses to send signals to the chip. Here is an image of the app.

       I encountered many challenges when trying to get this part of my project to work. My first problem was that the microcontroller I used for my first milestone was a proMicro which doesn’t have a wifi chip, meaning it can’t communicate with the app. I transitioned to using a feather huzzah in my second milestone, but was having trouble with it communicating with the app. I then switched to using a nodeMCU, but was unable to spin the motors using that. I finally switched back to the feather huzzah and was able to make it work.

       I also encountered some trouble using MIT app inventor. I used a template created by someone who had done a voice control robot, and then enhanced parts such as the background, buttons, etc. Once I had created the app, I then tried to download it to my tablet. But, the app to download from MIT app inventor didn’t work for me. I was able to use the usb feature instead of connecting using wifi and get my app, but every time I exited the app or turned off my device, I would need to redownload it. I finally resolved this problem by using the complete download function where the app downloads as a seperate app on your tablet, therefore letting you exit the app without having to redownload. 

Second Milestone

My second milestone was controlling my robot over wifi by using a web browser. To do this, the microcontroller connects to wifi and displays its IP address which the computer uses to connect to send the microcontroller signals. Depending on the button clicked, the microcontroller will move the robot in that direction by turning some pins high and some low. One problem I encountered through this milestone was that the microcontroller I used for my first milestone was a proMicro, which doesn’t have a wifi chip. This means that it can’t communicate over wifi, so it is unable to control the robot through a browser. Because of this problem, I transitioned to using a feather huzzah, a microcontroller with wifi, which was able to communicate with the web browser. I then coded the website to have the buttons I wanted and rewired to make the circuit work for the new microcontroller. Here is the code to control the microcontroller using a browser.

First Milestone

circuit-diagram
Electronics circuit diagram

My first milestone was making my robot move forward, backward, left, right, and stop. In order to do this, I first used a breadboard to connect my microcontroller to the motors. I was originally going to use a NodeMCU as my microcontroller; however, my computer wouldn’t recognize that chip through Arduino, which I used to program. I then switched to using an Arduino pro micro, which my computer would recognize. Once I was able to light an LED using this microcontroller, I moved on to working the motors. I made a fritzing diagram for my circuit which would connect the motors to the chip and the H bridge, which was an L298. When I put the circuit together, it did not work, which I realized was due to the H bridge not working. I swapped that H bridge for a different one: L293D. I created a new fritzing diagram and was able to connect the circuit, which eventually worked. I then created the body of my robot and attached all of the different parts. The wheels were able to turn slowly, but they were able to turn faster by adding a 9V battery to the H bridge. Since I only wanted to use one power source on my robot, I used a boost converter from the 5V to power the H bridge. I also had to deal with the problem of my motors not running at the same speed. I dealt with this by using PWM, pulse width modification, to change the speed of the individual motors.  

Starter Project

For my starter project I made the MintyBoost which is a circuit that charges your  device. In order to make this project, I first learned how to solder and used that skill to attach the components onto my circuit board. I followed an online tutorial which showed where to place the different parts. Once I put together all the parts, I then learned how to use a multimeter to test if my circuit and batteries were working. At this point, I had a working project, but soon after, my red wire broke off and detached from the circuit board. In order to reattach the part I faced the challenge of desoldering. After trying different techniques, I was finally able to get off enough solder to re-attach the red wire; however, when I tested the circuit it did not function properly. In order to test where the problem was, I learned how to read a schematic and how the pins of an IC chip are numbered.

Leave a Comment

Start typing and press Enter to search

Bluestamp Engineering