Introduction: Wall-e

Here is the instructions to make Wall-e! a robot that can move, eat trash, make sounds and light up!


Video Link:

Wal-E Video.mp4 (sharepoint.com)

Video Also Linked Here


Supplies

Using at least three Sparkfun Inventor kits and Cardboard.

For the Body:

  • 2  2x10x12 cardboard boxes 
  • 2 wheels 
  • Pushpins (if desired to use instead of screws) 
  • Scissors or a boxcutter/xacto 
  • Glue (prefferably hot glue) 
  • Paint (If Desired 

For the Wiring:

Motor:

Items from SparkFun Inventor's Kit: Arduino (redboard and other similar Arduino-like models work), tw o gearmotors, one motor driver, 15 jumper cables and a push button

Arms:

2 Servos from Sparkfun kit(s), a push button and 10 jumper wires.

Lights and Sound:

Piezo Speaker, jumper wires, and four LEDS, sparkfun kit and

Step 1: Create Body

After creating the basic cardboard box as instructed, use the following steps to complete your WAL-E: 

1.) Create a 1 cm deep slitat the front portion of the lid so that wal-e's eyes can peek out 

2.) to make the goggles for the eyes, trace out a goggle shape that you like and cut it out. Make 2 of these goggle shapes and cut a hole out for the eyes on one of them. Next, glue cardboard around the edges, leaving space on one end to line up with the slit for the eyes. Get creative! You can use masking tape or leftover lamination to make the goggles look like clear glass 

3.) glue the goggles so that the slit matches up with the open space. Heres an example: 


4.) set up the interior where you place the boards and battery packs so that the board with the lights sits up front. The lights should be able to slide right into the eye slit when you close the lid. It may be necessary to bend the lights a little or to make the light board a little box so it sits up higher. 

5.) begin creating the back motor mount. All you have to do is trace the motor on some extra cardboard, cut it out, and glue it to the back of the WAL-E box. 

6.) create the front motor mounts by cutting out a square about 2inx2in on each side. Then, after measuring the size of your servo motor, make two cardboard strips and glue them inside of the hole. Make sure that one motor mount is upside down! You can attach motors with the screws in you kit or even some small pushpins! Here are some photos of our motor mounts: 

7.) If you want to paint your WALL-E make sure you do so before you attach any motors or boards so that you don’t get paint on them. 

8.) get creative and have fun! 

Step 2: Wiring Part 1: Lights + Sound

1) Set up your Arduino kit like the picture above is displayed 

2) Download the code to your computer 

3) Open tinker cad and upload the code to ensure that the code is running smoothly 

4) Upload code to Arduino board 

5) once code is uploaded and everything is running smoothly, attach the Arduino board to the cardboard box, and follow directions from there 


Code:

int Left_WHITE_LED = 12; 

int Left_Yellow_LED = 11; 

int Right_White_LED = 10; 

int Right_Yellow_LED = 9; 

int Speaker = 7; 

void setup() 

pinMode(7,OUTPUT); 

pinMode(Left_WHITE_LED, OUTPUT); 

pinMode(Left_Yellow_LED, OUTPUT); 

pinMode(Right_White_LED, OUTPUT); 

pinMode(Right_Yellow_LED, OUTPUT); 

pinMode(2, INPUT_PULLUP); 

void loop() 

   digitalWrite(Left_WHITE_LED, HIGH); 

   digitalWrite(Left_Yellow_LED, HIGH); 

   digitalWrite(Right_White_LED, HIGH); 

   digitalWrite(Right_Yellow_LED, HIGH); 

  delay(2000); 

   digitalWrite(Left_WHITE_LED, LOW); 

   digitalWrite(Left_Yellow_LED, LOW); 

   digitalWrite(Right_White_LED, HIGH); 

   digitalWrite(Right_Yellow_LED, HIGH); 

  delay(2000); 

   digitalWrite(Left_WHITE_LED, HIGH); 

   digitalWrite(Left_Yellow_LED, HIGH); 

   digitalWrite(Right_White_LED, LOW); 

   digitalWrite(Right_Yellow_LED, LOW); 

  delay(1000); 

   digitalWrite(Left_WHITE_LED, HIGH); 

   digitalWrite(Left_Yellow_LED, HIGH); 

   digitalWrite(Right_White_LED, HIGH); 

   digitalWrite(Right_Yellow_LED, HIGH); 

  tone(7,147,500); 

  delay(1000); 

  tone(7,147,500); 

  delay(1000); 

  tone(7,147,500); 

  delay(1000); 

  tone(7,147,1000); 

  delay(2000); 

  tone(7,147,1000); 

  delay(2000); 

  tone(7,147,1000); 

  delay(2000); 

  tone(7,165,1000); 

  delay(2000); 

  tone(7,165,1000); 

  delay(2000); 

  tone(7,196,1000); 

  delay(2000); 

  tone(7,196,2000); 

  delay(2000); 

  tone(7,175,1000); 

  delay(2000); 

  tone(7,220,3000); 

  delay(2000); 

Step 3: Wiring Part 2: Moving Wheels

Items from SparkFun Inventor's Kit: Arduino (redboard and other similar Arduino-like models work), tw o gearmotors, one motor driver, 15 jumper cables and a push button

Step 1: Assembly Follow the wiring diagram

Step 2: Copy the code below code associated with this build

Step 3: Mount Mount the wheel system onto the carboard mounts for wall-e indicated in the cardboard instructions fo r placement of the gear motor


Code:

Moving Wheels: 

// set up integers 

int AIN1 = 13; 

int AIN2 = 12; 

int PWMA = 11; 

int BIN1 = 9; 

int BIN2 = 8; 

int PWMB = 10; 

int buttonpin = 2; 

int buttval; 

void setup() { 

// Set motor pins as output. 

  pinMode(AIN1, OUTPUT); 

  pinMode(AIN2, OUTPUT); 

  pinMode(PWMA, OUTPUT); 

  pinMode(BIN1, OUTPUT); 

  pinMode(BIN2, OUTPUT); 

  pinMode(PWMB, OUTPUT); 

// Set button pin as a input. 

  pinMode(buttonpin, INPUT_PULLUP); 

  Serial.begin(9600); 

void loop() { 

  buttval = digitalRead(buttonpin); 

  Serial.println(buttval); 

 int i = 0; 

 if (buttval == LOW) { // Button pressed 

   for (int i = 0; i < 25; i++) { 

     // spin forward, if motors spin in opposite directions switch the high and low values for BIN1 and BIN2 

      digitalWrite(AIN1, HIGH); 

      digitalWrite(AIN2, LOW); 

      analogWrite(PWMA, 250); 

      digitalWrite(BIN1, HIGH); 

      digitalWrite(BIN2, LOW); 

      analogWrite(PWMB, 250); 

     delay(1000); 

   } 

 } else (i > 25);{ 

   // stop spinning 

    digitalWrite(AIN1, LOW); 

    digitalWrite(AIN2, LOW); 

    analogWrite(PWMA, 0); 

    digitalWrite(BIN1, LOW); 

    digitalWrite(BIN2, LOW); 

    analogWrite(PWMB, 0); 

   delay(1000); 

 } 

Step 4: Wiring Part 3: Moving Arms

For assembling the electrical assembly for the arms for the combined Wall-E project.

Item's are from the SparkFun Inventor's Kit. These items include an Arduino UNO, Breadboard, 12 jumper cables, push button, and two servos.

Use the following Wiring Diagram to wire the system. 5V Wire from the Arduino goes to the RED PLUS sign pin lines and the GND pin goes to the BLACK MINUS sign pin lines.

Copy Code Below

Mount the Arduino kit on top and inside the opening flap and set the servos into their corresponding locations on the left and right mounts. Use tape, hot glue, or any sort of temporary adhesive depending on preference of adherence.

Code

#include <Servo.h> // Include the Servo library for controlling servos 

Servo myservo; // Create a Servo object named myservo 

Servo myservo2; // Create another Servo object named myservo2 

int servo1pin = 9; // Define the pin to which the first servo is connected 

int servo2pin = 8; // Define the pin to which the second servo is connected 

int buttonpin = 2; // Define the pin to which the button is connected 

int pos; // Variable to store the position of the first servo 

int pos2; // Variable to store the position of the second servo 

int buttval; // Variable to store the state of the button (HIGH or LOW) 

void setup() { 

  Serial.begin(9600); // Initialize serial communication at 9600 baud 

  pinMode(buttonpin, INPUT_PULLUP); // Set the buttonpin as input with internal pull-up resistor enabled 

  myservo.attach(servo1pin); // Attach the first servo to its pin 

 myservo2.attach(servo2pin); // Attach the second servo to its pin 

void loop() { 

  buttval = digitalRead(buttonpin); // Read the state of the button 

  Serial.println(buttval); // Print the state of the button to the serial monitor 

 pos = 90; // Set initial position for the first servo 

 pos2 = 90; // Set initial position for the second servo 

 if(buttval == LOW) { // Check if the button is pressed (active LOW) 

    myservo.write(pos); // Move the first servo to the specified position 

   myservo2.write(pos2); // Move the second servo to the specified position 

   delay(5000); // Delay for 5 seconds 

 } else { // If the button is not pressed 

    myservo.write(0); // Set the first servo position to 0 degrees 

   myservo2.write(0); // Set the second servo position to 0 degrees 

 } 

Step 5: Mounting the Circuit Boards

Last step is to attach all the boards. in the top area where the opening was created during the body creation. There you will need to use 12 AA batteries for the three circuit boards used. Line up the lights and sound board to be inside wall-e's eyes, etc. Follow step one to see where and how everything else goes.


And now... you have a "replica" of Wall-E!