This homework was to adapt our vehicles to become wireless with a Bluetooth dongle.
Process
I was on a time-crunch this week, so I need to do this fast and had one shot to do it. Thus I did my planning before hand, figuring out the layout of my new Arduino Shield and testing out the circuitry before going to the lab.
A problem I encountered was that the Bluetooth dongle "didn't seem to work": on the Serial console, it never changed its status to "advertising." From some scouring, I concluded that I would need to actually solder the dongle to the male header pins in order to prove my circuitry worked, postponing any work until that was done.
Chris confirmed that assumption, and once I soldered it, it worked perfectly. I continued on the solder the rest of the shield, which was straightforward (looking back, I should have placed the female header pins parallel to the Arduino pins so it would be easier to connect). Figuring out what needed to stay and what to nix from the wired version was fairly simple.
Modifying the demo Bluetooth code was simple too, with the only tedious part being figuring out what message the controller sent in response to pressing the controller buttons.
One flaw here then is that the Bluetooth controller couldn't mimic the potentiometer I had on my wired controller: this wireless version has one set speed for turning. I tried to implement a feature where how sharp of a turn the vehicle made was based on how long one held the button down, but I couldn't get it to work. I guess I'll leave it at going back and forward at the different angles to make a turn.
Results
It works well! I could control the vehicle across the room from my desk. The only con is the lack of variable turning rates. Otherwise it works much like the wired vehicle.
Conclusion
It's really cool to see that I've prototyped an RC vehicle from a cardboard model to a working, wireless model.
Note: Fritzing keeps crashing when I try to wire up the shield, so I can't post the schematic.
Comments