DIY Bluetooth Phone Controlled BB-8 Droid With Arduino UNO

by Imetomi in Circuits > Robots

143106 Views, 916 Favorites, 0 Comments

DIY Bluetooth Phone Controlled BB-8 Droid With Arduino UNO

569ea2982e7fb6bc0d000ebf.jpeg
Borito.JPG
FFDSBTKIHUUDK7X.jpg
DSCN0187.JPG
DSCN0158.JPG
DSCN0206.JPG
DSCN0199.JPG
DSCN0193.JPG
DSCN0190.JPG

I'm a huge Star Wars fan and when I saw the Star Wars: The Force Awakens I thought that I need a BB-8 droid. It was awesome how this little sphere moved in the movie. So I decided that I'll make this droid that is based on the Arduino UNO (or other microcontroller). In this instructable I'm going to show how to build this droid with the LinkIt ONE that is a very popular board these days on the Instructables, so in a few steps I'll explain the code and if you want to use a LinkIt ONE you have to build a motor driver circuit that is also explained in my instructable. What if you haven't a LinkIt ONE? Don't worry I used an Arduino UNO clone to build my project, because the Arduino is much more popular than any other microcontroller, the LinkIt ONE is a short upgrade in four steps for LinkIt ONE users.

Some features:

  • phone controlled
  • voice controlled
  • Arduino based
  • realistic head and body motion
  • light effects
  • sound effects

This BB-8 model can be controlled with a smartphone using an application downloaded from the Play Store, iOS users have to use another app, because this one isn't compatible with iDevices, I'll insert links for different apps for the Apple users. Can be controlled even with voice commands using another Android application. BB-8 has light and sound effects just like in the movie. This droid is able to move his head, can turn left and right, moves forward or backward. The body moves realistic too, but there is difference between the original and my mechanics. Eventually is a good replica, it's only a little bit smaller than the original.

So my first intent was to make a realistic R/C replica of the BB-8. My second intent was to build this droid at very low cost. I didn't want to spend a lot of money for this project and I think succeed, the full cost is less $40. This is relatively cheap, if you check the prices of the BB-8 toys. If you want to build this droid please read every steps attentively. Every single detail can be useful and important.

Video Presentation

BB8

Sorry when I rendered the quality dropped down, and became a bit pixelly. But you can see it works. I ordered some new neodymium magnets, because these weren't strong enough to hold the head while moving fast. My order still is on the way, but after adding 100 extra gramms to the body inside the ball worked fine. In the video I only made a quick servo motor test and a free roam moving test.

How Does BB-8 Works?

bb-8-star-wars.jpg

This website explains very good how the original BB-8 would work. The mechanism is complex and requires a lot of motors, gyroscope and a better circuit. The head can be kept and moved using magnets that are in the sphere.

In my version I used a unique solution to make the communication between the droid and the phone: using an Arduino friendly app that is able to control any Arduino clones with a Bluetooth module. I think this was the best solution to make it phone controlled.

Other Maker's Design

XRobots - Star Wars BB-8 Droid *VERSION 2 PART 8*, Ball LEDs & Opening Panels
Making a Working BB-8 Droid Replica!

I think James Bruton's design is one of the best that I saw on the internet. It's simply awesome... But Mike Senna's droid is amazing too. I know that mine isn't so good like those, but I tried to make something new, invidual without copying the design of these two amazing makers.

My Desing and Concept

DSCN0659.JPG
567fd6504fbade8fa0000103.jpeg
567fd66a937ddb37460009d9.jpeg

I made some drawings about my plan. I used a cardboard globe for head and a plastic hamster ball to make the body. In this hamster ball is placed the Arduino and the motors. The M1 (motor) moves the droid forward and backward, the M2's role is to turn the body left or right. To the M2 should be connected something metal or anything that has big weight, otherwise the droid won't be able to turn left or right. As a weight I simply used the two batteries, so don't need to add extra weight. Later I'll explain this featurette. The Servo moves the head on the body forward and backward and the M3 turns the head left or right. The head can be attached to the droid using magnets.

The size of the bigger ball's diameter is 17 centimeters. The smaller half ball is a cardboard ball that's diameter is 11 centimeters.

Choose Your Microcontroller!

DSCN0559.JPG

As said I'll show you the instructions with both microcontrollers, but I'll build the droid with the Arduino UNO. So if you want to add special effects like sound use a LinkIt ONE, but I recommend to use a well-known Arduino UNO with an Adafruit motor shield. Both circuits has advantages, like:

LinkIt ONE:

  • build-in Bluetooth
  • sound effects
  • light effects

But is incompatible with Adafruit motor shield, you'll need to make a motor shield... And can't move the head.

Arduino UNO:

  • motor shield compatible
  • light effects
  • much more realistic motion

If you use Arduino you'll need a HC-06 Serial Bluetooth module and you can't build in sound effects. In the next four steps I'll show how to use the LinkIt ONE with a DIY motor shield, so if you are an Arduino user skip these steps.


LinkIt ONE: Parts

DSCN0506.JPG
DSCN0507.JPG
F0KN1ERIH0YIDN1.LARGE.jpg
F15LKO1IH0YIDN0.LARGE.jpg

You'll need the following tools:

  • soldering iron
  • glue gun
  • wire stripper/cutter
  • PC with Arduino IDE and LinkIt ONE library

Parts:

The other parts are the same as the Arduino UNO users: motors, sphere, etc...

LinkIt ONE: the $1 Motor Driver

DSCN0520.JPG
DSCN0515.JPG
DSCN0508.JPG
L293d.PNG
DSCN0512.JPG
DSCN0511.JPG
DSCN0509.JPG
DSCN0513.JPG
DSCN0510.JPG
DSCN0517.JPG

Now you have to make this very low cost motor shield/driver. With this circuit you can control your motors in two directions: forward and backward. I marked the connection point between the LinkIt and the circuit: D5, D6, D10 and D11, these digital output pins can control the code with my code, So if the LinkIt One example pulls up the D6 to HIGH the motor starts.

LinkIt ONE: the Code

LinkIt.png
Code.png

After building the circuit download this or write an own code to recieve the bytes from the application. This code creates a bluetooth server, reads incoming bytes then reacts to them by moving the servo and motors, turning on light or sound effects.

LinkIt ONE: the Audio Amp for Sound Effect

68a8f5979bb4527c966edf78321ea8105b71af7e_large.jpg
DSCN0541.JPG
DSCN0542.JPG

Download BB8.mp3 file put on an SD card and plug in the LinkIt ONE.

If you want to add sound effect build this small circiut that amplifies the sound signal from the microcontroller. I couldn't build this circuit because I needed time for the Arduino Uno part, so I just made a quick test with my earphone, but if you have questions feel free to ask.

Downloads

LinkIt ONE External Battery

DSCN0572.JPG
DSCN0573.JPG
DSCN0574.JPG
DSCN0575.JPG
DSCN0577.JPG

You have to make a 7.4v battery for the motors. My solution was to connect two 18650 batteries in series.

LinkIt ONE: the Test

DSCN0537.JPG
DSCN0540.JPG
DSCN0530.JPG
DSCN0533.JPG
DSCN0532.JPG
DSCN0538.JPG

I used some motors to test the circuit and the coed and they worked fine. At first launch the servo had some issue, but after this worked without problems. The sound through the earphones was very good. Look at the video if you want to see how it works. With this step I finished the explanation and instructions for the LinkIt ONE. Go to the mechanism part to see how to build the droid.

Arduino UNO: Parts

DSCN0586.JPG
DSCN0662.JPG
DSCN0582.JPG
DSCN0647.JPG
DSCN0714.JPG
DSCN0678.JPG
DSCN0695.JPG
DSCN0727.JPG

You'll need the following tools:

  • soldering iron
  • glue gun
  • wire stripper/cutter
  • PC with Arduino IDE and Adafruit Motor Shield Library

Parts:

Electronics:

Mechanism:

  • Some Lego Parts
  • A Hamster Ball
  • A Plastic Globe (for head)
  • Srews and Zip Ties
  • Plastic or Plexy Glass sheets
  • Magnets

Appearence and Paint:

  • White Paint Spray
  • Black Paint
  • Blue and Orange Paint
  • Ping-Pong Ball (for eye)
  • Black Marker

Software:

For paint you can use anything or any technique, example: print the circles of BB-8 then glue on the spehe.

The Ardiuno Code

DSCN0588.JPG
Uno.png
Serial test.png

This part is easy for every Arduino users. Just download or copy-paste this code in your IDE then upload to your Arduino. Of course you can use Mega, Leaonardo, Duemilanove and etc... The concept is easy. The Arduino uses HC-06 serial module to read the data coming from the phone. Then reacts to the incoming bytes by moving motors or turning on/off lights. In the code I inserted some explanations, but if you have questions feel free to ask.

You can test the code and the Arduino if you open the Serial monitor and send a letter to the microcontroller. I sent "W" and the light turned on. When I sent "w" the light turned off. So the code worked.

<p>/* The code was made by Tamás Imets for an Arduino UNO project<br>   This code controls the BB-8 Droid from the Star Wars: The Force Awakens,
   and works with Bluetooth RC Car application, using a HC-06 serial bluetooth module
   See more details at instructables.com/member/Imetomi
   Friday,  December 25, 2015
 */</p><p>#include <servo.h>
#include <softwareserial.h>
#include <afmotor.h>
int command = 0;  //incoming serial data</afmotor.h></softwareserial.h></servo.h></p><p>AF_DCMotor motor1(1, MOTOR12_64KHZ); //initialize motor1 that is connected to the M1 port, this motor moves forward and backward
AF_DCMotor motor2(2, MOTOR12_64KHZ); //motor2 is connected to M2 and this turns BB-8 left and right
AF_DCMotor motorhead(3); //this motor turns the head left or right</p><p>Servo head;
void setup() {
  Serial.begin(9600); // set up Serial library at 9600 bps - this is the speed the serial interface will work all
  head.attach(9); //attach servo to pin D9 or to servo2 on motor shield
  motor1.setSpeed(255); //set default speed
  motor2.setSpeed(255); //set default speed
  motorhead.setSpeed(1); //the motor should spin very slowly
  pinMode(13, OUTPUT); //connect here the blue LED
}</p><p>void loop() {
  if (Serial.available() > 0) { //if the Arduino detects incoming data
    // read the incoming byte:
    command = Serial.read();
  }
  switch (command) //set different cases of the "command" variable
  {
    case 'S': {
        motor1.run(RELEASE); // stopped
        motor2.run(RELEASE); // stopped
        command = '*';
      } break;</p><p>    case 'F': { //go forward
        motor2.run(RELEASE);
        motor1.run(FORWARD);
      } break;</p><p>    case 'B': { //go backward
        motor2.run(RELEASE);
        motor1.run(BACKWARD);
      } break;</p><p>    case 'R': { //spin right
        motor1.run(RELEASE);
        motor2.run(FORWARD);
      } break;</p><p>    case 'L': { //spin left
        motor1.run(RELEASE);
        motor2.run(BACKWARD);
      } break;</p><p>    case 'G': { //forward left
        motor1.run(FORWARD);
        motor2.run(BACKWARD);
      } break;</p><p>    case 'I': { //forward right
        motor1.run(FORWARD);
        motor2.run(FORWARD);
      } break;</p><p>    case 'H': { //backward left
        motor1.run(BACKWARD);
        motor2.run(BACKWARD);
      } break;</p><p>    case 'J': { //backward right
        motor1.run(BACKWARD);
        motor2.run(FORWARD);
      } break;</p><p>    case 'W': {
        digitalWrite(13, HIGH); //lights on
      } break;</p><p>    case 'w': {
        digitalWrite(13, LOW); //lights off
      } break;</p><p>    case 'U': {
        motor1.setSpeed(180); //set lower speed
      } break;</p><p>    case 'u': {
        motor1.setSpeed(255); //set max speed
      } break;</p><p>    case 'V': {
        motorhead.run(FORWARD); //turn head left
      } break;</p><p>    case 'v': {
        motorhead.run(RELEASE); //stop spinning
      } break;</p><p>    case 'X': {
        motorhead.run(BACKWARD); //turn head right
      } break;</p><p>    case 'x': {
        motorhead.run(RELEASE); //stop spinning
      } break;</p><p>    case '0': {
        head.write(95); //basic servo state
      } break;</p><p>    case '1': {
        head.write(50); //move servo
      } break;</p><p>    case '2': {
        head.write(60); //move servo
      } break;</p><p>    case '3': {
        head.write(70); //move servo
      } break;</p><p>    case '4': {
        head.write(80); //move servo
      } break;</p><p>    case '5': {
        head.write(90); //move servo
      } break;</p><p>    case '6': {
        head.write(95); //move servo
      } break;</p><p>    case '7': {
        head.write(110); //move servo
      } break;</p><p>    case '8': {
        head.write(120); //move servo
      } break;</p><p>    case '9': {
        head.write(130); //move servo
      } break;</p><p>    case 'q': {
        head.write(135); //move servo
      } break;
      //you can add more extra feautres by writing a case command (example: different lights, sound, etc...)
  }
}</p>

Choosing the Power Source

DSCN0568.JPG
DSCN0569.JPG
DSCN0570.JPG

If you have, you can use old cell phone batteries for the power source but I reccomned 18650 cells. I chosed those Panasonic batteries, that were salvaged from an old laptop

Build the Power Source

DSCN0579.JPG
DSCN0571.JPG
DSCN0580.JPG
DSCN0581.JPG
DSCN0698.JPG

The recipe is simple: connect the batteries in series the solder the wires to the 5.5mm power jack. Now you have a 7.4v rechargeable power supply. You can charge up with 8.4 voltpower supply.

Choosing Motors

DSCN0583.JPG
DSCN0560.JPG
DSCN0585.JPG

It was very hard to choose the right motors for this project. I needed motors with gearing that are enough powerful to move that very heavy sphere. Finally I bought 2 geared motors from the Amazon and they were very efficient. You should buy three of them to solve the steering problem.

The Circuit (Hardwere Part)

DSCN0578.JPG
circuit.jpg
DSCN0632.JPG
DSCN0633.JPG
DSCN0630.JPG
DSCN0631.JPG
DSCN0629.JPG

I soldered some extra legs for the Arduino I/O pins: D13, 5v, 3.3v, GND, RX, TX. Using these extra connection legs I was able to connect easily the bluetooth module and the LED. If you have a different Arduino you have to look for another solution. Connect everything to the Arduino just like on the schematic.

The Motor Shield

DSCN0628.JPG
DSCN0635.JPG
DSCN0637.JPG
DSCN0638.JPG
DSCN0639.JPG

Important note: Later I changed the grey motor. Use a third geared motor. "Difficult to see, always in motion is the future"-Master Yoda

Back to the project: Connect the servo motor to SERVO_2, two motors to the M1 and one motor to the M2. The to yellow motors are connected to the M1. These motors move the droid forward and backward.

A Quick Test

DSCN0640.JPG
DSCN0642.JPG
DSCN0645.JPG
DSCN0529.JPG

Use your smartphone with the downloaded app then connect to the microcontroller. Press any button that controls a motor. If worked go and build the sphere.

The Mechanism

DSCN0648.JPG
DSCN0663.JPG
DSCN0664.JPG
DSCN0668.JPG
DSCN0669.JPG
DSCN0670.JPG

I took apart the hamster ball, then using the Lego parts I suited the motor to the ball. Why use Lego parts? Well it's very eaasy to take apart the droid is is needed. With a glue gun Iconnected the larger Lego part to the sphere and smaller is connected directly to the motor without glue.

The Body in the Sphere

DSCN0671.JPG
DSCN0673.JPG
DSCN0675.JPG
DSCN0677.JPG
DSCN0696.JPG
DSCN0702.JPG
DSCN0681.JPG

This is a tricky part: Cut two pieces of plastic and glue to the motors. The diameter of my sphere is 17cm so I used a 13cm long plastic piece. It was perfect for my droid. While working I removed the motor shield for a short time. Using ome screws and a zip tie I siuted the microcontroller to the body. The zip tie holds the the Arduino and the bluetooth module in place. The batteries will be installed later.

Steering

DSCN0694.JPG
DSCN0697.JPG
DSCN0739.JPG
DSCN0703.JPG
DSCN0704.JPG
DSCN0707.JPG
DSCN0706.JPG

The time has come, use the Force or your glue gun and glue that third motor to the body. As you can see the motor and the gearing system is free, only the ending, the moving part is glued to the body. To that black motor system we'll connect the batteries. The batteries doubles as a power source and weight for steering.

The Servo

DSCN0718.JPG
DSCN0719.JPG
DSCN0720.JPG
DSCN0733.JPG
DSCN0737.JPG
DSCN0735.JPG

The role of the servo motor is to hold or tilt the head on the sphere. I used hot glue agian and glued the motor in the center of the body. Then with some plastic and two magnets I created a holding element. This stick will hold the head on the top in one place.

The head can be used to adjust the speed of the droid. If is placed in the front of the droid, will move much more faster.

Optional Upgrade (head Spin)

DSCN0650.JPG
DSCN0657.JPG
DSCN0656.JPG
DSCN0653.JPG
DSCN0725.JPG
DSCN0658.JPG

If you have a small motor like on the pictures., you can add an extra function to your droid. I made a plastic frame for it and glued the magnets on the top moving part. Attach this to M3 and to the servo motor.

Note: I continue the Instructable without this, unfortunately my motor burned out.

The Head

DSCN0715.JPG
DSCN0717.JPG
DSCN0729.JPG
DSCN0730.JPG
DSCN0731.JPG
DSCN0732.JPG
DSCN0734.JPG

Cut the globe in half, then clean from the paper. You can use now anything as a holding element, I used plastic again and glued together with the magnets. If you want you can add Lego wheels for better motion. The wheels make the rotation much more easier.

Quick Test (Again)

DSCN0713.JPG
DSCN0565.JPG
DSCN0740.JPG
DSCN0741.JPG
DSCN0742.JPG
DSCN0743.JPG

Use the power of the Dark side or electricity and charge up the batteries. On the first picture you can see that I charged up my battery pack using a small variable power supply. After 2 hours the battery was charged up with 400mA charging current.

If your droid is ready try it out. Put the head on the ball then try to control with the phone. First time was tricky, but after about five minutes was very easy. The head moved very

Adding Some Extra Weight for Better Steering

DSCN0001.JPG
DSCN0003.JPG
DSCN0004.JPG
DSCN0005.JPG
DSCN0006.JPG

As you see a took some metal srews and simply glued on the electronics. Now my spere will move little bit faster, and it's much more easier to steer.

Preparing for Paint

DSCN0096.JPG
DSCN0088.JPG
DSCN0090.JPG
DSCN0092.JPG
DSCN0091.JPG
DSCN0093.JPG
DSCN0089.JPG
DSCN0008.JPG

On this hamster ball were a lot of holes to ensure enough fresh air or the pet, but we don't need these holes now so I simlply neautralyzed them using some ductape. Worked well!

Painting

IMG_20160107_130418.jpg
IMG_20160107_130406.jpg
IMG_20160107_130414.jpg
DSCN0097.JPG
DSCN0098.JPG

I took apart the board then I painted the entire chasics with a white paint spray. That was easy but I needed to paint two times to fix the errors caused by the ductspe. So remove the ductape, fill the holes woth silicon (from glue gun) then paint again.

Note: The painting was the hardest part for me, but I fixed everything while working. So I survived...

The Pattern

DSCN0106.JPG
DSCN0115.JPG
DSCN0117.JPG
DSCN0108.JPG
DSCN0111.JPG
DSCN0112.JPG

Download the attached .pdf file then print it on a self-adhesife plastic sheet just like me. I haven't at home a paper like this, so I went to the local printer office and I printed the patterns for about 0.8 bucks. After printing take a cutter or scrissors and cut every single part. Of course you'll need all six circles.

Downloads

Gluing the Pattern

DSCN0122.JPG
DSCN0119.JPG
DSCN0113.JPG
DSCN0118.JPG
DSCN0123.JPG
5695595e50e1b652510006e9.jpeg

When you are done with the cutting put the patterns on the droid. I cut every circles in four parts to beware the creases.

The Eyes

DSCN0135.JPG
DSCN0127.JPG
DSCN0126.JPG
DSCN0128.JPG
DSCN0129.JPG
DSCN0130.JPG
DSCN0134.JPG
DSCN0131.JPG

Using some styrofoam I made the two eyes and paintend them with a black paint spray. They look pretty nice.

The Head Pattern

DSCN0140.JPG
DSCN0139.JPG
DSCN0150.JPG
DSCN0160.JPG
DSCN0166.JPG
DSCN0168.JPG
DSCN0172.JPG
DSCN0169.JPG
DSCN0161.JPG
DSCN0141.JPG

First glue the eyes on the head. Use super glue. I painted the remaing self-adhesive paper with orange and grey colors. Using a calliper I made the patterns that were needed for the head. Using a cutter I tried to cut perfect these patterns.

Decoration of the Head

DSCN0162.JPG
DSCN0163.JPG
DSCN0164.JPG
DSCN0165.JPG

Put the grey circle on the head then using a marker make some lines on it.

Still Decorating...

DSCN0171.JPG
DSCN0176.JPG
DSCN0173.JPG
DSCN0174.JPG
DSCN0175.JPG
DSCN0178.JPG
DSCN0180.JPG
DSCN0179.JPG

I think this step doesn't need any extra explanations, just follow the pictures. I used two small white straws as antennas.

Details on the Body

DSCN0159.JPG
DSCN0151.JPG
DSCN0152.JPG
DSCN0154.JPG
DSCN0155.JPG
DSCN0153.JPG
DSCN0156.JPG

With a marker I made dottles and the lines that were on BB-8. Then I used a brush to make the lines paler to earn a dirty effect. In the movie he was very dirty.

How to Use the App?

Screenshot_2015-12-23-19-19-06.png
Screenshot_2016-01-19-21-16-09.png
Screenshot_2015-12-23-19-19-13.png
Screenshot_2015-12-23-19-19-45.png
Screenshot_2015-12-23-19-21-51.png
Screenshot_2015-12-23-19-22-09.png
Screenshot_2015-12-25-15-19-15.png

I can gaurantee that is very easy to use the app. Connect to your BB-8 then control it.

Download the Full PDF Instruction

If you want to print the instructions, download this PDF file then print it.

My Future Plans - MindWave Controlled Droid

DSCN0206.JPG
DSCN0211.JPG
DSCN0213.JPG
DSCN0214.JPG

Now I'm working on a project using a hacked Necomimi toy, that is able to read brainwaves. I'll try to build a device that can control more than one thing using thoughts. This would be the world's first Multifunctional Brainwave Controlled System. And I'm very close to rech my goal, I made an algorith using Arduino that is able to read the different thoughts: When I think on a color example RED, the brain has a different Aplha. The BLUE and the YELLOW and GREEN has different signals too. So maybe BLUE will be forward, RED backward and etc...

An Arduino Nano will send the data to a Leonardo board that can send the incoming data forward to the PC or to the droid. So I hope I'll be able to control the cursor and the droid and a home automation system with my thoughts. Well this is a secret project, so I won't share more details now, but I'll be done in a few weeks.

This Is Droid You Are Looking For!

DSCN0196.JPG
DSCN0198.JPG
DSCN0188.JPG
DSCN0200.JPG
DSCN0183.JPG
DSCN0208.JPG
DSCN0191.JPG

Thank you for watching my Instructable. I really hope you liked it. I'll add a video an some new explanations tomorrow. If you liked give me a kindly vote! Have fun with this droid.

May the Force be with you!