Introduction: BoogieTron (The Dancing Robot)

This instructable was created in fulfillment of the project requirement of the Makecourse-Art at the University of South Florida (www.makecourse-art.com).

BoogieTron is a robot that dances when specific thresholds of sound are detected. The mechanical and exterior designs were completed by using Auto-desk Maya. The micro-controller Arduino Uno was used to control the electrical system.

Step 1: System Block Diagram

This block diagram will describe the overall operation of the robot. The input will be the sound coming form the microphone. Arduino will then detect the specific thresholds of sound (adjusted by user). Once the desired threshold is detected, the LEDs and servos will activate.

Step 2: Mechanical and Exterior Design

Using a 3D Modeling software to design the mechanical system and the overall look of the robot is necessary. In this case, Auto-desk Maya was used. For the mechanical movement, 4 servos were used. One for each arm, one for the head, and one for the upper body. This project contained 41 different part, 25 of them were printed using 3D printers. The video linked in the description will show the 3D model of the robot.

Step 3: Electrical System Design

The schematics for the electrical system of this project is shown if the figure. Two Arduinos were used in this case. One to control the operation of the LEDs, and the other to control the mechanical operation (4 servos) of the robot. The power distribution was also split between the two Arduinos. One powering the LEDs and 2 servos, and the other powering the other 2 servos. All of the electrical components were placed in the black box (the stage) as shown in the figures.

Step 4: Arduino Code for the LEDs

The code for the LEDs is as follows:

// Creating The LED pins.
int led1 = 13; int led2 = 12; int led3 = 11;

int threshold1 = 680; // Keep changing this int threshold2 = 700; // Keep changing this int threshold3 = 720; // Keep changing this int volume; // Creating a variable for the volume level

void setup() { Serial.begin(9600); // For debugging // Setting the LED pins as outputs pinMode(led1, OUTPUT); pinMode(led2, OUTPUT); pinMode(led3, OUTPUT); }

void loop() { volume = analogRead(A0); // Reads the value from the Analog PIN A0 Serial.print(volume); // Printing the value of volume in the serial monitor

/* //Debug mode Serial.println(volume); delay(100); */ if(volume>=threshold1){ digitalWrite(led1, HIGH); //Turn ON Led } else{ digitalWrite(led1, LOW); // Turn OFF Led }

if(volume>=threshold2){ digitalWrite(led2, HIGH); //Turn ON Led } else{ digitalWrite(led2, LOW); // Turn OFF Led }

if(volume>=threshold3){ digitalWrite(led3, HIGH); //Turn ON Led } else{ digitalWrite(led3, LOW); // Turn OFF Led }

}

Step 5: Arduino Code for the Servos

The code for the servos is as follows:

#include

// Creating the servos Servo servo1; Servo servo2; Servo servo3; Servo servo4;

// Creating the pins for the servos int servopin1 = 2; int servopin2 = 4; int servopin3 = 7; int servopin4 = 8;

int threshold = 900; // Setting the threshold……Will depend on the environment….Keep changing.

// Creating Some variables int servovolume; float pos1and2 = 0; float pos3 = 0; float pos4 = 0;

void setup() { Serial.begin(9600); // For debugging

// Attaching each servo to its pin servo1.attach(servopin1); servo2.attach(servopin2); servo3.attach(servopin3); servo4.attach(servopin4); servo3.write(0); servo4.write(10); }

void loop() {

servovolume = analogRead(A0); // Reads the value from the Analog PIN A0 /* //Debug mode Serial.println(volume); delay(100); */ if(servovolume>=threshold){

for (float i = 0; i < 45; i += 0.5) { // goes from 0 degrees to 45 degrees // in steps of 0.5 degree pos1and2 = 0 + i; // Position of servo 1 and 2 from 0 to 45 degrees pos3 = 0 + (i/5); // Position of servo 3 from 0 to 9 degrees pos4 = 0 + (i/3); // Position of servo 4 from 0 to 15 degrees servo1.write(pos1and2); // tell servo 1 to go to position in variable 'pos1and2' servo2.write(pos1and2); // tell servo 2 to go to position in variable 'pos1and2' servo3.write(pos3); // tell servo 3 to go to position in variable 'pos3' servo4.write(pos4); // tell servo 4 to go to position in variable 'pos4' delay(6); // waits 6ms for the servo to reach the position } for (float i = 45; i > 0; i -= 0.5) { // goes from 45 degrees to 0 degrees pos1and2 = 45 + i; // Position of servo 1 and 2 from 45 to 0 degrees pos3 = 9 + (i/5); // Position of servo 3 from 9 to 0 degrees pos4 = 15 + (i/3); // Position of servo 4 from 15 to 0 degrees servo1.write(pos1and2); // tell servo 1 to go to position in variable 'pos1and2' servo2.write(pos1and2); // tell servo 2 to go to position in variable 'pos1and2' servo3.write(pos3); // tell servo 3 to go to position in variable 'pos3' servo4.write(pos4); // tell servo 4 to go to position in variable 'pos4' delay(6); // waits 6ms for the servo to reach the position }

} else { servo1.write(LOW); // Turn OFF servo1 servo2.write(LOW); // Turn OFF servo2 } }

Step 6: The Final Result (Enjoy the Show)

This is the result of the project. See what happens when music is detected in the attached video.

Now, go and make something awesome!

GO BULLS!

Comments

author
tomatoskins (author)2016-12-08

That's a great looking robot! Thanks for sharing!

About This Instructable

212views

2favorites

License:

More by Engin-EE-r:BoogieTron (The Dancing Robot)
Add instructable to: