HI R2D2! -- Make a 3D Print Talking R2D2 Robot

by loovee in Circuits > Robots

7138 Views, 89 Favorites, 0 Comments

HI R2D2! -- Make a 3D Print Talking R2D2 Robot

step12_1.jpg
cover.jpg
R2D2_Robot

I am a supper fan of Star War and I like the R2-D2 robot which is a resourceful astromech droid, R2-D2 served Padmé Amidala, Anakin Skywalker and Luke Skywalker in turn, showing great bravery in rescuing his masters and their friends from many perils. A skilled starship mechanic and fighter pilot's assistant, he formed an unlikely but enduring friendship with the fussy protocol droid C-3PO. I got the R2D2’s language from the r2d2 translator website.

In this project, I use a 3D printer to make a R2-D2 robot and use Re-speaker to make it “speak”, Re-speaker is a powered by the MT7688 Wi-Fi module and the built-in high performance microphone, Re-Speaker responds to your voice and recognize your speeches based on powerful online cognitive services like Microsoft Cognitive Service, Amazon Alexa Voice Service, Google Speech API, Wit.ai and Houndify.

Prepare the Stuffs

step1_3.jpg
step1_4.jpg
step1_1.jpg
step1_5.jpg
step1_2.jpg
step1_6.jpg

First of all, you had to find a 3D-Printer.

Then some electronic modules is needed as well:

Wiring

step2_1.jpg

Now, we should connect the Grove Modules to the Grove Extension Board for Re-Speaker.

And connect the speaker to the Re-Speaker.

Setup the Re-Speaker

step3_2.jpg
step3_1.jpg

The software work of the social artifact consists of 2 parts, the code running on Arduino side and the python script running on the MT7688 side. The communication between the two chips are UART and SPI.

Connect Re-Speaker to your PC using micro USB cable, if your computer can’t recognize it as a USB device, you can download the driver from here.

  • Connect Re-Speaker

Now, using your favorite SSH Tools connect to Re-Speaker.

Baud rate: 57600

Terminal App: For windows, putty is recommend. For Linux/Mac, use screen /dev/xxx 57600

  • Connect MT7688 to the Internet

Modify the configure file to change MT7688 into station mode and connect to the internet.

vi /etc/config/wireless

Change the configure file as below shows.

Change the ssid and key to your own on the red box as the picture shows.

option disabled '0'
option ssid 'your_ssid'
option key 'you_key'

Then reboot your Re-Speaker.

reboot

To have a try ping a website to ensure your Re-Speaker have connected the internet well.

ping seeed.cc

Upload the Arduino Code

step4_1.jpg

1. Download demo code at GitHub

2. Click Download zip button on right side of webpage to download all codes.

3. Decompress the downloaded zip files to C:\Users\Administrator\Documents\Arduino\

4. Launch Arduino IDE.

5. Click Sketch>Add file to add r2d2.ino file from C:\Users\Administrator\Documents\Arduino\ R2D2_ReSpeaker\Arduino_Side\r2d2\

6. Click Tools > Board and select Arduino Leonardo and chose the right port, as shown in the picture below.

7. Press CTRL +U to upload codes to your board. Wait a while, there will be saying Done uploading.

8. Congratulations, you have already completed the whole of the software work on Arduino.

Download the Code

step5_1.jpg

Insert the micro SD card to the Re-Speaker

SD slot. Now, we should download the code from Github to your micro SD card.

root@mylinkit:/# cd /Media/SD-P1
root@mylinkit:/tmp/run/mountd/mmcblk0p1#

When navigating to /Media/SD-P1, the system will mount the SD card to /tmp/run/mountd/mmcblk0p1 automaticlly. And then execute the following commands.

git clone <a href="https://github.com/Lee-Kevin/R2D2_ReSpeaker">https://github.com/Lee-Kevin/R2D2_ReSpeaker</a>

Change the Code

step6_1.jpg

After download the code, you can use vi editor to change the code, in this project, we use Microsoft cognitive services, You can get the API Key from here.

And then, change the BING_KEY to your own.

vi creds.py

Setup the Startup Script

Navigate to /tmp/run/mountd/mmcblk0p1 by execute following commands:

root@mylinkit:/# cd /Media/SD-P1

Then create a file named autorun

vi autorun

And add the following code.

#!/bin/sh

amixer sset Capture 90%

cd /tmp/run/mountd/mmcblk0p1/ R2D2_ReSpeaker /r2d2

python demo.py &> /dev/console &

At last, reboot your Re-Speaker.

reboot

3D Printing and Tint

step8_1.jpg
step8_2.jpg
step8_3.jpg
step8_4.jpg
step8_5.jpg

The R2D2 model is that we got from the Internet, and do a little modifications so that we can put the hardware inside. Note that, in fact, the model is a lot of parts, pay attention when you printing.

After 3D printing, spray white paint in the surface of parts, then use blue marker tint. Finally, the scanning line with a pencil, so that the whole more three-dimensional appearance

Downloads

Fixed R2D2

step9_4.jpg
step9_1.jpg
step9_2.jpg
step9_3.jpg

Fixed R2D2 with screws and bearing, it's no difficulty. then attention fixed servo and gear. R2D2 rotor is depends on here.

Put Hardware Inside

step10_4.jpg
step10_5.jpg
step10_1.jpg
step10_2.jpg
step10_3.jpg

Because of ill-considered, modify the model time to forget the punch, now use manually open a hole, then put the hardware inside, use screws fixed them all.

The Result

Now, you can put R2-D2 on your desk, and when you’re bored, you can pat it or speaker to it, it can speak to you too. But maybe you can’t understand what he said. LOL

Make. Invent. Do.

step12_2.jpg

This project is made as an Open Source Project. It's a starting point. Let your creativity go wild with the mechanical, electrical and software design. Make the demo your own. Decorate it. Improve the work. No matter what, write a recipe about it.
To share and progress together.