loading

This instructable is created to fulfill the project requirement of the Makecourse at the University of South Florida.3D printing and laser cutting was all done at the engineering lab at the University of South Florida.

Description:

This project is based on my interest in hosting great parties and the disco ball is going to create a great club atmosphere. This project is a revolving disco ball with a black box as the base. The ball is 3D printed while the base is just a black box that came with the kit for the course. Autodesk inventor was used in creating the design; that is the ball. A power source in conjunction with the programmed code enables the disco ball to rotate while the LED lights turn on. A LCD screen will display Dj Kwame Repping Gh when turned on and See you later when the disco ball comes to a brief stop.

Parts:

1x black box

1x stepper motor

1x Arduino Uno

Wires and Jumper wires

1x LCD Screen

1x USB Cord

1x USB 5V Adapter

1x Hot-Glue Gun

1x Plywood

Step 1: ARDUINO CODE

/******************************************
PURPOSE: To Operate a Disco Ball
Created by George K Nkrumah
DATE: 04/01/2015
*******************************************/

#include
#include
#include
#include //include the I2C library, this one is a standard Arduino package library
#include
//this is the special I2C LCD display library that came with the display

LiquidCrystal_I2C myDisplay(0x27,16,2); //this instantiates an LCD object named "myDisplay"
//We set the LCD address to 0x27 (this is a hexadecimal number, which is equal to 0b100111); this is the I2C
//bus address for the PCF8574 port extender chip that controls the display (see tutorial video)
//and define the number of columns (16) and rows (2) of the display
//this tells the methods in the library what display we are dealing with
#define pin1 0//these are the Arduino pins that we use to activate coils 1-4 of the stepper motor
#define pin2 1
#define pin3 2
#define pin4 3

#define delaytime 8 //delay time in ms to control the stepper motor delaytime.
//Our tests showed that 8 is about the fastest that can yield reliable operation w/o missing steps

int LED1 = 10;
int LED2 = 11;
int LED3 = 12;

int j = 0;
int m = 5;
int n = 10;

/************************set-up function******************************************************************/

void setup()
{
myDisplay.init(); //initialize the lcd - this sets the character canvas to 5x8 pixels and some other hardware specifics
//Note: This .init() method also starts the I2C bus, i.e. there does not need to be
//a separate "Wire.begin();" statement in the setup.

myDisplay.backlight();//this turns the backlight on
//Print a message to the LCD.
myDisplay.print("Dj Kwame...Repping GH!!!");
delay(1000); //wait 1000msec
// initialize the 8 pin as an output:
pinMode(pin1, OUTPUT);
pinMode(pin2, OUTPUT);
pinMode(pin3, OUTPUT);
pinMode(pin4, OUTPUT);


pinMode (LED1,OUTPUT);
pinMode (LED2,OUTPUT);
pinMode (LED3,OUTPUT);

}

/*************************main loop************************************************************************/

void loop()
{
digitalWrite(LED1, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second

digitalWrite(LED2, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second

digitalWrite(LED3, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second

//let's play with some of the methods included in the library:
int numberOfSteps = 2048;
step_OFF(); //turning all coils off
while(numberOfSteps>0){
forward(); //going forward
numberOfSteps -- ;//counting down the number of steps

if (j<15)
{
digitalWrite(LED1, LOW); // turn the LED on (HIGH is the voltage level)
j++;
}
if (j>=15)
{

digitalWrite(LED1, HIGH); // turn the LED on (HIGH is the voltage level)
j=0;
}
if (m<15)
{
digitalWrite(LED2, LOW); // turn the LED on (HIGH is the voltage level)
digitalWrite(LED3, LOW); // turn the LED on (HIGH is the voltage level)
m++;
}
if (m>=15)
{
digitalWrite(LED2, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(LED3, HIGH); // turn the LED on (HIGH is the voltage level)
m=0;
}

}
for (int i=0;i < 10; i++){//this scrolls the text 10 positions to the right
myDisplay.scrollDisplayRight();
delay(200);
}
for (int i=0;i < 10; i++){//and back to the left
myDisplay.scrollDisplayLeft();
delay(200);
}
delay(2);

step_OFF(); //turning all coils off
numberOfSteps = 2048;
while(numberOfSteps>0){
backward(); //going backward
numberOfSteps -- ;//counting down the number of steps
}
delay(200);
digitalWrite(LED1, LOW); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second

digitalWrite(LED2, LOW); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second

digitalWrite(LED3, LOW); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second

//this sets the cursor of the display to the second row and 9th character position in that row
myDisplay.setCursor(1,8);
//then we print at the cursor position
myDisplay.print("See you Later!!!");
//check out the other interesting methods for operating this LCD that are included in the library!
//load the .h library file into a text editor and read the list of methods...most are self explanatory, more detail is found in the .cpp file
}

Stepper Library:

//these functions set the pin settings for each of the four steps per rotation of the motor (keepp in mind that the motor in the kit is geared down,
//i.e. there are many steps necessary per rotation

void Step_A(){
digitalWrite(pin1, HIGH);//turn on coil 1
digitalWrite(pin2, LOW);
digitalWrite(pin3, LOW);
digitalWrite(pin4, LOW);
}
void Step_B(){
digitalWrite(pin1, LOW);
digitalWrite(pin2, HIGH);//turn on coil 2
digitalWrite(pin3, LOW);
digitalWrite(pin4, LOW);
}
void Step_C(){
digitalWrite(pin1, LOW);
digitalWrite(pin2, LOW);
digitalWrite(pin3, HIGH); //turn on coil 3
digitalWrite(pin4, LOW);
}
void Step_D(){
digitalWrite(pin1, LOW);
digitalWrite(pin2, LOW);
digitalWrite(pin3, LOW);
digitalWrite(pin4, HIGH); //turn on coil 4
}
void step_OFF(){
digitalWrite(pin1, LOW); //power all coils down
digitalWrite(pin2, LOW);
digitalWrite(pin3, LOW);
digitalWrite(pin4, LOW);
}

//these functions run the above configurations in forward and reverse order
//the direction of a stepper motor depends on the order in which the coils are turned on.
void forward(){//one tooth forward
Step_A();
delay(delaytime);
Step_B();
delay(delaytime);
Step_C();
delay(delaytime);
Step_D();
delay(delaytime);
}

void backward(){//one tooth backward
Step_D();
delay(delaytime);
Step_C();
delay(delaytime);
Step_B();
delay(delaytime);
Step_A();
delay(delaytime);
}

Step 2: CIRCUIT SCHEMATIC

The block diagram shows the IR remote sending signal to the IR sensor once the power button is pressed. The IR sensor then sends a signal to the Arduino which transmit the code that operate the stepper, which executes the motion and rotate the ball to a specific degree. The LCD screen then display the Dj Kwame....On the bread board, there is the positive and ground wires respectively.

Step 3: 3-D MODEL

I used Autodesk inventor to design my 3D model of this project as well as animation. This software has user friendly capabilities; I strongly recommend anyone who wants to create a 3D model to use it.

3D parts:(.stl files)

disco ball

ball base

square base

cone

Step 4: 3-D PRINTING,LASER-CUTTING

The model is imported into Makerbot 3D printer.3D printing was done on the Makerbot Replicator 2. The Laser cutter was used to create the space for LCD screen. Doing multiple passing when using the laser cutter is the best way to go to ensure better quality outcome.

Step 5: ASSEMBLY

I drilled holes in both ends of the wood to connect the disco ball and the stepper motor; this way it can be separated when need if adjustments needs to be made. I drilled a circular hole on the top of the black box to fit the stepper motor. I also cut a rectangular hole in the black box to fit the laser cut wood and LCD screen. I also used hot glue to secure the wiring and LED lights in the disco ball.

<p>Very cool! </p>

About This Instructable

558views

1favorite

License:

More by gnkrumah21:disco ball 
Add instructable to: