Skip to content
Free Delivery on Orders Above Rs 999/- Pan-India
Cash on Delivery Available for Orders above Rs.500/- and Upto Rs 3000/-
SAVE more when you BUY more. Upto 30% Off on BULK PURCHASE
GST Invoices for Your Business
Dedicated Technical Support Team
Safely Delivering Genuine Products PAN INDIA

7 Segment Display Pin Diagram: Common Anode vs Cathode

7 Segment Display Pin Diagram: Common Anode vs Cathode
-
Written By - Robocraze -
📅 Updated on 17 Nov 2026
✨ Summarize with AI
✅ Prompt copied

Summary

A 7 segment display has seven LED segments (a to g) and a decimal point on 10 pins, with pins 3 and 8 as common. This guide covers the labelled pinout, common anode vs common cathode truth tables, a multimeter test to identify your display, resistor wiring, and Arduino code that counts 0 to 9.

7 Segment Display Pin Diagram: Common Anode vs Common Cathode (With Arduino Code) - Cover Image

A 7 segment display has seven LED segments (a to g) and a decimal point (DP) on 10 pins, with pins 3 and 8 as the common pins. In a common anode display, the common connects to VCC and a segment lights on LOW. In a common cathode display, the common connects to GND and a segment lights on HIGH.

In this post, we look at the 7 segment display pin diagram, compare common anode and common cathode types, test a display with a multimeter to find out which one you have, and write Arduino code that counts from 0 to 9.

What Is a 7 Segment Display?

A 7 segment display is a package of seven bar-shaped LEDs arranged in the shape of the number 8. By switching different segments on and off, it can show any digit from 0 to 9 and a few letters such as A, b, C, d, E and F.

The segments are named a to g, going clockwise from the top bar, with g as the middle bar. Most displays also have an eighth LED, the decimal point (DP), at the bottom right.

7 Segment Display Working

Each segment is a normal LED with an anode (+) and a cathode (−). To save pins, the manufacturer joins one side of all eight LEDs together inside the package. This shared connection is called the common pin.

  • If all the anodes are joined, it is a common anode display.
  • If all the cathodes are joined, it is a common cathode display.

The other end of each LED comes out on its own pin. You light a segment by completing the circuit through that pin, so the display only needs 8 control lines plus the common, instead of 16 separate wires.

For example, to show the digit 1, you turn on segments b and c only. To show 8, you turn on all seven.

Components and Supplies

7-Segment LED Display (Common Anode) – For electronic circuits. -LED Display -Robocraze7-Segment LED Display (Common Anode) – For electronic circuits. -LED Display -Robocraze

7 Segment Led Display (Common Anode)

7 Segment Led Display (Common Anode) 7 Segment Led Display (Common Anode), is a form of an electronic display device for displaying decimal numerals that is an alternative to the more complex dot matrix displays. The Common Anode (CA) - In the common anode display,...
Rs 12/-
Rs 12/-
Rs 24/-
Save Rs 12/-
7-Segment LED Display (Common Cathode) – For numerical data output -LED Display -Robocraze7-Segment LED Display (Common Cathode) – For numerical data output -LED Display -Robocraze

7 Segment Led Display (Common Cathode)

7 Segment Led Display (Common Cathode) 7 Segment Led Display (Common Cathode), is a form of an electronic display device for displaying decimal numerals that is an alternative to the more complex dot matrix displays. In a common cathode display, all of the LED...
Rs 11/-
Rs 11/-
Rs 29/-
Save Rs 18/-
Original Arduino Uno R3 microcontroller board with ATmega328P and USB port - Arduino Uno Board -RobocrazeOriginal Arduino Uno R3 microcontroller board with ATmega328P and USB port - Arduino Uno Board -Robocraze

Arduino Uno R3 Original

Arduino UNO R3 Original The Arduino Uno R3 is a microcontroller board based on the ATmega328P chip and is widely recognized as the best original Arduino Uno board for beginners and projects. This board has 14 digital I/O pins (6 support PWM), 6 analog...
Rs 2,750/-
Rs 2,750/-
Rs 3,499/-
Save Rs 749/-
Arduino Uno R3 Board compatibleArduino Uno R3 Board compatible

    Arduino Uno R3 Board compatible

    Arduino Uno R3 Compatible Board  The Arduino Uno R3 ATMEGA328P Development Board is more than just a microcontroller board; it's a gateway to endless possibilities in the world of electronics and programming. For hobbyists, students, and makers, it stands out as the best Arduino Uno...
    Rs 429/-
    Rs 429/-
    Rs 699/-
    Save Rs 270/-
    220 Ohm Resistor (10PC) – Voltage regulation resistors. -Basic Components -Robocraze220 Ohm Resistor (10PC) – Voltage regulation resistors. -Basic Components -Robocraze

      220 Ohm Resistor - (Pack of 10)

      220 Ohm Resistor - (Pack of 10) A 220-ohm resistor is an electronic component that is used to resist the flow of electricity in a circuit. Resistors are used in a wide variety of electronic circuits to control the flow of current and protect...
      Rs 9/-
      Rs 9/-
      Rs 15/-
      Save Rs 6/-
      GL12 840 Points Solderless Breadboard for Large Prototyping - Electronic Components -RobocrazeGL12 840 Points Solderless Breadboard for Large Prototyping - Electronic Components -Robocraze

        GL12 840 Points Solderless Breadboard

        GL12 MB102 840 Points Solderless Breadboard Introducing the GL12 840 Points Breadboard at Robocraze! This solderless breadboard is an essential tool for any electronics engineer or hobbyist. It allows you to make temporary prototypes for your electronics projects, making it perfect for experimenting with...
        Rs 69/-
        Rs 69/-
        Rs 90/-
        Save Rs 21/-
        Jumper Wire Set - M2M, M2F, F2F (40 pcs each) – Ideal for Arduino & prototyping. Electronic Components - RobocrazeJumper Wire Set - M2M, M2F, F2F (40 pcs each) – Ideal for Arduino & prototyping. Electronic Components - Robocraze

          Jumper Wire Set - M2M, M2F, F2F (40 pcs each)

          Jumper Wire Set - M2M, M2F, F2F (40 pcs each) These DuPont jumper wires for electronics are premium quality wire manufactured by using quality assured material and advanced techniques, which make them up to the standard in this highly challenging field. This 120pcs Dupont...
          Rs 164/-
          Rs 164/-
          Rs 169/-
          Save Rs 5/-

          7 Segment Display Pin Diagram

          The standard single-digit 7 segment display (the 0.56 inch type used in most Arduino projects) has 10 pins in two rows of five. Hold the display facing you with the decimal point at the bottom right. Pin 1 is at the bottom left, and the numbering runs anticlockwise.

          7 Segment Display Pin Diagram

          The pinout is the same for common anode and common cathode displays. Only the job of the common pins changes.

          Pin Function What it controls
          1 e Bottom-left segment
          2 d Bottom segment
          3 COM Common anode or common cathode
          4 c Bottom-right segment
          5 DP Decimal point
          6 b Top-right segment
          7 a Top segment
          8 COM Common anode or common cathode
          9 f Top-left segment
          10 g Middle segment

          Pins 3 and 8 are connected to each other inside the package, so you only need to wire one of them. Using both is fine and spreads the current across two pins.

          Robocraze tip: Most single-digit displays follow this pinout, but some sizes and brands do not. If your display behaves strangely, run the multimeter test below to confirm each pin before soldering.

          Common Anode vs Common Cathode

          The only difference between the two types is which end of the LEDs is joined together. This one detail decides where the common pin goes and whether a segment turns on with HIGH or LOW.

          Common Anode vs Common Cathode

          A common anode display will not light at all if you wire it like a common cathode one, because every LED is reverse biased. Nothing gets damaged, but nothing glows either. This is the most common reason a new 7 segment circuit "does nothing".

          Feature Common Anode (CA) Common Cathode (CC)
          Joined inside All anodes (+) All cathodes (−)
          Common pin (3, 8) connects to VCC (5V on Arduino Uno) GND
          Segment turns ON when its pin is LOW (0V) HIGH (5V)
          Segment turns OFF when its pin is HIGH LOW
          Arduino pin role Sinks current Sources current
          Code logic Inverted (0 = ON) Direct (1 = ON)
          Matching BCD decoder IC 74LS47 / 7447 (active-low outputs) CD4511, 74LS48 (active-high outputs)
          Best for Logic ICs that sink current better than they source Beginners, because HIGH = ON reads naturally in code

          Shop the displays used in this guide

          Product Pick it if
          7 Segment LED Display (Common Anode) You are using a 74LS47 decoder or want the Arduino to sink current
          7 Segment LED Display (Common Cathode) You want the simplest Arduino code, where HIGH lights a segment

          Truth Table: Common Cathode (1 = segment ON)

          The hex code packs segments a to g into one byte, with a as bit 0 and g as bit 6. It is handy when you drive the display from a shift register.

          Digit a b c d e f g Hex
          0 1 1 1 1 1 1 0 0x3F
          1 0 1 1 0 0 0 0 0x06
          2 1 1 0 1 1 0 1 0x5B
          3 1 1 1 1 0 0 1 0x4F
          4 0 1 1 0 0 1 1 0x66
          5 1 0 1 1 0 1 1 0x6D
          6 1 0 1 1 1 1 1 0x7D
          7 1 1 1 0 0 0 0 0x07
          8 1 1 1 1 1 1 1 0x7F
          9 1 1 1 1 0 1 1 0x6F

          Truth Table: Common Anode (0 = segment ON)

          Every bit is simply flipped. If you already have the common cathode pattern, invert it and you get the common anode one.

          Digit a b c d e f g Hex
          0 0 0 0 0 0 0 1 0x40
          1 1 0 0 1 1 1 1 0x79
          2 0 0 1 0 0 1 0 0x24
          3 0 0 0 0 1 1 0 0x30
          4 1 0 0 1 1 0 0 0x19
          5 0 1 0 0 1 0 0 0x12
          6 0 1 0 0 0 0 0 0x02
          7 0 0 0 1 1 1 1 0x78
          8 0 0 0 0 0 0 0 0x00
          9 0 0 0 0 1 0 0 0x10

          How to Identify Common Anode or Common Cathode With a Multimeter

          Both types look identical from the outside, and the part number is often missing or rubbed off. The quickest way to tell them apart is the diode test mode on a digital multimeter. It takes under a minute and also confirms your pinout.

          In diode mode, the meter pushes a small current out of the red probe (+) and back into the black probe (−). An LED only conducts in the forward direction, so a segment glows only when the red probe is on its anode and the black probe is on its cathode.

          What you need: a digital multimeter with a diode test setting (the ▶| symbol) and the display itself. If you are new to meters, read our guide on how to read a multimeter first.

          Step-by-step test

          1. Set the dial to diode test. Black lead in COM, red lead in V/Ω. Touch the probes together; the display should read close to 0.
          2. Confirm the common pins. Touch one probe to pin 3 and the other to pin 8. A reading near 0 (or a beep) means they are joined inside, so these are your common pins.
          3. Test for common anode. Put the red probe on pin 3 and the black probe on pin 7 (segment a). If segment a glows faintly and the meter shows roughly 1.6V to 2.0V, the display is common anode.
          4. Test for common cathode. If nothing happened, swap the probes: black on pin 3, red on pin 7. If segment a now glows, the display is common cathode.
          5. Map every segment. Keep the probe that worked on the common pin and touch each remaining pin in turn. Note which segment lights for each pin number. If your notes match the pin table above, you have a standard pinout.
          Red probe Black probe Segment a glows? Result
          Pin 3 (COM) Pin 7 (a) Yes Common anode
          Pin 7 (a) Pin 3 (COM) Yes Common cathode
          Either way Either way No, OL both ways Pin 3 is not common on this display; repeat with pin 8, then check the datasheet

          Tips for if the segment does not glow

          • Shade the display with your hand. The glow from a meter's test current is faint, especially under bright lights.
          • Check the colour. A red display needs about 1.8V to light. Blue and white displays need about 3V, which some low-cost meters cannot supply. The meter will show OL even though the display is fine.
          • Check the reading, not just the glow. A reading of 1.5V to 2.0V in one direction and OL in the other proves the LED is there and working.

          No multimeter? Use the Arduino's 5V pin

          Connect the Arduino 5V pin through a 330Ω resistor to pin 3, and touch pin 7 to GND. If segment a lights, the display is common anode. If not, swap the two wires (5V through the resistor to pin 7, pin 3 to GND). If it lights now, it is common cathode.

          Never connect a segment straight to 5V without the resistor, even for a quick test. The LED can burn out instantly.

          Wiring a 7 Segment Display to Arduino With Resistors

          The wiring uses eight Arduino digital pins, D2 to D9, one for each segment and the decimal point. The common pin goes to GND for a common cathode display or to 5V for a common anode display. Everything else stays the same.

          Hardware Required

          Wiring a 7 Segment Display to Arduino With Resistors
          Display pin Segment Arduino pin
          7 a D2
          6 b D3
          4 c D4
          2 d D5
          1 e D6
          9 f D7
          10 g D8
          5 DP D9
          3 or 8 COM GND (common cathode) or 5V (common anode)

          If you need a refresher on where D2 to D9 sit on the board, see our Arduino Uno pin diagram guide.

          Every segment needs its own resistor

          Put one 220Ω to 330Ω resistor in series with each segment pin, not a single resistor on the common pin.

          Each segment is an LED, and an LED needs current limiting, exactly as in our LED interfacing with Arduino tutorial. If you use one resistor on COM, all the lit segments share that one current. The digit 1 (two segments) will look bright and the digit 8 (seven segments) will look dim. Separate resistors give every segment the same brightness, whatever digit is on screen.

          Here is the quick maths for a red display with a forward voltage of about 2V:

          • 220Ω: (5V − 2V) ÷ 220Ω ≈ 14mA per segment. Bright and safe.
          • 330Ω: (5V − 2V) ÷ 330Ω ≈ 9mA per segment. Slightly dimmer, easier on the board.

          With all eight LEDs on at 220Ω, the common pin carries about 110mA. That is within what the Uno's 5V and GND pins can handle for a single digit. For the colour codes and resistor types, see types of resistors in electronics.

          Arduino Code: Count 0 to 9

          This sketch counts from 0 to 9 with a one-second gap, then starts again. It works with both display types. Change one line at the top to match your display and upload.

          // 7 Segment Display: Count 0 to 9
          // Works with common anode and common cathode displays
          
          // Set to true for a COMMON ANODE display, false for COMMON CATHODE
          const bool COMMON_ANODE = false;
          
          // Arduino pins for segments a, b, c, d, e, f, g and DP
          const int segmentPins[8] = {2, 3, 4, 5, 6, 7, 8, 9};
          
          // Segment patterns for digits 0-9 (1 = segment ON)
          // Order: a, b, c, d, e, f, g
          const byte digitPatterns[10][7] = {
            {1, 1, 1, 1, 1, 1, 0},  // 0
            {0, 1, 1, 0, 0, 0, 0},  // 1
            {1, 1, 0, 1, 1, 0, 1},  // 2
            {1, 1, 1, 1, 0, 0, 1},  // 3
            {0, 1, 1, 0, 0, 1, 1},  // 4
            {1, 0, 1, 1, 0, 1, 1},  // 5
            {1, 0, 1, 1, 1, 1, 1},  // 6
            {1, 1, 1, 0, 0, 0, 0},  // 7
            {1, 1, 1, 1, 1, 1, 1},  // 8
            {1, 1, 1, 1, 0, 1, 1}   // 9
          };
          
          void setup() {
            for (int i = 0; i < 8; i++) {
              pinMode(segmentPins[i], OUTPUT);
            }
            setSegment(7, false);   // keep the decimal point off
          }
          
          void loop() {
            for (int digit = 0; digit <= 9; digit++) {
              showDigit(digit);
              delay(1000);
            }
          }
          
          // Turn one segment ON or OFF, handling the display type
          void setSegment(int segment, bool on) {
            if (COMMON_ANODE) {
              on = !on;             // common anode: LOW lights the segment
            }
            digitalWrite(segmentPins[segment], on ? HIGH : LOW);
          }
          
          // Show a digit from 0 to 9
          void showDigit(int digit) {
            for (int s = 0; s < 7; s++) {
              setSegment(s, digitPatterns[digit][s]);
            }
          }

          Code Explanation

          • const bool COMMON_ANODE = false; : This is the only line you need to change. Set it to true for a common anode display and false for a common cathode display.
          • segmentPins[8] : Stores the Arduino pin for each segment in the order a, b, c, d, e, f, g, DP. If you wire the display differently, change the numbers here and nothing else.
          • digitPatterns[10][7] : This is the common cathode truth table from earlier, written as a 2D array. Each row is one digit, and each 1 means that segment should light.
          • setup() : Runs once. It sets all eight pins as outputs and turns the decimal point off.
          • loop() : Runs forever. It calls showDigit() for 0 to 9, waiting 1000 milliseconds (1 second) after each digit.
          • setSegment() : Does the actual switching. For a common anode display, it flips the value with on = !on, so a segment that should be ON gets a LOW signal. This is how one sketch handles both types.
          • showDigit() : Reads one row of digitPatterns and sends each of the seven values to setSegment().

          Troubleshooting

          Problem Likely cause Fix
          Nothing lights at all COM wired to the wrong rail for your type CC: COM to GND. CA: COM to 5V. Re-run the multimeter test if unsure.
          Shows the opposite of each digit (8 looks like a blank, 1 shows everything but b and c) COMMON_ANODE set wrong Flip it between true and false and upload again
          Digits look scrambled Segment wires swapped Check each wire against the wiring table, especially pins 6, 7, 9 and 10
          Some segments are dimmer than others Mixed resistor values or a shared resistor on COM Use the same 220Ω to 330Ω value on every segment pin

          Driving It With a 74HC595 or BCD to 7 Segment Decoder

          The direct method uses 8 Arduino pins for one digit. That is fine for a single display, but it gets expensive fast. Two chips solve this.

          74HC595 shift register (3 Arduino pins)

          The 74HC595 takes data one bit at a time over 3 pins (data, clock and latch) and sets 8 outputs at once. Wire outputs Q0 to Q6 to segments a to g and Q7 to DP, each through its own 220Ω resistor. Then send the hex codes from the truth tables above:

          const int dataPin = 11, clockPin = 12, latchPin = 10;
          const byte digitCodes[10] = {0x3F, 0x06, 0x5B, 0x4F, 0x66,
                                       0x6D, 0x7D, 0x07, 0x7F, 0x6F};  // common cathode
          
          void showDigit(int d) {
            digitalWrite(latchPin, LOW);
            shiftOut(dataPin, clockPin, MSBFIRST, digitCodes[d]);   // use ~digitCodes[d] for common anode
            digitalWrite(latchPin, HIGH);
          }

          Remember to set all three pins as OUTPUT in setup(). Wire Arduino pin 11 to the 74HC595 DS pin (14), pin 12 to SH_CP (11) and pin 10 to ST_CP (12).

          BCD to 7 segment decoder (4 Arduino pins, no lookup table)

          A BCD to 7 segment decoder takes a 4-bit binary number (0000 to 1001) on inputs A, B, C and D and lights the right segments by itself. Your code only sends the number, and the chip handles the truth table. Pick the decoder that matches your display type:

          Decoder IC Output type Use with
          74LS47 / 7447 Active LOW Common anode
          CD4511 Active HIGH, with built-in latch Common cathode
          74LS48 Active HIGH Common cathode

          You still need one resistor between each decoder output and its segment. Decoders do not control the decimal point, so wire DP to a spare Arduino pin if you need it.

          Conclusion

          Once you know the 7 segment display pin diagram, the rest is simple. Pins 3 and 8 are common, the other eight pins each drive one LED, and the only thing that changes between types is where COM goes and whether HIGH or LOW lights a segment. Test the display with a multimeter before you wire it, give every segment its own resistor, and set one line in the code to match your display.

          From here, you can move on to multi-digit counters, clocks and scoreboards. See 4-digit and module versions in our 7 segment collection.

          Excerpt

          7 segment display pin diagram with labelled pinout, common anode vs common cathode truth tables, a multimeter test to identify the type, and Arduino code.

          Frequently Asked Questions

          1. What is the difference between common anode and common cathode?

          In a common anode display, all the LED anodes are joined and connected to VCC, and a segment lights when its pin is pulled LOW. In a common cathode display, all the cathodes are joined and connected to GND, and a segment lights when its pin is driven HIGH. The pinout is the same; only the polarity is reversed.

          2. How many pins does a 7 segment display have?

          A standard single-digit 7 segment display has 10 pins: seven for segments a to g, one for the decimal point, and two common pins (3 and 8) that are connected internally.

          3. How do we check if a display is common anode?

          Set a digital multimeter to diode test mode. Put the red probe on pin 3 and the black probe on any segment pin, such as pin 7. If the segment glows faintly, the display is common anode. If it only glows with the probes swapped, it is common cathode.

          4. Which resistor do we use with a 7 segment display?

          Use a 220Ω to 330Ω resistor on each segment pin when running from 5V. 220Ω gives about 14mA per segment and 330Ω about 9mA for a red display. Do not use a single resistor on the common pin, or the brightness will change with the number of segments lit.

          5. Can Arduino drive a 4-digit 7 segment display?

          Yes. A bare 4-digit display shares the segment pins across all digits, so the Arduino lights one digit at a time and switches between them every few milliseconds. This is called multiplexing, and it looks steady to the eye. The easier option is a TM1637 4-digit module, which needs only two Arduino pins (CLK and DIO) and an Arduino library.

          6. What is a BCD to 7 segment decoder?

          It is an IC that converts a 4-bit binary-coded decimal input (0 to 9) into the seven segment signals needed to show that digit. The 74LS47 is used with common anode displays, while the CD4511 and 74LS48 are used with common cathode displays.

          Prev Post
          Next Post

          Leave a comment

          Please note, comments need to be approved before they are published.

          Thanks for subscribing!

          This email has been registered!

          Shop the look

          Choose Options

          Edit Option
          Back In Stock Notification
          Compare
          Product SKU Description Collection Availability Product Type Other Details

          Choose Options

          this is just a warning
          Login
          Shopping Cart
          0 items
          FREE SHIPPING!
          ₹100 OFF
          ₹200 OFF
          ₹999
          ₹2500
          ₹4900
          WhatsApp Chat Chat