Skip to the content.

Bluestamp WALLE robot

A simple emotional robot that can interact with the user. With 2 8x8 LED eyes and servo-controlled eyebrows, this robot is great at conveying emotions and makes for an interesting project. Using a 3D model and many electrical components, the robot can display emotion and move according to the distance you are from him. As for my modifications, I added a Bluetooth module and wheels, so I could control my robot remotely via phone. A lot of takeaways, as this was the first Arduino project where I used servos and an ultrasonic sensor, gave me a lot of insight into how these parts function and how to use them. Additionally learned a lot of useful skills such as soldering, dremeling, and drilling.

Engineer School Area of Interest Grade
Roger J Valley Christian Electrical Engineering Incoming Junior

Headstone Image

Modification Two

For my second modification, I transformed my robot by attaching tank treads instead of regular wheels, making it resemble Wall-E from the Pixar movies. This addition required me to assemble the frame using various types of screws and standoffs to elevate the robot, preventing it from contacting the treads. After securing the Wall-E robot on the tank tread frame, I encountered a new challenge: the motor driver had no designated place and was awkwardly hanging around. To solve this, I drilled holes in the bottom of the robot to accommodate the motor driver and the standoffs. Another issue arose with the power supply. Initially, the Arduino was powered by my computer, but this setup limited the robot’s mobility due to the short wire length. I resolved this by attaching a 9V battery to the Arduino, allowing it to operate independently of my computer. Additionally, I coded the Bluetooth module to include wheel turning functionality. The final result was a Wall-E robot capable of displaying different emotions using an ultrasonic sensor and Bluetooth, while also being able to move via Bluetooth control.

Modification One

I added Bluetooth module yahoo! For this modification, I added a Bluetooth module to the Arduino. This allows the Arduino to receive Bluetooth commands, so you can potentially control it with any device as long as it is connected. The Bluetooth model I used was the HM-10. I had to connect the Bluetooth module to the input pins, and a problem I faced doing this was that I couldn’t actually upload code to the Arduino while the input pin was taken. It took me a while to figure this out, but you could just unplug the input pin and upload the code, then plug it in back after. I also had to edit my code to match the addition of the Bluetooth module. At first, my code only worked separately, but eventually after some bugfixing, I made my code work with both the ultrasonic sensor and Bluetooth module. Additionally, throughout the duration of working on this modification, I also made a few other changes to my project. For example, I dremeled around the “eye sockets” of the robot and made the hole a bit bigger so the entirety of the LED could fit. For my next mod, I want to add some Walle-like wheels so it can actually look like the Walle robot we see in Pixar movies.

Final Milestone

For my final milestone, I completed both the 3D model and the electrical components. It was definitely a long process as I had to make all my electrical wiring fit inside a box, then connect the servos with the box, then making a mount for the “neck” of the robot. Finally, I the LEDs and the LCD using a variety of screws until it turned into my finished project. This process was definetely not without hardships, as I ran into many challenges completeing my 3rd milestone. The first problem was finding screws, as my project incorporated a lot of different screws of different sizes and length, and did not use a consistent one throughout the project. I had to search tons of boxes of screws to find the ones I needed, and even then, a lot of the screws didn’t even fit. I solved this problem by using a screwdiver to widen the holes of my 3D printed model. It look a lot of time but in the end it worked out. Another problem I faced was that I accidentally soldered the battery wires into the breadboard, and this caused the power to not be transferred throughly, and I fixed it by desoldering the wires and soldering to a male to male wire instead. I also used some heat shrink and a heat gun to connect the wires. Now, finally with these wires, the power problem was fixed and the servos started working again. Some key things I learned during the completion of the project was to always organized your wires, makes debugging a lot easier. Also, you shouldn’t solder things directly to the breadboard, as it is error prone and also not very flexible. Additionally, one of the most important things I learned from this experience is that you should always think things through before you do it, as I didn’t do this and had to take a lot of my project apart just to attach one minor thing as I didn’t plan ahead and think about the future. But overall, it was a great process, as I got many things to work and learned a great deal, and completeing the project was an accomplishment that I am very proud of. Some key topics I hope to learn in the future is to start CADDING and potentially design these types of 3D models for myself, and I think I can do many great things with it.

Second Milestone

Since my first milestone, I’ve worked on mostly the code for my WALLE robot. I wrote code for the ultrasonic sensor work to calcuate distance and linked it to the other parts of my project. I also coded all the other parts of my project, such as the LED displays, made functions for the sensors, and also made the LCD different text accordingly. Now based on the distance from the ultrasonic sensor, the LED will display different emotions, the servos will turn accordingly, and the LCD will also display text accordingly. One challenge that I faced was that when I first coded the project, the LED would flash repeatedly and be very inconsistent. The reason for this is that the ultrasonic sensors send out waves and measure the time for them to bounce back in order to find the distance, but there are some moments where the sensor isn’t detecting anything as the waves are bouncing back, causing everything to flash. I fixed this problem by adding a delay for all the functions so the ultrasonic sensors wouldn’t go crazy. My final step until finishing the project is just to get the 3D models and put the whole thing together.

First Milestone

For my first milestone, I wired all the parts to the breadboard and the Arduino Uno. I connected the Servos, the LCD, the 8 by 8 LEDs via soldering, and connected the battery to the breadboard to power the servos, as the Arduino doesn’t provide enough power to power all the servos. I also wrote some rough code to make sure all the parts worked. I got the servos to turn by connecting them to the battery and the Arduino, the LEDs to light up with patterns(instead of linking both together I just connected both of them separately to the Arduino using the digital pins), and the LCD to display text after importing a few libraries. One challenge that I faced was that my LEDs did not match the schematic, so I had to research online to find out which pins they went in. Furthermore, I also had to look at the LedControl libraries and write my own code as my circuit was slightly different from the guide. Another challenge was that the many wires that I had used made the circuit very messy and very difficult to navigate, however, I solved by using shorter wires whenever possible. Eventually, the LED should be able to display patterns mimicking eyes, the LCD should be able to display text accordingly, the servos should allow the robot to turn its head, and finally, an ultrasonic sensor will be installed so the robot can gauge how close you are to it. My next milestone would be to code everything so it can finally become like a robot.

Schematics

Book logo

Schematic 2

Code


#include <Servo.h>
#include "LedControl.h"
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <SoftwareSerial.h>

//sensor stuff
float pulse_width, distance;

// Initialize Bluetooth
SoftwareSerial HM10(0, 1);
char appData;  
String inData = "";

// Initialize servos
Servo pan;  
Servo tilt;
Servo leftBrow;
Servo rightBrow;

// Define pins for LED matrix
int DIN = 13;
int CS = 12;
int CLK = 11;

// Define pins for ultrasonic sensor
const int triggerPin = 7;
const int echoPin = 8;

// Initialize LCD
LiquidCrystal_I2C lcd(0x27, 16, 2);

// Initialize LED matrix
LedControl lc2 = LedControl(13, 11, 12, 1);
LedControl lc = LedControl(2, 10, 9, 1);

void happy() {
  // Define happy face pattern
  lc.setRow(0, 0, B00000000);
  lc.setRow(0, 1, B00011100);
  lc.setRow(0, 2, B00100100);
  lc.setRow(0, 3, B01011100);
  lc.setRow(0, 4, B01011100);
  lc.setRow(0, 5, B00100100);
  lc.setRow(0, 6, B00011100);
  lc.setRow(0, 7, B00000000);
  lc2.setRow(0, 0, B00000000);
  lc2.setRow(0, 1, B00011100);
  lc2.setRow(0, 2, B00100100);
  lc2.setRow(0, 3, B01011100);
  lc2.setRow(0, 4, B01011100);
  lc2.setRow(0, 5, B00100100);
  lc2.setRow(0, 6, B00011100);
  lc2.setRow(0, 7, B00000000);
}

void angry() {
  // Define angry face pattern
  lc.setRow(0, 0, B00000000);
  lc.setRow(0, 1, B01110000);
  lc.setRow(0, 2, B01111000);
  lc.setRow(0, 3, B01111100);
  lc.setRow(0, 4, B01111100);
  lc.setRow(0, 5, B00111110);
  lc.setRow(0, 6, B00001110);
  lc.setRow(0, 7, B00000000);
  lc2.setRow(0, 0, B00000000);
  lc2.setRow(0, 1, B00001110);
  lc2.setRow(0, 2, B00011110);
  lc2.setRow(0, 3, B00111110);
  lc2.setRow(0, 4, B00111110);
  lc2.setRow(0, 5, B01111100);
  lc2.setRow(0, 6, B01110000);
  lc2.setRow(0, 7, B00000000);
}

void neutral() { // Corrected function name
  // Define neutral face pattern
  lc.setRow(0, 0, B00000000);
  lc.setRow(0, 1, B00111100);
  lc.setRow(0, 2, B01000010);
  lc.setRow(0, 3, B01011010);
  lc.setRow(0, 4, B01011010);
  lc.setRow(0, 5, B01000010);
  lc.setRow(0, 6, B00111100);
  lc.setRow(0, 7, B00000000);
  lc2.setRow(0, 0, B00000000);
  lc2.setRow(0, 1, B00111100);
  lc2.setRow(0, 2, B01000010);
  lc2.setRow(0, 3, B01011010);
  lc2.setRow(0, 4, B01011010);
  lc2.setRow(0, 5, B01000010);
  lc2.setRow(0, 6, B00111100);
  lc2.setRow(0, 7, B00000000);
}

void surprised() {
  // Define surprised face pattern
  lc.setRow(0, 0, B01111110);
  lc.setRow(0, 1, B10000001);
  lc.setRow(0, 2, B10000001);
  lc.setRow(0, 3, B10011001);
  lc.setRow(0, 4, B10011001);
  lc.setRow(0, 5, B10000001);
  lc.setRow(0, 6, B10000001);
  lc.setRow(0, 7, B01111110);
  lc2.setRow(0, 0, B01111110);
  lc2.setRow(0, 1, B10000001);
  lc2.setRow(0, 2, B10000001);
  lc2.setRow(0, 3, B10011001);
  lc2.setRow(0, 4, B10011001);
  lc2.setRow(0, 5, B10000001);
  lc2.setRow(0, 6, B10000001);
  lc2.setRow(0, 7, B01111110);
}

void sad() {
  // Define sad face pattern
  lc.setRow(0, 0, B00000000);
  lc.setRow(0, 1, B00111100);
  lc.setRow(0, 2, B01000010);
  lc.setRow(0, 3, B01011010);
  lc.setRow(0, 4, B00111010);
  lc.setRow(0, 5, B00010010);
  lc.setRow(0, 6, B00001100);
  lc.setRow(0, 7, B00000000);
  lc2.setRow(0, 0, B00000000);
  lc2.setRow(0, 1, B00001100);
  lc2.setRow(0, 2, B00010010);
  lc2.setRow(0, 3, B00111010);
  lc2.setRow(0, 4, B01011010);
  lc2.setRow(0, 5, B01000010);
  lc2.setRow(0, 6, B00111100);
  lc2.setRow(0, 7, B00000000);
}

void love() {
  // Define love face pattern
  lc.setRow(0, 0, B01111000);
  lc.setRow(0, 1, B10000100);
  lc.setRow(0, 2, B10000010);
  lc.setRow(0, 3, B01011001);
  lc.setRow(0, 4, B01011001);
  lc.setRow(0, 5, B10000010);
  lc.setRow(0, 6, B10000100);
  lc.setRow(0, 7, B01111000);
  lc2.setRow(0, 0, B01111000);
  lc2.setRow(0, 1, B10000100);
  lc2.setRow(0, 2, B10000010);
  lc2.setRow(0, 3, B01011001);
  lc2.setRow(0, 4, B01011001);
  lc2.setRow(0, 5, B10000010);
  lc2.setRow(0, 6, B10000100);
  lc2.setRow(0, 7, B01111000);
}

void setup() {
  // Initialize serial communication
  Serial.begin(9600);
  HM10.begin(9600);

  // Initialize LCD
  lcd.init();
  lcd.backlight();
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Wassup guys:)");

  // Wake up the MAX72XX from power-saving mode
  lc.shutdown(0, false);
  lc2.shutdown(0, false);

  // Set a medium brightness for the LEDs
  lc.setIntensity(0, 8);
  lc2.setIntensity(0, 8);

  // Attach servos
  leftBrow.attach(3);
  rightBrow.attach(4);
  pan.attach(5);
  tilt.attach(6);

  // Initialize ultrasonic sensor
  pinMode(triggerPin, OUTPUT);  
  pinMode(echoPin, INPUT);  
}

void loop() {
  inData = "";
  HM10.listen();
  while (HM10.available() > 0) {
    appData = HM10.read();
    inData = String(appData);
    Serial.write(appData);
  }

  if (Serial.available()) {
    delay(10);
    HM10.write(Serial.read());
  }

  // Send trigger pulse to ultrasonic sensor
  digitalWrite(triggerPin, LOW);  
  delayMicroseconds(2);  
  digitalWrite(triggerPin, HIGH);  
  delayMicroseconds(10);  
  digitalWrite(triggerPin, LOW); 

  // Check for Bluetooth commands and update display and servos accordingly
  if(inData != ""){
    if (inData == "A") {
      lcd.clear();
      angry();
      lcd.print("Get back!");
      moveServos(50, 140, 150, 30);
      delay(2000);
    } else if (inData == "B") {
      lcd.clear();
      surprised();
      lcd.print("Why u so close?");
      moveServos(120, 60, 170, 40);
      delay(2000);
    } else if (inData == "C") {
      lcd.clear();
      love();
      lcd.print("I love you <3");
      delay(2000);
      moveServos(115, 65, 150, 50);
    } else if (inData == "D") {
      lcd.clear();
      happy();
      lcd.print("I'm so happyyy!!!");
      moveServos(120, 60, 180, 20);
      delay(2000);
    } else if (inData == "E") {
      lcd.clear();
      sad();
      lcd.print("Do you hate me?? ;(");
      moveServos(30, 150, 135, 100);
      delay(2000);
    } else if (inData == "F") {
      lcd.clear();
      neutral();
      lcd.print("I'm bored");
      moveServos(90, 90, 160, 80);
      delay(2000);
    }
  }else{
    pulse_width = pulseIn(echoPin, HIGH);
    distance = (pulse_width*0.0343)/2;
    if(distance <= 10.0)
    {
      delay(500);
      lcd.clear();
      angry();
      lcd.print("Get back!");
      moveServos(45, 135, 150, 100);
    }else if(distance <= 20 && distance > 10){
      delay(500);
      lcd.clear();
      surprised();
      lcd.print("Why u so close?");
      moveServos(100, 80, 170, 45);
    }else if(distance <= 30 && distance > 20){
      delay(500);
      lcd.clear();
      love();
      lcd.print("I love you <3");
      moveServos(115, 65, 170, 30);
    }else if(distance <= 40 && distance > 30){
      delay(500);
      lcd.clear();
      happy();
      lcd.print("I'm so happyyy!!!");
      moveServos(120, 60, 180, 60);
    }else if(distance <= 50 && distance > 40){
      delay(500);
      lcd.clear();
      sad();
      lcd.print("Do you hate me?? ;(");
      moveServos(30, 150, 135, 120);
    }else{
      delay(500);
      lcd.clear();
      neutral();
      lcd.print("I'm bored");
      moveServos(90, 90, 180, 90);
    }
  }
}

void moveServos(int left, int right, int panIn, int tiltIn) { 
  leftBrow.write(left);
  rightBrow.write(right);
  pan.write(panIn);
  tilt.write(tiltIn);
}

Bill of Materials

Here’s where you’ll list the parts in your project. To add more rows, just copy and paste the example rows below. Don’t forget to place the link of where to buy each component inside the quotation marks in the corresponding row after href =. Follow the guide here to learn how to customize this to your project needs.

Part Note Price Link
Arduino Uno Micro Controller What the item is used for $27.60 Link
8x8 LED Matrix Displays Patterns $8.39 Link
16x2 LCD w/ I2C backpack Display Text $9.95 Link
2x Standard Sized Hobby Servos Tilt and Pan Servos $39.90 Link
Pan Tilt Servo Brackets Turning the head of the robot $12.99 Link
Ultrasonic Sensor Detecting Distance $6.99 Link
2x SG90 9G Micro Servos Eyebrows of the robot $7.29 Link
USB Power Wall Adapter Getting power to arduino $6.99 Link
Cables(40 male to female, 40 female to male) Connecting everything $ Varies Link
HM-10 Bluetooth Module Bluetooth connections $10.99 Link
Breadboard with 2 Power Rails Base for connections $19.99 Link

Other Resources/Examples

Starter Project

The Starter Project that I created was the retro arcade game. It is composed of a microcontroller, LED dot matrix screens, digital tube, keyboard, buzzer, and power supply circuit. The process was to solder all of the parts onto the PCB, and then also to connect a battery holder to the PCB for the game to work.
Process:

  1. First solder all the buttons to the PCB(6)
  2. Solder the 5 joints of the micro USB
  3. Solder the 220uF electrolytic capacitor.(Long pin into +, short pin into -)
  4. Solder the self-lock switch
  5. Solder the buzzer, 2 dot matrix modules, and digital display tube
  6. Test the game kit using the micro USB
  7. Install the battery case on the back of the shell
  8. Use bolts to stabilize and connect the shells
  9. Finally, installed button caps and shell to the PCB, to protect the kit and make it nice to hold

Some difficulties that I encountered were during soldering because the parts were so closely compacted. Using a multimeter, I determined the parts that were wrongly connected and used both a desoldering pump and desoldering wire to remove overlapping metal. With these changes and also connecting a battery holder to the PCB, I was finally able to make it work and encased it in a protective shell.