LED Hat Display With Pong




About: Recently finished a Ph.D. in Mechanical Engineering. Still love creating in my spare time
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!

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Materials

-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
-Hot Glue

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

Step 2: 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

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

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

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

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

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

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

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

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

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

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!

The Instructables Book Contest

Participated in the
The Instructables Book Contest

Be the First to Share


    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    41 Discussions


    8 years ago on Introduction

    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


    11 years ago on Introduction

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


    11 years ago on Introduction

    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?

    3 replies

    Reply 11 years ago on Introduction

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


    11 years ago on Introduction

    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.

    1 reply

    Reply 11 years ago on Introduction

    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.


    11 years ago on Introduction

    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


    11 years ago on Introduction

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


    11 years ago on Introduction

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


    11 years ago on Introduction

    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.


    11 years ago on Introduction

    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).


    11 years ago on Introduction

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