CokeBot

by garytalman in Circuits > Robots

613 Views, 3 Favorites, 0 Comments

CokeBot

IMG_20170617_141255_HDR.jpg

A robot character made from empty coke cans along with servo motors. We made a prototype back in the summer (2017) and thought it would make a great robot character. We went out and bought a case of coke* and as they are emptied we kept the cans ready for construction. In order, to make the cans safe for children to handle, ring pulls can slice little fingers, we have designed inserts that pop onto the top of the cans as well as parts that house servo motors. We use three servos to control the movements, of the CokeBots arms and neck. There is also the instructions to build a non-animated version which does not use servos.

* Other brands are compatible :)

Supplies

For this Instructable you will require:
23 Cans,
Strong glue
The 3d printed joiners, of which the files are freely available at Booting

For the animatronic version you will also require:
An Arduino Uno,
3 Servos (metal gear recommended),
It is also recommended to use a servo driver board.

Preparation

parts list_2.jpg

Drink all your cans, wash cans and allow to dry.

Print all the 3d parts. Quantities as per the table above,
Then once you have printed the required amount of each connector you can then start the build process.

Create CAN1

parts list_3.jpg
parts list_4.jpg

Create Parts CAN2 & CAN3

parts list_5.jpg


Create Part ARM

parts list_6.jpg

Create the Parts LEG

parts list_7.jpg

Create the Part TORSO

parts list_8.jpg

Create Part HIPS

parts list_9.jpg

Create the Part SHOULDERS

parts list_10.jpg

Create Part HEAD

parts list_11.jpg

Time to Build - Putting Him Together.

parts list_12.jpg
parts list_13.jpg
parts list_14.jpg
parts list_15.jpg
parts list_16.jpg
parts list_17.jpg

So through the process of making the individual parts we have fabricated sections that can now be glued together a piece at a time. Working from bottom to top we glue each part to the next as follows:

Glue LEG (x2) to HIP, allow to dry.
Glue TORSO to HIP, allow to dry.
Glue SHOULDER to TORSO, with part CB_07 (cups), allow to dry.
Glue part CB_05 (shoulder joints) one to each of the SHOULDER servos, the part should cup the servo with the rest of the part facing downward, allow to dry. Then glue ARM to each of the CB_05 (shoulder joints), allow to dry.
Finally we glue part HEAD to the neck servo to finish the build.

*** If you do not want an animatronic version you just reframe from adding the servos and print two extra CB_03, and connect the arms in the same way as the legs, posing the arms according to your desired look ***

Time to Wake Him Up

cokebot test

Now we have him built it is time to get him animated. We will need an Arduino Uno, a servo driver board and of course some code to make the magic happen. In my version of code I've just opted to leave out the servo driver board as with 3 servos we can get away without it. In my code I've also added lights to the eyes for an added effect. If you stick to the standard version, without lights, then comment out the LED control in the code.

/*  /\\\\\\\\\\\      /\\\\\\\\\\\      /\\\\\\\\\\\     /\\\\\\\\\\\\\\  /\\\\\\\\\\  /\\\         /\\\     /\\\\\\\\\\\
  /\\\/////////\\\  /\\\/////////\\\  /\\\/////////\\\  \/____/\\\____/  \/__/\\\__/  \/\\\\       \/\\\   /\\\/////////\\\
  \/\\\       \/\\\ \/\\\       \/\\\ \/\\\       \/\\\       \/\\\          \/\\\     \/\\\\\\\    \/\\\  \/\\\       \///
   \/\\\\\\\\\\\\\/  \/\\\       \/\\\ \/\\\       \/\\\       \/\\\          \/\\\     \/\\\ \/\\\  \/\\\  \/\\\     /\\\\\\  
    \/\\\/////////\\\ \/\\\       \/\\\ \/\\\       \/\\\       \/\\\          \/\\\     \/\\\  \/\\\ \/\\\  \/\\\    \////\\\
     \/\\\       \/\\\ \/\\\       \/\\\ \/\\\       \/\\\       \/\\\        __\/\\\__   \/\\\   \/\\\\/\\\  \/\\\       \/\\\
      \/\\\\\\\\\\\\\/  \/\\\\\\\\\\\\\/  \/\\\\\\\\\\\\\/        \/\\\      /\\\\\\\\\\   \/\\\    \/\\\\\\\  \/\\\\\\\\\\\\\/
        \////////////     \////////////     \////////////          \///      \//////////    \///      \//////   \/////////////        
    
    ----- www.booting.co.uk -----
    
    Coded by Gary Talman
    Date: 06-01-2021 
    Version: 1.00
 
 */
#include <Servo.h>
#include "FastLED.h"

//############################### servo connections #################################
Servo head_servo;
Servo left_arm_servo;
Servo right_arm_servo;

//############################### constant values ###################################
#define eyes 3

//############################### variables values ##################################
CRGB eye_data[2];

//############################### function defs #####################################
void move_right_up();
void move_right_down();
void right_wave();
void move_left_up();
void move_left_down();
void left_wave();
void move_head_right();
void move_head_left();  
void move_head_centre();
void eyes_on();
void eyes_off();
void eyes_flash();

void setup() {
 FastLED.addLeds<WS2812, eyes, RGB>(eye_data, 2); // set up fast led library with2 leds for the eyes
head_servo.attach(9);
left_arm_servo.attach(10);
right_arm_servo.attach(11);
}

void loop(){
 move_head_centre();
 eyes_flash();
 eyes_on();
 right_wave();
 delay(2000);
 eyes_off();
 move_head_left();
 delay(1000);
 move_head_right();
 delay(1000);
 eyes_on();
 move_left_up();
 delay(1000);
 move_left_down();
 move_head_centre();
 delay(5000);
}

void move_right_up() {
 right_arm_servo.write(0);
}
  
void move_right_down() {
 right_arm_servo.write(130);
}

void right_wave() {
 right_arm_servo.write(30);
 delay(200);
 right_arm_servo.write(90);
 delay(200);
 right_arm_servo.write(30);
 delay(200);
 right_arm_servo.write(90);
 delay(200);
 move_right_down(); 
}
  
void move_left_up() {
 left_arm_servo.write(180);
}
  
void move_left_down() {
 left_arm_servo.write(30);
}

void left_wave() {
 left_arm_servo.write(180);
 delay(200);
 left_arm_servo.write(120);
 delay(200);
 left_arm_servo.write(180);
 delay(200);
 left_arm_servo.write(120);
 delay(200);
 move_left_down(); 
}

void move_head_right() {
 head_servo.write(0);
}
  
void move_head_left() {
 head_servo.write(180);
}
  
void move_head_centre(){
  head_servo.write(90);
}

void eyes_on() {
  eye_data[0]=CRGB::White;
  eye_data[1]=CRGB::White;
  FastLED.show(); 
  }

void eyes_off(){
  eye_data[0]=CRGB::Black;
  eye_data[1]=CRGB::Black;
  FastLED.show(); 
  }

void eyes_flash(){
 for (int i=0;i<4;i++) {
  eye_data[0]=CRGB::White;
  eye_data[1]=CRGB::White;
  FastLED.show(); 
  delay(200);
  eye_data[0]=CRGB::Red;
  eye_data[1]=CRGB::Red;
  FastLED.show(); 
  delay(200);
 }
}

This code is provided as an example of one way to control him, I'm sure you can get creative and get him responding in other ways. Also it is worth checking your servo minimum and maximum values, and changing the values, in the code, so you do not get chattering, or indeed burn out your servos.