USA Flag Made With Diffused LED




Introduction: USA Flag Made With Diffused LED

USA flag constructed using a total of 2,301 diffused red, white and blue LEDs completed with Arduino sketch animations, I hope this instructions helps anyone who wants to try this out. This flag can be displayed during the 4th of July, memorial day or during Christmas. If you find this project interesting and you do something similar by making either the hardware or the Arduino software codes better, please share with others.

Below is the You Tube video of the finished flag.

Step 1: Materials and Tools

Here is a list of materials and tools I used for this


  • Polystyrene plastic sheet (0.125" thickness; Quantity: 1)

($21 + $12.35 shipping US):

  • 5mm Red Diffused LED (Quantity: 1000)

($16.52 for 1000 free shipping from China):

  • 5mm White Diffused LED (Quantity: 1000)

($22.40 for 1000 free shipping from China):

  • 5mm Blue Diffused LED (Quantity: 500)

($11.91 for 500 free shipping from China):

  • Arduino Mega 2560

($14.96 free shipping US)

  • N-Cannel MOSFET (Quantity: 15)

($12.13+ $3.09 shipping US)

  • 12V 5A Power Supply (Quantity: 1)

($15.99 free shipping US):

  • Prototype board (Quantity: 1)

Obtained at a local Radioshark at $3.49

  • 100 ohms Resistors (Quantity: 975)

Obtained at a local component store $0.03/resistor

  • 220 ohms Resistors (Quantity: 50)

Obtained at a local component store $0.03/resistor


  • Soldering iron
  • Solder lead
  • Drill Press (This will make it a lot easier and accurate drilling than hand drill)
  • Needle-nose pliers
  • Cutter
  • Tape measure
  • Pencil to mark the grid lines
  • Ruler (As long as possible, I used long wooden ruler from Home Depot)
  • Multi meter

Step 2: Measurement and Grid Lines

The standard ratio of USA flag is 10:19 (Length: Breadth), the aim is to make flag that is 30inches breadth meaning that the length will be 15.8inches (rounded to 16). Cut out 16" x 30" from the polystyrene sheet, make sure you have minimum of 1/2 inch on all edges (this is useful for attaching the wooden frame at the very end.

Mark out 1/4" space from left side of the board to the right and 1.18" from top to the bottom forming a grid. I have attached excel sheet that show the LED layout for visual aid. Ensure that all the grid intersections are numbered left to right and top to bottom (Rows and columns). There should be 39 rows and 60 columns making a total of 2,340 LEDs; spreadsheet also included LED counts.

Step 3: LED Hole Drilling

Using drill press (preferable one with Laser guide) and 3/16" drill bit, drill LED holes at the intersection of the grid drawn out above. Use a 3/16" drill bit will ensure the LED fits snugly into the hole, but it require a bit of effort to place LED in.

Special Note:

The drill press that I used was only able to reach about 4 1/2" around the rectangular polystyrene sheet meaning that it was not possible to get to the inner part of the sheet, fortunately, the polystyrene sheet was flexible enough to be bent around so I was able to use the press to completely drill all the 2,340 holes. Also, I made a mistake while I was measuring out my grid, instead of having 60 columns as I had planned it out on the spreadsheet, I had 59! So in total I only had 2,301 holes to drill; this did not make much of difference in the final product though

Step 4: Current Limiting Resistor

The LEDs were connected in series and then parallel, I used LED wizard to figure out the resistor values that will be required to limit current flowing through the LEDs.

Since the bulk of the LEDs are in set of three rows, the suggested pattern that uses 100 ohms current limiting resistors was adopted (Note that there are 35 columns for the first seven stripes and 60 columns for the remaining 6 stripes all of them having three LEDs in series. The image below only show a representative image and not the entire picture, refer to the spreadsheet for entire representation)

Step 5: LEDs in Drilled Holes & Solder

Ensure that the cathode pins are all facing the same direction; typically, if starting from top to bottom the cathode should be facing South

Cut the cathode pin of the first LED in the series leaving a little above 1/8" then place a solder lead at the very top of the cut pin, similarly, cut one end of the resistor wire a little above 1/8" then place a solder lead at the very top of the cut pin

Join the resistor with the cathode pin of the LED as shown in the image above. There is another picture of the LEDs being laid out as described, notice the resistor conveniently attached to styro-foam.

Once all the series and parallel connections have been completed, there should be 15 cathode pins and 15 anode pins. Connect all anode pins together to form one bus. Each of the remaining 15 cathode pins will be used to control the LEDs using Arduino

Step 6: Connect LED Board to Arduino

On the Arduino Mega 2560, pins 22 through 36 were used to control the LEDs on the flag. The pins 22 through 34 were used to control the 13 stripes while pin 35 was used for the blue LEDs and pin 36 was used to control the white LEDs that represented 50 stars.

Each Arduino header pin was connected to a N-Chanel MOSFET so that current being drawn by the LEDs cannot destroy the Arduino board. Arduino and the LEDs were powered by a 12V 10A power supply

Arduino sketch is attached and it is heavily commented. The sketch uses Software Pulse Width Modulation by bhagman found at at the following URL:

and ideas found from the Bob Powell's sketch at the following URL:

The software PWM library is attached as a zipped file, unzip into Arduino library folder so it can be referenced by the USA flag sketch. The main reason for using the software PWM library is so the LEDs can be operated at various brightness levels and since there are limited PMW pins on an Arduino soft PWM is used so any pin can be pulse width modulated. When the LEDs are operated below their full brightness levels, the current requirements are significantly reduced; for instance at full brightness level, all the 2,301 LEDs on the board consume more than 6A, however at the various brightness levels tested and used, current requirement when all the LEDs are on is well below 600ma!

Step 7: Case Build

A simple wooden box was built around the LED board, then painted black as shown. Yeah, I know the final packaging could have been done a little better, but this is the best I could come up with, the fact is that it worked and is protected from the elements when placed outside for display.

Tech Contest

Participated in the
Tech Contest

Formlabs Contest

Participated in the
Formlabs Contest

Microcontroller Contest

Participated in the
Microcontroller Contest

Be the First to Share


    • Game Design: Student Design Challenge

      Game Design: Student Design Challenge
    • For the Home Contest

      For the Home Contest
    • Big and Small Contest

      Big and Small Contest


    Barry 07
    Barry 07

    Question 2 years ago

    Where can I get a phenolic prototype this size?

    Barry 07
    Barry 07

    2 years ago

    I plan on building this flag on a smaller scale(11"x 17"). Where can I get a prototype board this size or your original size 16"x 30". I've been searching the internet for a couple of hours.


    3 years ago

    Bravo !!!! what patience you must have !! congratulations...

    Fission Chips

    Incredible! This is crazy huge and complex, but looks totally awesome. Really good job on this!


    8 years ago

    This is cool. Really cool! 2301 LEDs! Omg! As arpoky said, adding a dimming wave effect would be awesome! I really appriciate it!


    8 years ago

    This is great! Definitely suitable for nighttime display, because the Flag should always be illuminated when flown at night. Think you can make the lights dim so it looks like it's waving?


    8 years ago

    Well that's a lot of LEDs, I like it! Great job, that must have taken some serious hours.


    Reply 8 years ago on Introduction

    Thanks, yes it took some time to complete most especially hole drilling and soldering and testing the LEDs. The Arduino software code was the easiest part.