Introduction: LED Strip Atari Pong Arcade Machine

My name is Gabriel Podevin and this is my very first intructable. I am currently a 16 year old high school student who loves creating and building things while being very interested electronics, robotics, circuitry, and programming. I hope you can find this intructable find this helpful.

In this instructable I will be showing you how to make a retro styled Atari Pong Game inside a retro arcade case. You can see the above video for a demo of the project, you can also see the finished project and the case alone and in the two pictures. At the end of this intructable i will be diving deeper into the code and how to edit it to personalize it.

The basic part list will be divided in the sections: Tools, assembly parts and components

The tools that you will need will include the following:

- Drill

- Soldering Iron

- Screw driver ( matching the screws you decide to use )

- Multi Meter

- circulating saw, band saw, or laser cutter is you have access to one

-Wire cutter or scissors

- Glue gun

Parts that you will need for assembly will include

- Wood glue

- 10 one inch by one inch blocks of wood

- large sheet of quarter inch ply wood or wood of choice

- 24 screws half inch in length

- 14 x 6.5 inches of led diffusing plastic (optional)

- red and blue electrical tape

The components that you will require are:

- 2 100k ohm potentiometers

- 8 meters of individually addressable Led strip (30 leds per Meter)

https://www.amazon.ca/ALITOVE-WS2812B-Individually-Addressable-Waterproof/dp/B018XAELE4/ref=sr_1_1?s=hi&ie=UTF8&qid=1535323567&sr=1-

- several meters of wire or multiple colors of wire

- ac to dc power adapter that outputs 6v through a barrel jack plug

- 1 arduino Uno R3

if you don't have access to a Arduino Uno R3 like myself you can build one like the one i will be using in this project which uses a atmel328-pu processor. Follow this link to learn how to build your own https://www.instructables.com/id/How-to-make-your-own-Arduino-board/

If your are using an arduino uno continue on to step one.

Step 1: Building the LED Array

This step is the simplest time consuming step due to all the soldering you must do.

-to begin you will need a 10 3/4 inch by 6 1/2 inch piece of wood.

-once you have your piece of wood, grab your Led strip and cut 26 segment every 10 led's or every 6 1/2 of an inch.

-after cutting the segments glue them down to your wood vertically like show in the following pictures shown in the first picture above.

-once you have glued the strips down and allowed them to settle we will start soldering.

-you will need three different colored wire

-it should be wired with all positives connecting to one wire and all negatives connecting to one wire while the last wire will snake the led strips together. The second pictures at the beginning of this step is a diagram that will show you how to connect the wires.

-Finally after you have soldered them you will simply wrap a strip of electrical on your solder connections with the corresponding colors. as shown in the third picture above.

-lastly we will connect to the Arduino. your digital input or your middle wire will connect to you digital input 6 pin and your ground and positive will connect to the positive and negative rails on the board.

Step 2: The Paddle Controls

For this very simple step all you will have to do is solder three wires to each potentiometer. if you hold the potentiometer with the solder points facing away from you the left prong will be positive the center prong being output and the right prong will be ground. as shown in the diagram above

once you have soldered the wires on we will connect them to the Arduino. you possitive and negatives will connect to there corresponding positive and negative rains. you output wires on the potentiometers will connect to different inputs on the arduino. one will connect to the (A0) plug and the other will connect to the (A1) plug.

Step 3: Cutting the Case

this part will give you the dimensions and angles on what you will need to cut

****very important***** make sure your wood is a quarter inch thick (1/4 inch)

also when cutting parts out remember to label your parts

the basic part to cut will be labeled bottom, back, top, front top, front bottom .... shown in the pictures at the beginning

part dimensions

- Bottom: 13 3/4 inches X 10 1/4 inches

- Back: 13 3/4 inches X 15 1/2 inches

- Top: 13 3/4 inches X 6 1/2 inches

- Front bottom: 13 3/4 inches X 4 1/4 inches

- Dial Panel: 13 3/4 inches X 6 inches

- Inner top: 13 3/4 inches X 3 1/4 inches

- LED siding: 6 1/4 inches X 1 inch (cut two of these)

- LED Inner bottom: 13 1/4 inches X 4 1/2 inches

- inner back LED panel: 13 1/4 inches X 9 inches

- Blocks: 1 inch X 1 inch X 1 inch (cut 10 blocks)

- Acrylic panel: 13 3/4 inches X 6 1/2 inches

The pictures above will show you the angles and dimensions the side panel part. also you will need to cut two of this part

Step 4: Case Assembly

By this point in these instructions you have nearly finished the whole thing. put your probably thinking i have all these parts and cutouts what do I do with them. This final step will instruct you how to assemble your case.

-The first thing we are going to is begin to assemble the case. this is where all you wood cut outs from the previous step come in handy.

-To begin the assembly we are going to need 4 of the 1x1x1 blocks of wood the base, the two side panels, the back and the front bottom. place the 4 blocks on each corner of the bottom and leave a quarter inch between the edge and the block as shown in the second picture at the begging of the step.

-next you will need to drill some pilot holes from through the wood and the blocks. once you have done that screw then to the bottom.

-Next we will be putting the side panels on. Place the panels on the quarter inch gap on the out side of the block. drill a pilot hole through the side panel and the wood block and screw the panels in. repeat for the other side.

-After completing the side panels. we will be putting the front bottom panel on. place the panel flush with the bottom and the sides drill the pilot holes into the blocks and screw the panel on.

-Finally we will be putting the back on. do the same as you did with the front bottom panel and screw you back in.

-By this point you have a foundation to build off of and a understanding on how we are assembling this case.

-This next part is a little more challenging due to the fact your working with a smaller area. to begin we will need all the top parts and 6 blocks.

-Lay what you have built so far on its back and place the blocks in the corners a quarter inch from the top. (as shown in the third picture at the beginning)

-drill the pilot holes for the sides and back and screw them in.

-now we will assemble the rest of the top

-take your top panel and place it on the blocks drill the pilot holes and screw the top in. after you Finnish that turn your assembly upside down ***carefully*** and place a block in each corner parallel with the edge. drill pilot holes from the side panels and screw them to the block. turn the case back upright and drill pilot holes through the top into the blocks and screw it in.

-this nest part is a little tricky. you will need you front top panel and your final two blocks. first drill a pilot holes into the previous blocks through your top front panel and screw that in. now take you final two blocks and place them inside in the corner and screw your side panel and your front top panel to the blocks. once again turn the case upside down and place the inner top panel on the block and screw it in.

-you should be left with something like this (shown in the first picture of this step)

the next step will explain the rest of the assembly.

Step 5: Finishing the Assembly

By this point you have nearly completed the case and the build just a few things to put into place and you will be done.

Now all the is left is installing the electronics.

-We will begin by drilling holes into your dial panel for your potentiometer. feel free to drill the holes where you feel it would be comfortable. in my case i have place the holes 2 1/2 inches from the bottom and 3 1/2 inches from the side for both potentiometers.

-Once you have drilled your holes we will be putting this panel onto the case. but instead of screwing it on we will be gluing it simply put a generous amount of would glue along the case edge and place the panel on and hold it with some clamps or something heavy.

-After the glue has finished drying we will be putting in the electronic parts. But first we will have to remove the back panel.

-Once the back is off I recommend that you place the case front down making it easier to put the LEDs and other components inside.

-Now that you have the back off we will be placing the potentiometer inside the case by simply putting them through the holes we just drilled and putting a generous amount of hot glue.

***caution***
-Be extremely careful when putting the LED array in because the solder points can be fragile.

-Now we have reached the most important part, putting in the led array. simply place the board in as shown in the second picture.

-Once in get your led inner panel and place it inside the case directly underneath the the LED array back panel. this piece might me a tight fit. also let it dry before continuing.

-You have reach the last part. i recommend painting one side of this final part ( LED Inner Back) black or white for a contrast between the LEDs and this part.

-We will know place this directly behind the LED backing and lightly press against the back of the LEDs to keep them from moving. once put in apply glue along the edge to prevent it from moving. shown in the third picture.

****congrats you have finished the whole assembly !!!

continue to the last step to code the game

Step 6: The Code

Congratulation once again on making it this far.

in this section i will show you the code and how to make it work in addition to things in the code you can change and personalize it.

but before we get into that you will need the (adafruit_NeoPixel-master) i have linked the download also.

to install the master open your arduino program

1. go to sketch

2. open include library

3. click (add.zip library)

4.select the (adafruit_NeoPixel-master) file and your done

below this i have pasted the code for the game.

#include

#include

long ballXabs = 12;

long ballYabs = 4;

int ballX;

int ballY;

int ballvelX = 1;

int ballvelY = 1;

int index;

int fps = 50;

int paddlewidth = 3;

int paddlemax = 9 - paddlewidth + 1;

int knobseg = 1023 / (paddlemax);

int paddle1 = 4;

int paddle2 = 4;

#define NUMPIXELS 260

#define PIN 6

Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN6, NEO_GRB + NEO_KHZ800);

void setup() {

pixels.begin();

Serial.begin(9600);

}

void loop() {

clearScreen();

updateBall();

updatePaddle1();

updatePaddle2();

displayBall();

displayPaddle1();

displayPaddle2();

pixels.show();

detectCollision();

delay(fps);

}

void clearScreen() {

for (int i = 0; i < NUMPIXELS; i++) {

pixels.setPixelColor(i, pixels.Color(0, 0, 0));

}

}

void updateBall() {

ballXabs += ballvelX;

ballYabs += ballvelY;

}

void detectCollision() {

Serial.print(ballYabs);

Serial.print(" ");

Serial.println(paddle1);

if (ballvelX > 0 && ballXabs >= 25) { //collide right wall

Serial.println("CollisionX");

score1(); //ballvelX*=-1;

}

if (ballvelX < 0 && ballXabs <= 0) { //collide left wall

Serial.println("CollisionX");

score2(); //ballvelX*=-1;

}

if (ballvelY > 0 && ballYabs >= 9) { //collide top wall

Serial.println("CollisionY"); ballvelY *= -1;

}

if (ballvelY < 0 && ballYabs <= 0) { //collide bottom wall

Serial.println("CollisionY");

ballvelY *= -1;

}

//detect paddle 2 collision

if ((ballvelX > 0 && ballXabs == 24) && ((ballYabs >= paddle2) && (ballYabs <= paddle2 + paddlewidth - 1)))

{ //collide right wall

Serial.println("CollisionPaddle");

ballvelX *= -1;

}

//detect paddle 1 collision

if ((ballvelX < 0 && ballXabs == 1) && ((ballYabs >= paddle1) && (ballYabs <= paddle1 + paddlewidth - 1)))

{ //collide right wall

Serial.println("CollisionPaddle");

ballvelX *= -1;

}

}

void updatePaddle1() {

int knob = analogRead(A0);

paddle1 = round((long)knob / (long)knobseg);

}

void updatePaddle2() {

int knob2 = analogRead(A1);

paddle2 = round((long)knob2 / (long)knobseg);

}

void displayBall() {

ballX = round(ballXabs);

ballY = round(ballYabs);

if (ballX % 2 != 0) {

index = (9 - ballY) + 10 * ballX;

if (ballX != 0) {

pixels.setPixelColor(ballY + 10 * (ballX - 1), pixels.Color(30, 0, 0)); //left side of ballcolor

}

if (ballX != 25) { pixels.setPixelColor(ballY + 10 * (ballX + 1), pixels.Color(30, 0, 0)); //right side of ball color

}

if (ballY != 9) { pixels.setPixelColor(index - 1, pixels.Color(30, 0, 0)); //bottom sides of ball color

}

if (ballY != 0) { pixels.setPixelColor(index + 1, pixels.Color(30, 0, 0)); //top sides of ball color

}

}

else {

index = ballY + 10 * ballX; if (ballX != 0) {

pixels.setPixelColor((9 - ballY) + 10 * (ballX - 1), pixels.Color(30, 0, 0)); //left side of ball even row

}

if (ballX != 25) {

pixels.setPixelColor((9 - ballY) + 10 * (ballX + 1), pixels.Color(30, 0, 0)); //right side of ball even row

}

if (ballY != 9) {

pixels.setPixelColor(index + 1, pixels.Color(30, 0, 0)); //bottom sides of ball even row

}

if (ballY != 0) { pixels.setPixelColor(index - 1, pixels.Color(30, 0, 0)); //top sides of ball even row

}

}

pixels.setPixelColor(index, pixels.Color(255, 0, 0)); ///center of ball color

}

void displayPaddle1() {

for (int i = 0; i < paddlewidth; i++) { pixels.setPixelColor(paddle1 + i, pixels.Color(0, 0, 255));

}

}

void displayPaddle2() {

for (int i = 0; i < paddlewidth; i++) { pixels.setPixelColor(NUMPIXELS - 1 - paddle2 - i, pixels.Color(0, 0, 255));

}

}

void score1() {

resetBall(0);

}

void score2() {

resetBall(1);

}

void resetBall(int player) {

delay(1000);

ballXabs = 12

; ballYabs = 4;

ballvelX = player ? 1 : -1;

ballvelY = 1;

clearScreen();

delay(1000);

displayBall();

pixels.show();

delay(1000);

displayPaddle1();

displayPaddle2(); pixels.show(); delay(2000); }

Step 7: Finishing

Once you have uploaded the code drill a hole in the back panel big enough for your barrel jack power adapter. plug it into the arduino and finally reassemble the back.

I also included on the part list the LED diffuser acrylic you can now place that over the LEDs and glue it down

After you have done this you are ready to play and enjoy the hours of competitive games against family and friends.

Lastly i would like to congratulate you on completing the project.

If you have any issues contact me on here and i would love to help resolve the issue.

Step 8:

Game Life Contest

Participated in the
Game Life Contest