Remotely Controlled Vehicle Using Adafruit's Bluefruit LE Bluetooth Device
*please scroll below to see the additions for the week of 11/23
This is an adaption of a previous project, which was to create a motorized vehicle drive by a controller. My vehicle, due to technical difficulties, utilized direct motor control to drive the motors. For this installment of the project, the motors were controlled using an arduino uno, and driven using a Bluefruit LE Bluetooth device. After a great deal of troubleshooting, by vehicle drives forward and turns very well. There is added weight, but from preliminary tests I have run at home, it still drives up ramps without issue.
Problems and Solutions
I encountered several problems during this homework project, most of which have been solved.
Smaller problems were easily fixed but were annoying to find -- I searched for 30 minutes before I realized I had attached by GND line to the wrong pin (checking all your wires thoroughly is important!). I also found programming my vehicle to be very difficult, given my inexperience with coding. In one instance, I was able to solve a pin-shortage problem by better acquainting myself with what each pin for the motor controls and bluetooth device did. I found the tutorials listed below to be helpful. All problems I had during coding were fairly minor, and were mostly due to ignorance. Reading through these tutorials help a lot!
used for connecting and coding dual motor control:
http://tronixlabs.com/news/tutorial-l298n-dual-motor-controller-module-2a-and-arduino/
(in this tutorial, 4 PWM pins and 2 digital pins are used on the arduino board. However, PWM pins are actually only necessary for the two enabler pins in the tutorial)
Tutorials that helped me understand the bluetooth device:
https://www.youtube.com/watch?v=_LCCGFSMOr4&list=PLA567CE235D39FA84&index=2
https://learn.adafruit.com/introducing-the-adafruit-bluefruit-le-uart-friend/controller
It took me much longer to solve problems I had with connecting my phone to the bluetooth device properly. It took a while for my phone to recognize the device, firstly. Once I turned my phone on and off, this was fixed. My second problem was one of communication. When I type in a message on my phone, I got nonsense, and when I type a message on my computer to send to my phone, I got nonsense (pictured below). I solved this by tinkering. I quit the arduino program on my computer and re-started it, I re-uploaded the code to my arduino, re-downloaded the bluefruit LE app, and I check to make sure I had entered the correct baud rate (115200). Finally, I found that I had to first open the serial monitor window on my computer, THEN connect my bluetooth device. Otherwise, it would immediately disconnect upon opening the serial monitor.
Finally, I found that one of my motors would not spin backwards. I suspect this problem is mechanical, so I could not solve it prior to class. However, it moves forward and turns fine, so this will not impact my vehicle's performance on the obstacle course.
Video and Pictures of Working Project
Week of 11/23 additions:
Our assignment for the week of 11/23 does not appear to be an official assignment (?), so I thought it best to add my progress here.
I changed my design slightly, by including more holes in the sides and more support for the motors. This was an attempt to make my vehicle lighter, although I neglected to factor in the weight of adding some surface area to the horizontal board between the two sides. As a result it is about the same weight, but the cut out holes in the side make it more versatile in terms of wiring. Image gallery of the new chassis below.
I changed a motor because I thought one had failed, only to find that there was actually something wrong with my code. However, I can't find the bug! I will have to review this later in the lab.
I also experimented with form in the design concepts below, although nothing stuck out in my sketches, so I plan to give it a day of space and revisit my concept tomorrow. Currently, I'm looking to natural forms for inspiration. Sketches below.
Comments