Simple DIY 3x4 LED Display for Arduino MEGA / Uno / Nano




Introduction: Simple DIY 3x4 LED Display for Arduino MEGA / Uno / Nano

In this Instructable I'll show you how to make a small 3x4 LED 'display' for an Arduino with a minimum of 12 pins (in this case I used an Arduino Uno). One reason for me to build this was to make a small display by just using the Arduino without needing an extra microcontroller - I just wanted to build something with with basic components. I know that I could do this better but it was my first own Arduino project (before that I just re-build other projects and copied the codes).

Step 1: What You'll Need...

For this project you'll need...


  • 1x Arduino MEGA / Uno / Nano (one with a minimum of 12 pins) [I got mine from China]
  • 12x LED's [I got these in a mix of 20x red, blue, yellow and green also from China]
  • 12x 220Ω Resistors [I got these from a local components store]
  • Cables [I used jumpercables which I cutted in half - also from China]
  • some cardboard to mount the LED's on


  • Soldering Iron (optional)

Step 2: The Setting of the Components

Here you can see the plan, how the components are connected.

Step 3: Build Log

First I poke holes for the LED's in the cardboard and inserted the LED's. Than I soldered all negative pins together (the copper wire). After that I soldered the resistors to the positive pins and soldered the wires to the resistors.

Why do you need the resistors?

First I just soldered the wires to the LED's but the main chip of the Arduino can not handle all LED's togehter -> it will get really hot (on a long period of time it will damage your chip). The main chip can only handle about 200mA (it depends on your board).

Step 4: Final Display...

I just added a frame and some legs so it can stand beside the Arduino.

Than you just have to connect all wires to the Arduino as shown on the picture or on the sketch above.

Step 5: The Code...

Here's an example code which lights up the LED's as shown in the animated picture:

Head of the Code:

void setup() {
  pinMode(13, OUTPUT);
  pinMode(12, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(8, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(2, OUTPUT);

Main part of the Code:

void loop() { //Here I have all frames for the animation
  int a2[4] = {1,0,0,0}; //Each array stants for each line and each '0' or '1' stands for each LED
  int b2[4] = {0,0,0,0}; //1 = LED ON - 0 = LED OFF
  int c2[4] = {0,0,0,0}; //I'm using three arrays here to see how the result will look like
  led(a2, b2, c2); //I excluded the code which tunrs the LED's ON or OFF
  delay(200); //Time between the frames - I animated the 
  int a3[4] = {1,1,0,0};
  int b3[4] = {0,0,0,0};
  int c3[4] = {0,0,0,0};
  led(a3, b3, c3);
  int a4[4] = {1,1,1,0};
  int b4[4] = {0,0,0,0};
  int c4[4] = {0,0,0,0};
  led(a4, b4, c4);
  int a5[4] = {1,1,1,1};
  int b5[4] = {0,0,0,0};
  int c5[4] = {0,0,0,0};
  led(a5, b5, c5);
  int a6[4] = {1,1,1,1};
  int b6[4] = {0,0,0,1};
  int c6[4] = {0,0,0,0};
  led(a6, b6, c6);
  int a7[4] = {1,1,1,1};
  int b7[4] = {0,0,1,1};
  int c7[4] = {0,0,0,0};
  led(a7, b7, c7);
  int a8[4] = {1,1,1,1};
  int b8[4] = {0,1,1,1};
  int c8[4] = {0,0,0,0};
  led(a8, b8, c8);
  int a9[4] = {1,1,1,1};
  int b9[4] = {1,1,1,1};
  int c9[4] = {0,0,0,0};
  led(a9, b9, c9);
  int a10[4] = {1,1,1,1};
  int b10[4] = {1,1,1,1};
  int c10[4] = {1,0,0,0};
  led(a10, b10, c10);
  int a11[4] = {1,1,1,1};
  int b11[4] = {1,1,1,1};
  int c11[4] = {1,1,0,0};
  led(a11, b11, c11);
  int a12[4] = {1,1,1,1};
  int b12[4] = {1,1,1,1};
  int c12[4] = {1,1,1,0};
  led(a12, b12, c12);
  int a13[4] = {1,1,1,1};
  int b13[4] = {1,1,1,1};
  int c13[4] = {1,1,1,1};
  led(a13, b13, c13);
  int a14[4] = {0,1,1,1};
  int b14[4] = {1,1,1,1};
  int c14[4] = {1,1,1,1};
  led(a14, b14, c14);
  int a15[4] = {0,0,1,1};
  int b15[4] = {1,1,1,1};
  int c15[4] = {1,1,1,1};
  led(a15, b15, c15);
  int a16[4] = {0,0,0,1};
  int b16[4] = {1,1,1,1};
  int c16[4] = {1,1,1,1};
  led(a16, b16, c16);
  int a17[4] = {0,0,0,0};
  int b17[4] = {1,1,1,1};
  int c17[4] = {1,1,1,1};
  led(a17, b17, c17);
  int a18[4] = {0,0,0,0};
  int b18[4] = {1,1,1,0};
  int c18[4] = {1,1,1,1};
  led(a18, b18, c18);
  int a19[4] = {0,0,0,0};
  int b19[4] = {1,1,0,0};
  int c19[4] = {1,1,1,1};
  led(a19, b19, c19);
  int a20[4] = {0,0,0,0};
  int b20[4] = {1,0,0,0};
  int c20[4] = {1,1,1,1};
  led(a20, b20, c20);
  int a21[4] = {0,0,0,0};
  int b21[4] = {0,0,0,0};
  int c21[4] = {1,1,1,1};
  led(a21, b21, c21);
  int a22[4] = {0,0,0,0};
  int b22[4] = {0,0,0,0};
  int c22[4] = {0,1,1,1};
  led(a22, b22, c22);
  int a23[4] = {0,0,0,0};
  int b23[4] = {0,0,0,0};
  int c23[4] = {0,0,1,1};
  led(a23, b23, c23);
  int a24[4] = {0,0,0,0};
  int b24[4] = {0,0,0,0};
  int c24[4] = {0,0,0,1};
  led(a24, b24, c24);
  int a25[4] = {0,0,0,0};
  int b25[4] = {0,0,0,0};
  int c25[4] = {0,0,0,0};
  led(a25, b25, c25);

Excluded Code which turns the LED's ON or OFF:

void led(int r1[], int r2[], int r3[]){
    digitalWrite(13, HIGH);
    digitalWrite(13, LOW);
    digitalWrite(12, HIGH);
    digitalWrite(12, LOW);
    digitalWrite(11, HIGH);
    digitalWrite(11, LOW);
    digitalWrite(10, HIGH);
    digitalWrite(10, LOW);
  //------------------------------ I just made this to see where one line ends / starts
    digitalWrite(9, HIGH);
    digitalWrite(9, LOW);
    digitalWrite(8, HIGH);
    digitalWrite(8, LOW);
    digitalWrite(7, HIGH);
    digitalWrite(7, LOW);
    digitalWrite(6, HIGH);
    digitalWrite(6, LOW);
    digitalWrite(5, HIGH);
    digitalWrite(5, LOW);
    digitalWrite(4, HIGH);
    digitalWrite(4, LOW);
    digitalWrite(3, HIGH);
    digitalWrite(3, LOW);
    digitalWrite(2, HIGH);
    digitalWrite(2, LOW);

You are free to use this code in any project.

I know this is a bit circuitous but this is just the first basic script out of my head to run the display and I also had no idea to make it a bit easier - perhaps I'll upload a better code later.

If you have any tips for me to make this code easier let me know :)

Step 6: Finished Project...

If you made this project or something similar to this please let me know and also if you have some questions left or some suggestions for me put them also down in the comments...

Be the First to Share


    • Pocket-Sized Speed Challenge

      Pocket-Sized Speed Challenge
    • Super-Size Speed Challenge

      Super-Size Speed Challenge
    • Audio Challenge 2020

      Audio Challenge 2020

    4 Discussions

    Ramkumar paidi
    Ramkumar paidi

    3 years ago

    nice display can we use more leds and improve it


    Reply 3 years ago

    Yes you can use more leds, but then (in case that you would like to use this setup [one led to one digital pin]) you'll need more digital pins (Arduino MEGA).

    But you could also buy or rebuild the LOL Shield (Lots of LEDs) for the Arduino Uno (which has 126 leds on just one Arduino).


    3 years ago

    Really nice display, But you dont need to mention the model of arduino we can use any of them

    DIY Hacks and How Tos

    Nice display. If you multiplex the LEDs you can control even more with the same Arduino.