top of page
Search

Juggle BallZ

  • Writer: Jason Ron
    Jason Ron
  • Oct 25, 2020
  • 3 min read

This project is an RGB Led Juggle ball. This project involves soldering components and bootloading / uploading code to the ATMEga328p and creates a nice juggling ball. The Boot load and upload steps are confusing. here is the resource I used to bootload and upload to the ATmega328P chip. https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard

Please follow those instructions and my you tube video to upload the code to the Atmega328P. After the program is uploaded it is all about soldering. Start by creating separate pieces, solder the voltage regulator, then solder the LED with resistors, then solder the DIP socket for the Atmega328p chip, then solder the connections. Then when all soldering is done, and you have uploaded the code place the ATmega chip into the DIP socket and plug in the battery! Juggle time!


Parts list: everything X 3 (except arduino unos for bootload and upload) because you need 3 balls

(1) Clear plastic ball

(1) 9V battery

(1) Battery clip connector

(1) L7805C Voltage regulator

(1) Atmega328p

(1) 28 pin DIP socket

(2) solder board

(1) Solder board that is like a breadboard with connections

(1) pushbutton

(2) RGB LEDS

(1) crystal oscillator for atmega chip

(2) 22pF capacitors

(1) 10uF capacitor

(1) 100uF Capacitor

(1) 0.1uF Capacitor

(1) soldering Iron

(10 rosin core solder

(2) Arduino Unos for boatload and upload ( can re use these forever)

a couple of 10Kohm resistors, and resistors for the RGD LED pins size depends on how bright you want





Uploader circuit with test LED and pushbuttons to make sure the code works before I put the ATmega328p into the DIP socket upload parameters: (see link above)

Board " Arduino duemilanove or decimila"

Port "Com 4"


Bootloader circuit to bootload the atmega328P. The arduino already has the Adruino ISP sketch uploaded normally: then enter parameters

Board "Arduino duemilanove or decimila"

Processor"Atmega328p"

Port "com3"

Programmer "Arduino as ISP"

then pres Tools --- Burn bootloader

Close up of the votage regulator. I used the Capacitor Legs and soldered them together to form the power and ground bus. See how I twisted the wires. Then solder those wires to the ground and power bus.






Code:///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


const int RED_PIN = 9;

const int GREEN_PIN = 10;

const int BLUE_PIN = 11;

const int inputpin = 13;


int lastButtonState2 = 0;

int buttonState2 = 0;

int buttonPushCounter2 = 0;


const int DISPLAY_TIME = 1000; // used in mainColors() to determine the

// length of time each color is displayed.


void setup() //Configure the Arduino pins to be outputs to drive the LEDs

{

pinMode(RED_PIN, OUTPUT);

pinMode(GREEN_PIN, OUTPUT);

pinMode(BLUE_PIN, OUTPUT);

pinMode(inputpin, INPUT);

}


void loop()

{

buttonState2 = digitalRead(inputpin);

if (buttonState2 != lastButtonState2) {

if (buttonState2 == LOW) {


buttonPushCounter2++;

}


}

lastButtonState2 = buttonState2;


mainColors(buttonPushCounter2%17);

}


/******************************************************************

* void mainColors()

* This function displays the eight "main" colors that the RGB LED

* can produce. If you'd like to use one of these colors in your

* own sketch, you can copy and paste that section into your code.

/*****************************************************************/

void mainColors(int color)

{

if(color == 0)

{

digitalWrite(RED_PIN, LOW);

digitalWrite(GREEN_PIN, LOW);

digitalWrite(BLUE_PIN, LOW);

}

else if(color == 1)

{

// Red

digitalWrite(RED_PIN, HIGH);

digitalWrite(GREEN_PIN, LOW);

digitalWrite(BLUE_PIN, LOW);

}

else if (color == 2)

{

// Green

digitalWrite(RED_PIN, LOW);

digitalWrite(GREEN_PIN, HIGH);

digitalWrite(BLUE_PIN, LOW);

}

else if (color == 3)

{

// Blue

digitalWrite(RED_PIN, LOW);

digitalWrite(GREEN_PIN, LOW);

digitalWrite(BLUE_PIN, HIGH);

}

else if (color == 4)

{

// Yellow (Red and Green)

digitalWrite(RED_PIN, HIGH);

digitalWrite(GREEN_PIN, HIGH);

digitalWrite(BLUE_PIN, LOW);

}

else if (color == 5)

{

// Cyan (Green and Blue)

digitalWrite(RED_PIN, LOW);

digitalWrite(GREEN_PIN, HIGH);

digitalWrite(BLUE_PIN, HIGH);

}

else if (color == 6)

{

// Purple (Red and Blue)

digitalWrite(RED_PIN, HIGH);

digitalWrite(GREEN_PIN, LOW);

digitalWrite(BLUE_PIN, HIGH);

}

else if (color == 7)

{

// White (turn all the LEDs on)

digitalWrite(RED_PIN, HIGH);

digitalWrite(GREEN_PIN, HIGH);

digitalWrite(BLUE_PIN, HIGH);

}

else if (color == 8)

{

// White (turn all the LEDs on)

digitalWrite(RED_PIN, HIGH);

digitalWrite(GREEN_PIN, HIGH);

digitalWrite(BLUE_PIN, HIGH);

delay(60);

// Red

digitalWrite(RED_PIN, HIGH);

digitalWrite(GREEN_PIN, LOW);

digitalWrite(BLUE_PIN, LOW);

delay(60);

}

else if (color == 9)

{

// Red

digitalWrite(RED_PIN, HIGH);

digitalWrite(GREEN_PIN, LOW);

digitalWrite(BLUE_PIN, LOW);

delay(60);

// Green

digitalWrite(RED_PIN, LOW);

digitalWrite(GREEN_PIN, HIGH);

digitalWrite(BLUE_PIN, LOW);

delay(60);

}

else if (color == 10)

{

// Green

digitalWrite(RED_PIN, LOW);

digitalWrite(GREEN_PIN, HIGH);

digitalWrite(BLUE_PIN, LOW);

delay(60);

// Blue

digitalWrite(RED_PIN, LOW);

digitalWrite(GREEN_PIN, LOW);

digitalWrite(BLUE_PIN, HIGH);

delay(60);

}

else if (color == 11)

{

// Blue

digitalWrite(RED_PIN, LOW);

digitalWrite(GREEN_PIN, LOW);

digitalWrite(BLUE_PIN, HIGH);

delay(60);

// Yellow (Red and Green)

digitalWrite(RED_PIN, HIGH);

digitalWrite(GREEN_PIN, HIGH);

digitalWrite(BLUE_PIN, LOW);

delay(60);

}

else if (color == 12)

{

// Cyan (Green and Blue)

digitalWrite(RED_PIN, LOW);

digitalWrite(GREEN_PIN, HIGH);

digitalWrite(BLUE_PIN, HIGH);

delay(60);

// Red

digitalWrite(RED_PIN, HIGH);

digitalWrite(GREEN_PIN, LOW);

digitalWrite(BLUE_PIN, LOW);

delay(60);

}

else if (color == 13)

{

// Cyan (Green and Blue)

digitalWrite(RED_PIN, LOW);

digitalWrite(GREEN_PIN, HIGH);

digitalWrite(BLUE_PIN, HIGH);

delay(60);

digitalWrite(RED_PIN, LOW);

digitalWrite(GREEN_PIN, LOW);

digitalWrite(BLUE_PIN, LOW);

delay(60);

}

else if (color == 14)

{

// Red

digitalWrite(RED_PIN, HIGH);

digitalWrite(GREEN_PIN, LOW);

digitalWrite(BLUE_PIN, LOW);

delay(60);

digitalWrite(RED_PIN, LOW);

digitalWrite(GREEN_PIN, LOW);

digitalWrite(BLUE_PIN, LOW);

delay(60);

}

else if (color == 15)

{

// Green

digitalWrite(RED_PIN, LOW);

digitalWrite(GREEN_PIN, HIGH);

digitalWrite(BLUE_PIN, LOW);

delay(60);

digitalWrite(RED_PIN, LOW);

digitalWrite(GREEN_PIN, LOW);

digitalWrite(BLUE_PIN, LOW);

delay(60);

}

else if (color == 16)

{

// Blue

digitalWrite(RED_PIN, LOW);

digitalWrite(GREEN_PIN, LOW);

digitalWrite(BLUE_PIN, HIGH);

delay(60);

digitalWrite(RED_PIN, LOW);

digitalWrite(GREEN_PIN, LOW);

digitalWrite(BLUE_PIN, LOW);

delay(60);

}



} ///end func











 
 
 

Comments


Post: Blog2_Post
  • Facebook
  • Twitter
  • LinkedIn

©2018 by Jason JCAD. Proudly created with Wix.com

bottom of page