8x8 LED matrix/How it lights/05. Brightness is time, not current
How it lights · 05 of 10

Brightness is time, not current

The intensity register sets brightness in sixteen steps, and none of them changes the current through an LED. R7 fixes that current near 40 mA. The register sets how much of each column's turn the LEDs stay on: from 1/32 to 31/32.

The current is fixed

R7 sets the peak: the chip drives each lit LED with about a hundred times the current that flows through R7 into its ISET pin. At 10 kΩ that is about 40 mA, the chip's own ceiling. The datasheet's table for a red LED would put 10 kΩ a little over 40 mA; its text says 9.53 kΩ gives 40 mA. Call it 40.

That sounds like a lot for an LED rated for 20 mA. But each column is lit for at most an eighth of the scan, so the average through any one LED is at most about 5 mA.

The time is not

Brightness is time, not current
Intensity register4 of 15
Picture
Duty
9/32
Per LED
1.41 mA avg
Board
about 66 mA
Level 4 keeps each column lit for 9/32 of its slot. The current while lit does not change: about 40 mA, set by R7. Only the time changes, so the average falls, about 1.41 mA per LED and 66 mA for the whole board.

The intensity register, 0x0A, takes 0 to 15. Each level keeps a column lit for a longer share of its turn: 1/32 at level 0, 3/32 at level 1, up to 31/32 at 15. The current while lit never changes. Only the time does, and the eye reads less time as less light.

This is pulse-width modulation, done inside the chip. It is also why dimming does not make the LEDs any safer: they take the same 40 mA whenever they are on.

What it costs your board

The chip's datasheet gives 330 mA, typical, for every LED lit at full brightness. The figure scales that by the LEDs lit and the level. A heart at the sketch's level 4 is well under 100 mA; all sixty-four at 15 is the full 330 mA, and it comes from your board's 5V pin.

When it does not work

It is too bright to look at.

Lower the intensity register, 0x0A, toward 0. Level 0 is still on, at 1/32 of the time. The book's sketch uses 4. There is no off level; to turn the display off, write 0 to the shutdown register instead.

My board resets when a big picture comes up.

Every LED lit at level 15 is about 330 mA through your board's 5V pin, which a USB port and a development board's power path may not hold up. Keep big pictures at a lower level, or feed VCC from a separate 5 V supply with the grounds joined.

Can I dim it further than level 0?

Not from the register: 1/32 is the least. The other control is R7, and changing it means soldering under the matrix. At a normal viewing distance level 0 is already dim indoors.

Does brightness change the colour?

No. The current while an LED is lit is the same at every level, so the colour is the same. Only how long it is lit changes.

Where this goes next

What actually travels down DIN, CLK and CS.

Sixteen bits and a latch →

Edit this page — content/books/matrix-led/brightness-is-time.mdx

Community

Questions about this product

See what other owners have asked, and read their solutions.

This page covers several products. Choose yours to see the right discussions.

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Modules and blocks on the forum →