Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
arduino_mastermind
Published © GPL3+

ardu-d2

All of us just love r2d2 from star wars- why not build your own!

IntermediateFull instructions provided304
ardu-d2

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
you can use any arduino- clone or original. i have used the older original version.
×1
Geared DC Motor, 12 V
Geared DC Motor, 12 V
i have used the common yellow gear motor
×2
Maker Essentials - Micro-motors & Grippy Wheels
Pimoroni Maker Essentials - Micro-motors & Grippy Wheels
you can use the standard gear motor wheels too.
×2
9V battery (generic)
9V battery (generic)
you can also use 2 batteries for each motor.
×1
9V Battery Clip
9V Battery Clip
×1
Tinned Copper Wire, Solid
Tinned Copper Wire, Solid
you can also use plain wire that you commonly get in shops.
×1
Battery Holder, AA x 2
Battery Holder, AA x 2
×1
LED, RGB
LED, RGB
if you dont have this type of rgb you may use any other colour or another rgb.
×1
Toggle Switch, Toggle
Toggle Switch, Toggle
you may use any switch of your choice.
×2
SG90 Micro-servo motor
SG90 Micro-servo motor
×1
9V to Barrel Jack Connector
9V to Barrel Jack Connector
you may also use a usb or any other suitable power source for your arduino.
×1
Jumper wires (generic)
Jumper wires (generic)
use male to male jumpers.
×1

Software apps and online services

Arduino IDE
Arduino IDE
you can also use the arduino web editor or any other suitable app.

Hand tools and fabrication machines

Scissor, Electrician
Scissor, Electrician
any scissor will do.
Hot glue gun (generic)
Hot glue gun (generic)
you can also use any other super glue, if you do not have a glue gun.
Wire Stripper, High Carbon Steel
Wire Stripper, High Carbon Steel
any other wire cutter, or a scissor will also suffice.
Drill, Screwdriver
Drill, Screwdriver
any drill will do. also, you can use a hot iron or soldering iron to make holes.
Tape Measure, Manual
Tape Measure, Manual
You may also use a scale.

Story

Read more

Schematics

motor diagram, led diagram, servo diagram

these are the diagrams. use as instructed above.

led diagram

servo diagram

Code

code for the servo motor

C/C++
this is the code for the servo motor- connect the servo as instructed and then upload.
this is the copied code of the "SWEEP" program in arduino ide. you may use that code too- wont make much of a difference
/* Sweep
 by BARRAGAN <http://barraganstudio.com>
 This example code is in the public domain.

 modified 8 Nov 2013
 by Scott Fitzgerald
 http://www.arduino.cc/en/Tutorial/Sweep
*/

#include <Servo.h>

Servo myservo;  // create servo object to control a servo
// twelve servo objects can be created on most boards

int pos = 0;    // variable to store the servo position

void setup() {
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object
}

void loop() {
  for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
    // in steps of 1 degree
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
  for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
}

Credits

arduino_mastermind
1 project • 0 followers
Contact

Comments

Please log in or sign up to comment.