Introduction: LED Hat Display With Pong

Picture of LED Hat Display With Pong
A while ago, as my first microcontroller project, I made a Pong game on a 5x7 LED display, but then nothing became of it. Recently I was given a hard hat as part of a uniform (for an engineering competition) and told to customize it, and remembered pong.

In this instructable I will show you how to make a scrolling LED display and how to install it in a hard hat. It also plays pong!


Step 1: Materials

Picture of Materials

Parts:
-2 10k potentiometers
- 3 4.7 kOhm resistors
-4 SPST toggle switches
-1 5x7 bicolour LED display
-1 8 pin dipswitch
-1 Hardhat
-1 atmega168 microcontroller (or arduino)
-1 28 Pin 'skinny' socket
-1 breadboard
-1 3.7V lithium polymer battery
-Wire
-Solder
-Hot Glue

Tools:
-Soldering Iron
-Hot Glue Gun
-Wire Stripper
-Hobby Knife
-Plexiglas Cutting Knife
- Microcontroller Programmer (optional)

Step 2: Solder the Display

Picture of Solder the Display

For the first step, you need to solder wires to the display. You will also need to solder one switch from the dip switch between the two colours' cathodes for each row. To make it clearer I have attached a schematic of the display in the pictures (click the [i] on the picture to get the full sized version).

For the next step I used switch 8 for a 'travel mode'. This is so the hat isn't accidentally turned on in a bag and drained.

Step 3: Solder the Power Connections

Picture of Solder the Power Connections

For this step you need to solder the microcontroller socket to the breadboard. Then solder all of the power connections to the microcontroller socket pins. If you are unsure which pins to solder, there is a good reference here.

Step 4: Attach the LEDs to the Board

Picture of Attach the LEDs to the Board

Now you need to attach the wires coming off the LED display to the breadboard. To help with this see the attached schematic, or you can look in the code in the intro to find the output pins on the arduino.

Step 5: Solder Switches

Picture of Solder Switches

Next solder the switches to the breadboard. I have again attached the schematic in the pictures of this step.

For each switch, it is one contact of the switch connected to the corresponding microcontroller pin and the other to the positive voltage. There is also one resistor from the input pin to ground for each switch.

Step 6: Solder the Potentiometers

Picture of Solder the Potentiometers

To solder the potentiometers, first solder the positive power to one of the outside leads (each pot has 3 leads, one for each end of the resistor and one for the changeable middle). Solder the negative to the other outside lead and a wire going between the corresponding analog in on the microcontroller, and the middle lead. Do this for each pot.

What side you solder the positive and negative lead on matters, it affects what way you turn the pot to move the paddle up or down. The best way to figure what side to solder it to is to solder the positive lead on the bottom when the 3 pot leads face the display from the side they will be mounted on. Or just guess and change it later.

This is also a good place to solder the speaker, attach one side to pin 15 on the microcontroller and the other to ground.

Step 7: Program the Microcontroller

Picture of Program the Microcontroller

This can be the most daunting task if you are new to microcontrollers. The setup I use to program the microcontrollers using an AVRisp mkII to load the bootloader for an Arduino, which can be programmed over USB.

Load the program attached to this step (or in the intro) onto the microcontroller (the .hex file in the applet folder can be loaded onto the microcontroller in place of the bootloader). When burning the bootloader, set the chip to use the 8MHz internal crystal, unless you want to use an external crystal (the extra speed isn't really needed). If you do re-compile the code be sure it is at the correct clock speed for what you will be using.

Once it's programmed, put the chip into the socket on the breadboard.

Step 8: Testing and Debugging

Picture of Testing and Debugging

Now is the time to connect the battery and hope it works.

If it didn't work, I'll try to give some debugging tips:

if a line is missing from the display, it is a loose connection or a shorted wire.
is nothing is happening, first check the power and the switches. If it is getting the proper voltage and still doesn't work (and the chip is plugged in the proper way), test all of the components one by one.

If it powers on, but the screen isn't displaying properly, ensure that you have the proper type of display, 5 cathode rows and 7 anode columns (the labeling of the rows and columns can vary from data sheet to data sheet).

If it still doesn't work, leave a comment and I will try to help.

Step 9: Operation

Picture of Operation

Once it is on, flip switch one to switch between Pong and the display mode.

In display mode it will show UOIT (my university) and if you flip switch 3 it will show ERTW (bonus points of you figure this one out).

In Pong mode, turn the potentiometer to move the paddles. Flip switch 2 to change from 1 player to 2 player and if you are finding it too easy, flip switch 3 to speed it up.

Step 10: Prepare the Hat's Display Hole

Picture of Prepare the Hat's Display Hole

This is the first step in installing the electronics in your hat.

Start by tracing a template of the display and cut it out. Tape the cut-out to the hat where you want the display to go, then trace it with the hobby knife. Be vary careful at this part, it is easy to slip when cutting hard curved surfaces. Now with the outline on the hat, take the plastic cutting knife and trace along the lines until you poke through. Now finish the hole by cutting out the remaining joining plastic with the hobby knife.

Step 11: Drill the Switch Holes

Picture of Drill the Switch Holes

I placed my switch holes down the center like a short metal Mohawk, but you can place them wherever you like.

Start by making small Xs, one for each switch and accessory. Tape these to the helmet with the middle of the X where you want the hole.

Now select the appropriate drill size and drill each hole.

Step 12: Finish the Hat

Picture of Finish the Hat

The final step is to install all of the parts in the corresponding holes, and apply hot glue as necessary to hold the parts in place. I have put notes in the photos for more pointers.

All that is left to do is show it off!

Since you've read this far, you must be at least interested, so please rate it!

Comments

stratos13pao (author)2011-06-05

well thats a really nice project
I am Greek and the letters ertw are greek so i wonder if they or u are related to greece someway
i cant though find their meaneing i would love an answer

reggae_boyz (author)2011-02-12

UOIT being represented rather nicely, good job.

thejuggler (author)2008-09-21

Does ERTW stand for Electronics, Robotics, Technology, W00T?

J_Hodgie (author)thejuggler2008-09-21

Nope, Engineers Rule The World.

ninja slacker (author)2008-08-09

love the hard hat and love the choice of song.

J-Five (author)2008-08-07

Cool But I think someone had just too much time on their hands.

bumsugger (author)2008-08-07

Sheeeeeeeeesh!!

puzzlefreak (author)2008-06-24

That was simply awesome. Nice project.

Patrik (author)2008-02-07

Very cool project! And just ever so slightly geeky. :-D

That 5x7 LED display is a great find, by the way - $1.49 for 70 LEDs! That's just over 2 cents per LED - must be some sort of record...

Since you're at an engineering school, I assume ERTW stands for Equal Rights Towards Women. Now, can I get my bonus points? ;-)

Google - is there anything it can't do?

J_Hodgie (author)Patrik2008-02-07

Thanks for the comment. Not quite, but it is in the link.

thefunktopus (author)J_Hodgie2008-05-10

it's engineers return to work, i think this because you say the hat is for an engineering project.

Derin (author)Patrik2008-03-23

yes it cant give me pages for my school reports

sidgug (author)2008-03-05

Great project. Well done. I will be able to learn a lot from studying your code. I'm just not sure about the bi-colour display. Will I need to change much in the code if I just hook it up to a single colour matrix? Thanks for posting the code.

J_Hodgie (author)sidgug2008-03-06

No, I just controlled the bi-colour display in the hat through the dip-switches above it, so the code is already in one colour.

cheezydog100 (author)2008-03-05

you are a genus but im only 10 and cant do this but i'll probaly try i'd put it on my math book need some thin to do lol

Thornburg (author)2008-02-13

It is so awesome, yet so random. I am impressed. +1 Favorited

clamoring (author)2008-02-12

Very very nice work. I was looking for an Arduino project. This looks like just the thing!

DamionLee (author)2008-02-10

That's a nice Instructable. Almost has me ready to go into the attic to find my old hard-hat. Think I may have to find some other housing for it instead. Well done.

DamionLee (author)2008-02-10

That's a very suspect link ansem. Perhaps you should take your spam elsewhere. (The link is not for Think Geek, but for some page on a free host with ansem's name in it - look at the status bar at the bottom of your browser when hovering your mouse cursor over a link before clicking on it).

ongissim (author)2008-02-08

Awesome! This is similar to this; only your led matrix is in landscape, which makes pong much easier to play! Nice job.

noremakk (author)2008-02-07

Is there a way to program the display using a Mac?

J_Hodgie (author)noremakk2008-02-08

Yes, there is. There are also some more resources at http://www.arduino.cc/

maker12 (author)2008-02-08

ponghat!

dj whatever (author)2008-02-08

OMG we have the same heli. I have an Instructable for this!!!

gmoon (author)2008-02-07

Nooooo liner?? Canya nay wear it, laddie? (awwwww, you get a + anyway. Nice job.)

J_Hodgie (author)gmoon2008-02-07

There is a liner, it is propping the helmet up in the main photo. I just removed it to take a picture of the finished electronics. And thanks for the comment.

mrmath (author)2008-02-07

You got my vote for the LED contest.

J_Hodgie (author)mrmath2008-02-07

Thanks!

455H013 (author)2008-02-07

Hey, do you go to UOIT? Also, engineers rule the world

455H013 (author)455H0132008-02-07

Replying to myself, it says you do on step 9. I'm a second year mech eng.

J_Hodgie (author)455H0132008-02-07

Yes I do, I am in second year mechatronics.

darkmuskrat (author)2008-02-07

I agree with Gorillaz, this is cool

GorillazMiko (author)2008-02-07

Incredible job. Reminds me a lot of Kiteman's UV Ray light Instructable.

stourleyk (author)2008-02-07

Oh, I thought it said, "with bong." My bad.

nagutron (author)2008-02-07

My lord. This just reminded me of one of the funniest Overheard in New York posts of all time:

And What Part Will the Helmet Play in That?

Nerdy hipster to friends: You want nerdy? You know what I did today? I worked on this robot helmet I'm making on my floor. Yep, a robot helmet complete with LED lights -- for my girlfriend. See? That's love right there.
Girlfriend, explaining: I told him we could have butt sex.
Nerdy hipster, emphatically: But not until I finish the helmet!

--L train

Kiteman (author)2008-02-07

Very nice - the long pots make it look quite impish, but aren't they vulnerable to getting knocked off? Maybe shorter knobs would have been better?

J_Hodgie (author)Kiteman2008-02-07

Thanks. The long pots are very sturdy, no risk there, so it is basically what you want (or to get the more authentic pong feeling)

angelicgundam90 (author)2008-02-07

Hey what engineering competition are you talking about? FIRST? an awesome hard hat

J_Hodgie (author)angelicgundam902008-02-07

The competition is the Ontario Engineering Competition. Thanks.

fungus amungus (author)2008-02-07

Love it, but where's the video?

J_Hodgie (author)fungus amungus2008-02-07

Thanks, and I' m going to do that tonight.

About This Instructable

18,219views

47favorites

License:

Bio: Currently doing masters in Mechatronics Engineering, but still create in my spare time
More by J_Hodgie:Cheshire Cat Pumpkin animated with LEDsWalking Papercraft Mech WarriorGeared Christmas Card
Add instructable to: