ARTE
BELEZA E BEM-ESTAR
ARTESANATO
CULTURA E HISTÓRIA
ENTRETENIMENTO
MEIO AMBIENTE
COMIDA E BEBIDAS
ENGENHARIA REVERSA
CIÊNCIAS
ESPORTES
TECNOLOGIA
TECNOLOGIA VESTÍVEL
The Seven-Segment LED Display
Ed

Criado por

Ed

29. agosto 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.
Iniciante
4 hours

Instruções

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.

Materiais para este passo:

7-Segment Display (4-Digit, Common Cathode)7-Segment Display (4-Digit, Common Cathode)1 peça

Ferramentas necessárias:

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

Materiais para este passo:

7-Segment Display (4-Digit, Common Cathode)7-Segment Display (4-Digit, Common Cathode)1 peça
Resistor Kit (1/4W, E12 Series)Resistor Kit (1/4W, E12 Series)1 kit
Transistor Assortment (NPN/PNP)Transistor Assortment (NPN/PNP)1 conjunto

Ferramentas necessárias:

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 ---");
}

Materiais para este passo:

7-Segment Display (4-Digit, Common Cathode)7-Segment Display (4-Digit, Common Cathode)1 peça

Ferramentas necessárias:

ESP32 Development BoardESP32 Development Board
Jumper Wire SetJumper Wire Set
4

Multiplex duty cycle versus perceived brightness

Loading Jupyter Notebook...

Ferramentas necessárias:

Desktop ComputerDesktop Computer

Materiais

3

Ferramentas necessárias

6

Blueprints relacionados

Estes blueprints compartilham conhecimento — técnicas, materiais ou princípios

CC0 Domínio Público

Este blueprint é liberado sob CC0. Você é livre para copiar, modificar, distribuir e usar este trabalho para qualquer finalidade, sem pedir permissão.

Apoie o Maker comprando produtos através do Blueprint, onde ele ganha uma Comissão Maker definida pelos vendedores, ou crie uma nova versão deste Blueprint e inclua-o como conexão no seu próprio Blueprint para compartilhar receita.

Discussão

(0)

Entrar para participar da discussão

Carregando comentários...