Introduction: Simple Arduino Dot-Matrix Monitor

About: Programmer, Arduino Fan

Nowadays there are many Dot-matrix displays on top of stores or this sort of places.
Dot-matrix has a simple idea behind, to make and display with LED or lamp dots.
In this guide I wanna to show you how to make a beginner and simple dot-matrix with Arduino.

Step 1: Connect the Parts

Used parts:
- 16x LED
- 4x Resistor between 100 To 1K
- 1x Arduino (I've used an Uno)
- 1x Breadboard
- Wires

In dot-matrix we will use a LED for each pixel.
It seems really simple, but instead of separate wiring to LEDs, we should use shared bus.

According to attached picture, I've used a shared bus (wire) for each row and each column in a 4x4 rectangular form.

Cathodes are connected as columns and Anodes as rows.

Now, we have 8 wires to control 16 LEDs.
Connect the wires to pins 2 to 9 of arduino.

Use the resistors on cathode wires.


Step 2: Arduino Code

Open the arduino console and type the code.
Help:
- pinmode commands are used to declare the pins as output.
- randomseed and random functions are used to make proper random numbers.
- digitalwrite commands are used to send a positive or negative signal to output.
- delay used at the end of loop to make sure we have enough time to see each state on LEDs.


void setup(){
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);

randomSeed(analogRead(0));
}

void loop(){

digitalWrite(2, random(0, 10)<5 ? HIGH : LOW);
digitalWrite(3, random(0, 10)<5 ? HIGH : LOW);
digitalWrite(4, random(0, 10)<5 ? HIGH : LOW);
digitalWrite(5, random(0, 10)<5 ? HIGH : LOW);
digitalWrite(6, random(0, 10)<5 ? HIGH : LOW);
digitalWrite(7, random(0, 10)<5 ? HIGH : LOW);
digitalWrite(8, random(0, 10)<5 ? HIGH : LOW);
digitalWrite(9, random(0, 10)<5 ? HIGH : LOW);

delay(50);
}