Shop by category
Shop all componentsOhm’s law & basics
The common pin carries 120 mA, over the 40 mA absolute limit of an Arduino pin. Drive each digit through a transistor (BC547, 2N2222) or use a driver such as the MAX7219 or TM1637.
Multiplexing lights one digit at a time, so each LED is on for only 1/4 of the time and looks about that much dimmer. For more brightness, raise the peak current up to the display’s peak rating, not past it. Driver ICs like the MAX7219 and TM1637 set the current themselves, so you do not need these resistors with them.
R = (Vsupply − Vf − Vtransistor) ÷ I_peakDuty = 1 ÷ number of digitsI_average = I_peak × dutyI_common = LEDs lit per digit × I_peakScan rate = refresh rate × digitsA 4-digit red display on 5 V with 15 mA per segment and 0.3 V lost in the digit transistor needs (5 − 2 − 0.3) ÷ 0.015 = 180 Ω. Each digit is lit 25% of the time, so the average is 3.75 mA per LED. With all 8 segments on, the common pin carries 8 × 15 = 120 mA, far too much for an Arduino pin, so it needs a transistor.
A 4-digit 7-segment display has only 12 pins because the segments of every digit are wired together. You light one digit at a time, very quickly, and your eye blends the frames into a steady number. This is called multiplexing.
The catch is brightness and current. Each digit is lit for only part of the time, so it looks dimmer than when it is lit continuously, and the common pin of a digit carries the current of every lit segment at once. That is usually more than a microcontroller pin can give, so the common pins go through transistors, or a driver IC such as the MAX7219 or TM1637 does the scanning for you.
One resistor per segment line, from (supply − LED voltage − transistor drop) ÷ segment current. On 5 V with red segments and 15 mA, about 180 to 220 Ω. Do not use one resistor on the common pin, or the brightness will change with the number of segments lit.
Each digit is lit only 1/N of the time. Raise the peak current within the display’s peak rating, keep the refresh rate above about 60 Hz, and keep the code that scans the display free of long delays.
No. The MAX7219 sets the segment current with a single RSET resistor, and the TM1637 has built-in current control and brightness levels.
Each digit is on only part of the time, so peak current must be higher to keep the same brightness.
R = (Vsupply − Vf − Vtransistor) ÷ I_peak; Duty = 1 ÷ number of digits; I_average = I_peak × duty; I_common = LEDs lit per digit × I_peak; Scan rate = refresh rate × digits.
A 4-digit red display on 5 V with 15 mA per segment and 0.3 V lost in the digit transistor needs (5 − 2 − 0.3) ÷ 0.015 = 180 Ω. Each digit is lit 25% of the time, so the average is 3.75 mA per LED. With all 8 segments on, the common pin carries 8 × 15 = 120 mA, far too much for an Arduino pin, so it needs a transistor.
Geekobot builds that use it include LED matrix bouncing ball, Emoji feelings board for the classroom, LED matrix sound bar graph and Electronic dice on an LED matrix. Each has the full parts list, wiring and code.
Results are estimates for design and learning. Check critical designs against the component datasheet. Made by the Geekobot Learning Team. How we write our calculators