Adafruit Feather Bluetooth controlled R2D2!
Chris Lydgate shared his bluetooth controlled R2D2 project with us on the adafruit forums! See the video on Youtube!
A droid malfunctions and sits unused for 12 years. Can our basement robotics crew bring him back to life?
The original droid was “autonomous,” ie included no remote control. For the rebuild, we decided to allow remote control from a cellphone using bluetooth.
Hardware for this project included:
Adafruit Feather M0 Bluefruit LE microcontroller
Feather Wing Motorshield
Feather Wing VS1053 sound board
PAM 8302 Mono 2.5W Class D Audio Amplifier
Sharp GP2Y0D810Z0F Distance Sensor with Pololu CarrierWe were able to reuse original motors, speaker, and battery stack.
Getting the bluetooth link up and running was actually the easiest part of this project. We downloaded an app from Adafruit app that links a cell phone to the M0 board.
Next we connected the motors to the motorshield and the motorshield to the microcontroller. also fairly straightfoward (tho it took a while to get the motors going in the “right” direction.)
Wiring up the sound was definitely the hardest part. The sound board is kinda fussy about voltage spikes and needed some capacitors. I also had to build a little amplifier circuit and a special voltage regulator for the amp. It was a challenge to make this all fit inside R2’s chest cavity.
We also added some basic obstacle detection in the form of a distance sensor. This prevents an overenthusiastic operator from smashing R2 straight into an obstacle.
The coding was also a challenge for me. The soundboard requires frequent updates (like every 20 ms) so you have to be very careful using delay() or making calls that might timeout. In the end the code was 500 lines, tho to be fair many of these were comments.
SPECIAL THANKS to the folks at Adafruit (hi, Mike!) for all their help on this project.
Featured Adafruit Products!
Adafruit Feather M0 Bluefruit LE; Feather is the new development board from Adafruit, and like its namesake it is thin, light, and lets you fly! We designed Feather to be a new standard for portable microcontroller cores.
This is the Adafruit Feather M0 Bluefruit LE – our take on an ‘all-in-one’ Arduino-compatible + Bluetooth Low Energy with built in USB and battery charging. It’s an Adafruit Feather M0 with a BTLE module, ready to rock! Read more!