World-class manufacturing

Programming A 16 Segment Display With ARDUINO

image of programming a 16 segment display with arduino
Table of Contents

Arduino Mega with 16 Segment Display

LED displays come in many shapes and variations. We witness these versatile displays in action every day in many different scenarios. Things such as digital clocks, elevator numbers, street signs, home appliances, digital compasses or any device that needs to display letters or numbers may use one of these expanded LED displays.

In previous tutorials we introduced the 7 segment display, this time around we will be using something a bit more adaptable. This tutorial will introduce you to a 16 segment display, and show you how to display letters, numbers, or symbols. By adding more LED partitions with a 16 segment LED display, we will have a bigger range of shapes to create and thus more letters and symbols.

image of 7 segment at 16 segment displays
7 Segment at 16 Segment Displays

 7 Segment at 16 Segment Displays

For this tutorial we will be using basic items to program the LED display, but remember that you can always get creative and expand or modify projects. 

materials needed for project
Materials Needed for Project

Materials Needed for Project:


For this tutorial we will be using basic items to program the LED display, but remember that you can always get creative and expand or modify projects.  

  • Arduino Mega 2560 (Or any variation you have with enough pins)
  • A to B USB cable
  • 18 Jumper wires
  • Bread board
  • 1 single 16 segment LED Display


  • Arduino IDE software


The concept behind the LED displays is basically the same no matter the quantities of segments. It is the wiring and programming of these individual segments that is responsible for the diversity of the displays.

16 segment close up picture

If you feel that you need to review or identify the different parts of an LED display, you can take a look at our previous tutorial “How a 7 Segment Display Works”.

16 Segment Close up Picture

It can be confusing working with electronic devices that include several pins, so here we will show you how to identify and set up the device. Begin by checking the back side of the display, and you will notice 18 pins. In order to do the wiring properly we must assign each pin and the Gnd (ground). This information is found on the technical specifications sheet, also known as the “data sheet”. When using Jaycon’s product, you can locate the data sheet in the product details page of the 16 segment display.

16 segment mapping diagram
16 Segment Mapping Diagram
PIN1 is located in the top left corner

PIN1 is located in the top left corner when facing the LED with the dot segment on the bottom right corner.

Insert the 16 segment display into the breadboard (be sure to allow room for your jumper wires). The pins in this LED display are located in the left and right sides of the part, so make sure that you place each pin in independent lines in the breadboard.

image of 16 segment in breadboard
16 Segment Mapping Diagram

Due to the amount of segments in the display, we will be requiring several digital pins (17). This is the reasoning behind selecting the Arduino MEGA instead of other arduino variations, but feel free to use any that you have. Select any digital pin on your Arduino (we started on pin 22), and assign it to PIN1 (Letter A1) on the segment.

image of close up connection
Close up Connection

Continue until all pins on the 16 segment are connected to their respected pins. If you aren’t using all of the segments, feel free to save some pins and wires off to the side. We went for it and decided to connect them all.

We started on pin 22 and completed the pinning on pin 51. On the Arduino MEGA, the even digital pins are all aligned in the left row on the digital section, so we decided to follow the line to keep the wires clean. Since the even row was full, odd pins 47 and 49 were used.

When it comes to your projects you can use any digital pin configurations that you are comfortable with.

image of programming a 16 segment display with arduino
Completed Project

Remember that pin 11 is ground. Forgetting this might cause you to think that something is wrong, but don’t panic! Your display will not light up until the ground pin is connected and the circuit is complete. Connect the Arduino to the computer, using the A to B USB cable and open the Arduino IDE software.

Go to Tools > Serial Port and make sure you have selected the proper serial port.  (Ex. COM3)

Go to Tools > Board and make sure you have selected the Arduino Mega 2560 or any Arduino board you are using.


Now it’s time to enter the code. You can copy the code I’ve developed below (feel free to play with and edit this code). If you prefer, go ahead and enter your own code. We acknowledge that there are several ways to achieve results, if you have any suggestions or ideas please let us know in the comment section.

//Declare a 21 size array to hold the location of the pins that will be used in the board
//I started at pin 21 and finished at 58, they can be modified and adapted to any pins

int pinArr[21] = ;
int duration = 1000; //Interval in between letters

// Set up which segments have to be turned on or off for each letter or symbol
//you can identify the neccesary pattern using the data sheet map

int letJ[21] =;
int letA[21] =;
int letY[21] =;
int letC[21] =;
int letO[21] =;
int letN[21] =;
int let_[21] =;

void setup()

//For loop to declare all pins as an output
//in this case because I used an uno my values were from 22 to 58

int Pin =0; //declared the pin var
 for (int Pin = 22; Pin <= 58; Pin++) {
   pinMode(Pin, OUTPUT);
// this is the function that will light up the display depending on which array(letter) is passed
void segmentPrint(int array[])
for(int i =0; i<21; i++ )
digitalWrite (pinArr[i], array[i]);
// this is the main loop where you can pass any desired array(letter or pattern) that is already defined
void loop()
segmentPrint(letJ); delay(duration);
segmentPrint(letA); delay(duration);
segmentPrint(letY); delay(duration);
segmentPrint(letC); delay(duration);
segmentPrint(letO); delay(duration);
segmentPrint(letN); delay(duration);
segmentPrint(let_); delay(duration);

//End of Code

Notes about the project: This is the Map of the pin segments in the display. You can create any character or letter design using the map and graphic in the data sheet.

PIN1 is located in the top left corner

Related Post

How to Avoid Design Mistakes: EVT, DVT, and PVT

Explore the future of product design in 2024, adapting to advancements in technology and…

Jaycon’s Top 5 Revolutionary U.S. Manufacturers

Happy Independence Day, innovation enthusiasts! Welcome to the grand finale of Jaycon’s 4th of…

Jaycon’s Top 5 All-American Inventions

Happy Independence Day, tech enthusiasts! Here at Jaycon, we’re celebrating the Fourth of July…