diy-blinky-bot

About the LED Matrix

How does it work

LED matrices may vary as to how they are wired, but they all work essentially the same. The figure below shows two typical wiring configurations for an LED matrix. In the first diagram, each led is lit by applying a path to power (HIGH) to its row letter and a path to ground (LOW) to its column number; this is known as common-row anode configuration . In the second diagram, each led is lit by applying a path to power to its column number (HIGH) and a path to ground (LOW) to its row number; this is known as a common-row cathode configuration. In practice, the distinction is not a big deal.

Diagrams of Common row cathode and anode led matrix internal connections

Which pin controls what

Diagram of LED Matrix Internal row and column connections

The convention for LED matrices is that the connections on the left (of the schematic symbol) indicate the direction of the rows; the columns are therefore perpendicular to the pins. However, the pin numbers (typically numbered from the lower left corner counter-clockwise to the upper left-hand corner as viewed from the top of the LED matrix) do not correspond directly to the row and column numbers. Furthermore, the correlation between pin numbers and row/column numbers varies for different models. Therefore, it is often up to the user to figure out which pins correspond to which row/column numbers. You might be able to google it and find a datasheet with the correlation on the internet, but even that can sometimes yield erroneous information. Knowing how the pin numbers relate to the row and column numbers is essential to connect the matrix to the MAX7219 chip.

A pin schematic for a 788BS matrix (common-row anode) is shown below. If you are using a 788BS matrix, you should still verify that these pin numbers light up the expected LEDs. If you are using, a different matrix, then you may have to develop your own chart (see below).

788bs LED Matrix schematic with correspondence between pin numbers, and row and column numbers

Identifying pin numbers for rows and columns

picture of coin cell battery and battery holder with jumper leads attached

schematic and breadboard views of test setup to detect and verify the location of LED matrix row and column pins

Partial table of pin number to row and column mapping for 788BS LED Matrix

Lighting up multiple LEDs at once

From the previous exercise, it is clear how individual LEDs can be lit. It is also easy to visualize how multiple LEDs in a given row or column can be activated – just send power to the row and apply ground to the desired LED rows (common-row anode) or send power to the column and apply ground to the desired LED rows (common-row cathode). The difficulty arises when trying to illuminate specific LEDs in different rows and columns at the same time, which, as it turns out, is actually impossible for a matrix, given the way that it is configured. However, one can give the illusion of lighting up individual LEDs in different rows and columns by relying on a human phenomenon known as persistence of vision.

When sensors in the eye are stimulated the vision lingers for approximately a tenth of second. If the stimulus is renewed at high enough speed, the human brain merges the picture into a single vision. This phenomenon accounts for why we see motion on TV and in films as smooth and continuous. In the case of an LED matrix, the rows (common-row anode) or columns (common-row cathode) are scanned or multiplexed at a sufficiently high rate that individual LEDs appear to be lit continuously. A demonstration of persistence of vision as applied to an LED matrix is shown in the video below.

Arduino, LED matrix display. Illustration of the persistence of vision theory youtube video

Those cool rotating projects (often clocks) that seem to write/draw in air also rely on persistence of vision.