2 Lesson 2 SSD PDF File
2 Lesson 2 SSD PDF File
1. Overview
A 7-segment LED display is commonly used to display numeric values in electronic circuits. Each
segment is an individual LED, and by controlling which segments light up, different numbers can
be displayed.
An SSD or Seven-Segment Display is a form of electronic display device for displaying decimal
numerals that is an alternative to the more complex dot matrix displays
Additional Notes:
Always use 220Ω - 470Ω resistors for each segment to prevent burning out the LEDs.
If using multiple digits, consider using a multiplexer or a shift register like the 74HC595.
For a 4-digit display, you can use a driver like MAX7219.
Activity 1
7- Segment Display Datasheet
Materials:
Arduino Uno/Nano/Mega (or any compatible board)
Seven-segment display (Common Anode or Common Cathode)
Resistors (220Ω - 470Ω, 8 pieces)
Jumper wires
Breadboard
Use the datasheet of your specific seven-segment display model to confirm the pin configuration.
int digits[10][7]
int → This specifies that the array stores integer values.
digits → The name of the array.
[10] → The first dimension indicates there are 10 rows (0 to 9),
which typically represent the digits 0 to 9.
[7] → The second dimension indicates there are 7 columns, which
represent the 7 segments (A, B, C, D, E, F, G) of a seven-segment
display
Arduino Code
// Define segment pins
int A = 2, B = 3, C = 4, D = 5, E = 6, F = 7, G = 8, DP = 9;
int digits[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,0,0,1,1} // 9
};
void setup() {
// Set segment pins as OUTPUT
for (int i = 2; i <= 8; i++) {
pinMode(i, OUTPUT);
}
}
void loop() {
for (int num = 0; num <= 9; num++) {
displayNumber(num);
delay(1000); // Display each number for 1 second
}
}