Arduino UNO 7-Segment Display Interfacing in Tinkercad (Beginner Guide)

7-Segment Display with Arduino UNO | Beginner Tutorial | MakeMindz

What Are We Building?

A 7-segment display is exactly what it sounds like — 7 individual LED segments (labeled a through g) arranged like a figure-8. By turning specific segments HIGH or LOW, we can display any digit from 0 to 9. The Arduino controls each segment pin directly, giving us full control over what number appears.

🔌

Digital Output

Control 7 individual pins using digitalWrite() to switch LEDs on/off.

💡

LED Segment Logic

Understand how a specific combination of segments makes each digit.

🔢

Number Display

Translate a digit (like 5) into a pattern of HIGH/LOW pin states.

🧮

Embedded Programming

Write structured, readable Arduino code using setup() and loop().

What You Need

#ComponentQtyRole
1Arduino UNO×1Controls which segments are ON or OFF
2Common Cathode 7-Segment Display×1Displays digits 0–9 using 7 LED segments
3220Ω Resistors×7One per segment — protects LEDs from excess current
4Breadboard×1Prototyping platform for clean connections
5Jumper Wires×~12Connect display pins to Arduino through resistors

⚠️ Common Cathode vs Common Anode: In Common Cathode, all LED negatives share GND and you set segment pins HIGH to light them. In Common Anode (opposite), all positives share 5V and you set pins LOW to light them. Tinkercad uses Common Cathode by default.

Tap a Digit to See Its Segments

Each number uses a unique combination of segments. Tap any digit below to see which segments light up — and which pins go HIGH.

7-Segment Display — Common Cathode

Wiring It All Together

7-segment display digits 0 and 1 segment patterns
7-segment display digits 2 and 3 segment patterns
7-segment display digit 4 segment pattern
7-segment display digit 5 segment pattern
7-segment display digit 6 or 7 segment pattern
7-segment display digit segment pattern

🔌 Segment Pins → Arduino (via 220Ω resistors)

a
↓ 220Ω
Pin 7
b
↓ 220Ω
Pin 8
c
↓ 220Ω
Pin 9
d
↓ 220Ω
Pin 10
e
↓ 220Ω
Pin 11
f
↓ 220Ω
Pin 12
g
↓ 220Ω
Pin 13

⚡ Power & Ground

COM pins (both)GND on Arduino
Arduino 5VPowers the display through segment pins

💡 Why 220Ω on each segment? Each segment is an LED. Without a resistor, too much current flows and the LED burns out. With 220Ω, the current is limited to a safe ~10–15mA — bright enough to see, safe for both the LED and Arduino pin.

Which Segments Light Up for Each Digit?

1 = HIGH (segment ON)    0 = LOW (segment OFF). Each row is a digit, each column is a segment pin.

Digit a (7) b (8) c (9) d (10) e (11) f (12) g (13)

The Program

This code displays the digit 0 on the 7-segment display. Segments a–f are set HIGH, segment g (the middle bar) stays LOW.

seven_segment.ino — Display 0
// ── Segment Pin Definitions ───────────────────
int a = 7;    // Top horizontal
int b = 8;    // Top-right vertical
int c = 9;    // Bottom-right vertical
int d = 10;   // Bottom horizontal
int e = 11;   // Bottom-left vertical
int f = 12;   // Top-left vertical
int g = 13;   // Middle horizontal

void setup() {
  pinMode(a, OUTPUT);
  pinMode(b, OUTPUT);
  pinMode(c, OUTPUT);
  pinMode(d, OUTPUT);
  pinMode(e, OUTPUT);
  pinMode(f, OUTPUT);
  pinMode(g, OUTPUT);
}

void loop() {

  // Display 0 → segments a, b, c, d, e, f ON; g OFF
  digitalWrite(a, HIGH);  // top bar    ── ON
  digitalWrite(b, HIGH);  // top-right  │  ON
  digitalWrite(c, HIGH);  // bot-right  │  ON
  digitalWrite(d, HIGH);  // bot bar    ── ON
  digitalWrite(e, HIGH);  // bot-left   │  ON
  digitalWrite(f, HIGH);  // top-left   │  ON
  digitalWrite(g, LOW);   // middle     ── OFF

  delay(1000);

}
🚀 Extension: Auto-counting 0→9

Once you understand individual digit display, the next step is to cycle through all 10 digits automatically. Store each digit's segment pattern in an array and loop through them with a counter. Try this after completing the basic project!

Simulate Before You Build

The full circuit is pre-wired in Tinkercad. Hit Start Simulation and watch the digit appear — then edit the code to try other numbers.

Open in Tinkercad Simulator

All 7 segments are wired up with resistors. Start simulation, then modify the digitalWrite() values to display different digits.

▶ Launch Simulator ↗
🧪 Try these challenges in the simulator:
  1. Start simulation — confirm the digit 0 appears on the display.
  2. Use the truth table above to modify the code to display digit 5.
  3. Add a delay(1000) and write code to display digits 0 then 1 then 2 in sequence.
  4. Challenge: Display all 10 digits from 0 to 9 automatically, one per second.
  5. Bonus: What happens when you set ALL segments HIGH? (Displays 8!)

Quick Quiz

Tap an option to check your answer instantly.

Q1. How many LED segments does a standard 7-segment display have?

4
6
7
8

Q2. In a Common Cathode display, which pin is connected to GND?

All segment pins (a–g)
The COM (common) pin
The 5V supply pin

Q3. To display the digit "1", which segments should be ON?

a, d, e, f
b, c
a, b, c, d, e, f, g
b, c, g

Q4. Why is a 220Ω resistor placed on each segment pin?

To make the segments shine brighter
To increase the number of segments
To limit current and protect the LEDs

Where Is This Used?

🕐Digital ClocksTime display in alarm clocks and microwave ovens
👥Visitor CounterCount people entering a room or event
🏆ScoreboardLive score display for sports or games
🌡️Temperature DisplayShow sensor readings on a 2-digit display
🔌Arduino ProjectsAdd a digit output to any sensor project
🚩Countdown TimerCountdown from 9 to 0 for lab experiments
Why use 220Ω resistors?
To prevent excess current flowing through each LED segment. Arduino pins output 5V; without a resistor, too much current flows and the segment LEDs burn out. 220Ω limits the current to a safe ~10–15mA — visible but safe.
What is Common Cathode?
In a Common Cathode display, all the negative terminals (cathodes) of the 7 segment LEDs are connected together at the COM pin. You connect COM to GND, then set individual segment pins HIGH to turn them on. This is different from Common Anode where all positives are shared and you use LOW to turn segments on.
How do I display all digits 0–9?
Store each digit's segment pattern as a boolean array. Use a for loop to cycle through all 10 patterns with a delay between each. This is the foundation of building a digital counter or clock. Try it as a challenge after mastering the single-digit display!
Can I use fewer Arduino pins?
Yes! A BCD decoder chip like the 74HC4511 lets you control a 7-segment display using just 4 pins instead of 7. You send the binary representation of the digit (0000 to 1001) and the chip decodes it. This is useful when you have limited pins available on your Arduino.
🚀 Ready to level up? Try these extensions:
  • Build an automatic counter that counts 0→9 and loops back
  • Add a push button to increment the count manually
  • Use two displays to show two-digit numbers (00–99)
  • Combine with a PIR sensor to build an automatic visitor counter
  • Use the 74HC4511 BCD decoder to control the display with only 4 pins

Comments

try for free