This page just gives a roundup for my tin can based R2D2 build (which is also my first project I used 3D printing) . For a detailed build log see the blog.
The idea in general for this project was to convert a tin can, which normally is used for coffee powder, into a R2D2 like robot which could be remote controlled from a smart phone or tablet.
The first start was a little clumsy as you can see in the picture below since my metal work skills are poor, and also I don’t have the right tools for precise metal crafting.
Thus it was really easy to transform the model:
Into something real which pretty much looks like the model:
The final robot turned out to have the following features:
- Remote controlled through Android App from smart phone or tablet by using bluetoooth
- Play sound from PCM (like typical R2D2 bleep-bleep)
- Show some “emotions” through LED face (like sad, happy)
- Use ultrasonic range finder to run in “save” mode (prevent it from crashing in to objects)
The following things are used for this:
- Parallax Propeller QuickStart board as on-board MCU, firmware programmed in spin
- Android Application written with Processings Android mode
- OpenSCAD to create the models for the 3D printed parts
- Ultimaker 3D printer to print the parts
Here is a short video of the two robots I build in action:
The full BOM for the electronics looks like so:
- 1 x Parallax Propeller QuickStart Board
- 2 x gear motor
- 2 x wheels for gear motor
- 1 x Pololu 3.3V Step-Up/Down regulator to supply the Propeller MCU
- 1 x TB6612FNG dual motor controller
- 1 x BTBee SSP module
- 1 x Maxbotix ultrasonic range finder (not mounted yet)
- 1 x Speaker I found in my parts bin (not mounted yet)
- 1 x LiPo battery 7.2V, 450mA for the Propeller MCU
- 1 x LiPo battery 7.2V, 950mA for the motors
- 1 x dual switch to turn MCU and motor power on/off
3D Printed Parts
The following parts are 3D printed:
- Front wheel
- Bottom base
- Top base
- Dome cover
- LED face housing
- Speaker housing
- Inlay to hold electronics
The firmware is entirely written in Propeller Spin. Using Spin helped speeding up development a lot. Also having 8 cores on the propeller is very convenient :-). Roughly the software is structured like this:
The tinshell connects to the BTBee through serial line receiving commands from BT (I also made the library for creating shells available separately).
The shell ques the commands for driving the bot to the drivepilot. The drivepilot controls the DC motors through the motor controller library (also available separately), queries the ultrasonic distance sensor for obstacles and sends commands to the effects processors for sound and light. Since the tin can robot easily flips over when speed up to fast, the drivepilot slowly increases speed (by using a PWM) when starting or stopping.
The lighteffects module is responsible to drive the “LED face”. Showing emotions like a sad face when the robot is stopped, or a happy face when the robot is driven.
The soundeffects module is responsible for playing PCM sounds. E.g. typical R2D2 bleeps.
2. Android App
The Android App is written using the Processing Android mode together with the Ketai library to access the smart phones bluetooth. Since Processing does not provide GUI elements by default, I wrote a simple framework to provide basic buttons an stuff. Since one of my childs is left handed, I made the GUI in a lefty and righty variant.
Not much to say about that, but I do have some pictures showing the assembly:
And a short video of the first electronics tests: