7 Segment LED Display (Common Anode)
7 Segment LED Display (Common Anode)
The 7 Segment LED Display (Common Anode) is a type of electronic display component that utilizes light-emitting diodes (LEDs) to display numerical and alphabetical information. It is a widely used component in various applications, including digital clocks, calculators, and other electronic devices.
The 7 Segment LED Display (Common Anode) is designed to display numerical values from 0 to 9, as well as some alphabetical characters. The display consists of 7 segments, each composed of an LED, which are arranged to form a rectangular shape. The segments are labeled A to G, with the decimal point (DP) being an additional segment.
The display operates on the principle of illuminating specific segments to form the desired character or numeral. By applying a voltage across the anode and cathode of each segment, the corresponding LED turns on, creating the desired display pattern.
1.5V to 5V
10mA to 30mA per segment
-20C to 70C
0C to 50C
The 7 Segment LED Display (Common Anode) is typically available in a dual inline package (DIP) or a surface-mount device (SMD) package. The dimensions of the display vary depending on the package type and manufacturer, but typical dimensions for a DIP package are |
22.86mm
10.16mm
12.7mm
The 7 Segment LED Display (Common Anode) is widely used in various applications, including |
Digital clocks and watches
Calculators and other electronic calculators
Industrial control panels and instrumentation
Medical devices and equipment
Automotive systems and accessories
Consumer electronics, such as DVD players and audio equipment
Overall, the 7 Segment LED Display (Common Anode) is a versatile and widely used component that offers a reliable and efficient way to display numerical and alphabetical information in a variety of applications.
7 Segment LED Display (Common Anode) Documentation
Overview
The 7 Segment LED Display (Common Anode) is a widely used component in IoT projects that requires numerical or alphabetical display. It consists of 7 LEDs arranged in a specific pattern to form digits and letters. This display is commonly anode, meaning that all the anodes of the LEDs are connected to a common pin.
Pinout
The 7 Segment LED Display (Common Anode) typically has 10 pins:
A to G: Correspond to the 7 segments of the display
DP: Decimal point
COM: Common anode pin
Operating Voltages
Operating voltage: 5V
Maximum voltage: 6V
Minimum voltage: 4.5V
Current Consumption
Typical current consumption: 20-30mA per segment
Maximum current consumption: 50mA per segment
Code Examples
### Example 1: Displaying a single digit using Arduino
In this example, we will display the digit "5" on the 7 Segment LED Display using an Arduino board.
```cpp
const int segmentPins[] = {2, 3, 4, 5, 6, 7, 8, 9}; // A to G and DP pins
const int commonPin = 10; // Common anode pin
void setup() {
for (int i = 0; i < 8; i++) {
pinMode(segmentPins[i], OUTPUT);
}
pinMode(commonPin, OUTPUT);
}
void loop() {
displayDigit(5); // Display the digit "5"
delay(1000);
}
void displayDigit(int digit) {
// Digit to 7-segment mapping
const byte digits[][8] = {
{B11111100, B11101110, B10110110, B10101110, B11101010, B11011010, B11001110, B11111110} // 0 to 9
};
digitalWrite(commonPin, HIGH);
for (int i = 0; i < 8; i++) {
digitalWrite(segmentPins[i], !(digits[digit][0] & (1 << i)));
}
}
```
### Example 2: Displaying a scrolling message using Raspberry Pi (Python)
In this example, we will display a scrolling message "Hello World" on the 7 Segment LED Display using a Raspberry Pi.
```python
import RPi.GPIO as GPIO
import time
# Set up GPIO mode
GPIO.setmode(GPIO.BCM)
# Define segment and common anode pins
segments = [17, 23, 24, 25, 5, 6, 12, 13] # A to G and DP pins
common_anode = 26
# Set up pins as outputs
for segment in segments:
GPIO.setup(segment, GPIO.OUT)
GPIO.setup(common_anode, GPIO.OUT)
def display_character(char):
# Character to 7-segment mapping
char_map = {
'H': 0b11101110,
'e': 0b01101110,
'l': 0b01110110,
'o': 0b11111110,
' ': 0b00000000,
'W': 0b11111010,
'r': 0b11101110,
'd': 0b11111110
}
GPIO.output(common_anode, GPIO.HIGH)
for i, segment in enumerate(segments):
GPIO.output(segment, not (char_map[char] & (1 << i)))
message = "Hello World"
while True:
for char in message:
display_character(char)
time.sleep(0.5)
```
Note: The above code examples are just illustrations and may require modifications to work with specific hardware configurations. Additionally, the 7 Segment LED Display (Common Anode) requires a current limiting resistor for each segment to prevent damage.