فنون
الجمال والعناية
حِرَف
الثقافة والتاريخ
ترفيه
البيئة
الطعام والمشروبات
الهندسة العكسية
العلوم
رياضة
التقنية
الأجهزة القابلة للارتداء
The Seven-Segment LED Display
Ed

أنشأه

Ed

29. أغسطس 2026FI
0
0
0
0
0

The Seven-Segment LED Display

The opposite of the Nixie: instead of a shaped numeral at 170 V, the fewest straight lines that still make every digit — seven bars in a figure eight, at 2 V and pennies. It looks like sticks and nobody cares, because it is seven LEDs and never wears out. You will build a four-digit display and confront its one clever idea, multiplexing, then measure the refresh rate at which the flicker vanishes for your own eyes.
مبتدئ
4 hours

التعليمات

1

Seven sticks, ten digits, and the sibling that used 170 volts

Nixie versus seven-segment: the same job, opposite answers. The Nixie shows the real numeral shape at 170 V and poisons its cathodes; the seven-segment builds each digit from seven bars (a-g) at 2 V and never wears out. Before wiring, draw a figure eight, label the bars a-g, and write which bars light for each digit 0-9. That table is the whole interface and becomes the lookup table in the code step.

المواد لهذه الخطوة:

7-Segment Display (4-Digit, Common Cathode)7-Segment Display (4-Digit, Common Cathode)1 قطعة

الأدوات المطلوبة:

Notebook and PencilNotebook and Pencil
2

Wire it: seven segment resistors, one transistor per digit

The multiplex wiring. All four digits' matching segments share one pin through ONE resistor — seven segment lines, seven resistors, whatever the digit count. Each digit's common cathode switches to ground through one NPN. Resistors go on the SEGMENTS, not the digits, or an 8 shares one resistor seven ways and dims. Four digits: eleven pins instead of twenty-eight. That saving is why you multiplex.

Loading KiCanvas viewer...

Professional PCB Design Viewer

المواد لهذه الخطوة:

7-Segment Display (4-Digit, Common Cathode)7-Segment Display (4-Digit, Common Cathode)1 قطعة
Resistor Kit (1/4W, E12 Series)Resistor Kit (1/4W, E12 Series)1 طقم
Transistor Assortment (NPN/PNP)Transistor Assortment (NPN/PNP)1 طقم

الأدوات المطلوبة:

BreadboardBreadboard
Soldering Station (Temperature-Controlled)Soldering Station (Temperature-Controlled)
3

Drive it, and find the flicker frequency for your own eyes

The sketch multiplexes the four digits, then sweeps the refresh rate down so YOU find the frequency at which the steady number breaks into flicker — your flicker-fusion threshold, higher in peripheral vision. Each digit is lit a quarter of the time, so to stay bright it must be driven harder while on: refresh too slow and it flickers, drive too hard and you exceed the LED peak current. You have measured one wall of that box.
sevenseg_mux.inocpp
// Four-digit seven-segment multiplex driver, plus a flicker-fusion experiment.
//
// Segments a..g share seven pins (each through 220R). Each digit's common cathode is
// switched to ground by an NPN (base through 1k). Scan: drive the segment pattern for
// one digit, enable that digit, wait, blank, next digit. Fast enough and the eye fuses
// four flashing digits into one steady number.
//
// The experiment: sweep the refresh rate DOWN from 200 Hz and read the serial output to
// find the exact rate at which the number starts to flicker for YOUR eyes.

const int SEG[7] = {13, 12, 14, 27, 26, 25, 33};   // a b c d e f g
const int DIG[4] = {32, 4, 16, 17};                 // digit-enable (NPN bases)

// Segment patterns for 0-9, bit order a..g (1 = lit). Common cathode: HIGH lights a segment.
const uint8_t FONT[10] = {
  0b1111110, // 0  a b c d e f
  0b0110000, // 1  b c
  0b1101101, // 2  a b d e g
  0b1111001, // 3  a b c d g
  0b0110011, // 4  b c f g
  0b1011011, // 5  a c d f g
  0b1011111, // 6  a c d e f g
  0b1110000, // 7  a b c
  0b1111111, // 8  all
  0b1111011, // 9  a b c d f g
};

int digitValue[4] = {1, 2, 3, 4};

void blank() {
  for (int d = 0; d < 4; d++) digitalWrite(DIG[d], LOW);   // all digits off
}

// Show one digit's pattern for onMicros, then blank. Common cathode: segment HIGH = on,
// digit-enable HIGH drives the NPN and pulls that common to ground.
void showDigit(int pos, int val, unsigned long onMicros) {
  blank();
  uint8_t pat = FONT[val % 10];
  for (int s = 0; s < 7; s++) digitalWrite(SEG[s], (pat >> (6 - s)) & 1);
  digitalWrite(DIG[pos], HIGH);
  delayMicroseconds(onMicros);
  blank();
}

// One full frame = all four digits scanned once, at a given whole-display frame rate.
void frame(float frameHz) {
  unsigned long perDigit = (unsigned long)(1e6 / (frameHz * 4));
  for (int d = 0; d < 4; d++) showDigit(d, digitValue[d], perDigit);
}

void setup() {
  Serial.begin(115200);
  delay(300);
  for (int s = 0; s < 7; s++) { pinMode(SEG[s], OUTPUT); digitalWrite(SEG[s], LOW); }
  for (int d = 0; d < 4; d++) { pinMode(DIG[d], OUTPUT); digitalWrite(DIG[d], LOW); }

  Serial.println("# Seven-segment multiplex + flicker-fusion sweep");
  Serial.println("# Watch the display, straight on AND out of the corner of your eye.");
  Serial.println("# Note the rate printed when it FIRST starts to flicker. That is your");
  Serial.println("# flicker-fusion threshold. Peripheral vision fuses at a HIGHER rate,");
  Serial.println("# so the corner of your eye will flicker before the centre does.");
}

void loop() {
  // Sweep the whole-display refresh from 200 Hz down to 20 Hz over ~40 s, holding each
  // rate long enough to judge. Then jump back to 200 and repeat.
  for (float f = 200.0; f >= 20.0; f -= 5.0) {
    Serial.print("refresh = "); Serial.print(f, 0); Serial.println(" Hz");
    unsigned long hold = millis();
    while (millis() - hold < 1500) frame(f);   // hold this rate ~1.5 s
  }
  Serial.println("--- back to 200 Hz (rock steady) and repeating ---");
}

المواد لهذه الخطوة:

7-Segment Display (4-Digit, Common Cathode)7-Segment Display (4-Digit, Common Cathode)1 قطعة

الأدوات المطلوبة:

ESP32 Development BoardESP32 Development Board
Jumper Wire SetJumper Wire Set
4

Multiplex duty cycle versus perceived brightness

Loading Jupyter Notebook...

الأدوات المطلوبة:

Desktop ComputerDesktop Computer

المواد

3

الأدوات المطلوبة

6

المخططات ذات الصلة

هذه المخططات تشارك المعرفة مع هذا — التقنيات والمواد والمبادئ

CC0 ملكية عامة

هذا المخطط مُصدر بموجب CC0. يحق لك نسخه وتعديله وتوزيعه واستخدامه لأي غرض، دون طلب إذن.

ادعم الصانع بشراء منتجات عبر مخططه حيث يكسب عمولة الصانع يحددها البائعون، أو أنشئ نسخة جديدة من هذا المخطط وضمّنه كرابط في مخططك لمشاركة الإيرادات.

النقاش

(0)

تسجيل الدخول للمشاركة في النقاش

جارٍ تحميل التعليقات...