You are on page 1of 10

College of Engineering – Department of Electrical Engineering

Bachelor of Science in Computer Engineering

CpE 417: MICROPROCESSORS


2ND Semester A.Y. 2023 – 2024

LABORATORY 3

SUBMITTED BY:

Group No. 2

Ralph AJ M. Cimanes
John Wayne Vincent P. Esguerra
Joshua Ashley D. Formento
Isaac Garrick P. Goco
Daniel R. Teves

CpE-3205

SUBMITTED TO:
Engr. Laila A. Contreras
CpE 417 Course Instructor
College of Engineering – Department of Electrical Engineering
I. Introduction

A 5x5 LED matrix consists of a grid of LEDs organized in a 5 by 5 layout, totaling 25 individual
LEDs. Each LED can be controlled independently to showcase diverse patterns, symbols, or messages.
These matrices are commonly employed in electronics projects, do-it-yourself displays, and
prototyping due to their straightforwardness, adaptability, and visual appeal. Usually, each LED in the
matrix is linked to a microcontroller or driver circuit, enabling users to program the LED behavior. By
selectively activating and deactivating specific LEDs, different images or animations can be generated
on the matrix. These matrices are often utilized to exhibit basic graphics, scrolling text, or as indicators
in various electronic devices.

A key advantage of a 5x5 LED matrix is its small size, making it suitable for projects with space
constraints. Moreover, they are relatively simple to work with and can be connected to various
microcontrollers such as Arduino, Raspberry Pi, or other development boards. In essence, a 5x5 LED
matrix offers an enjoyable and practical means to experiment with visual displays in electronics
projects, providing limitless opportunities for imaginative expression and customization.

II. Objectives
● To be familiar with the commands used in the application of arduino.
● To improve the student’s comprehension of programming principles
● To enhance the students skills in hardware managing components.
● To master skills in analyzing the problem.

III. Components
● Arduino UNO
● Connecting Wires
● LED
College of Engineering – Department of Electrical Engineering

IV. Procedure
● Implementation of hardware components.
The first process is to design the layout for the breadboard and Arduino, which involves placing
the components and connections of each board in accordance with their unique form factors and
functionality. The resistors and LEDs in this configuration are arranged in a 5x5 grid, and the
wires are attached to the breadboard and Arduino pins. Ensuring that all the components are
positioned correctly is essential for the Arduino board's stable operation and performance.
College of Engineering – Department of Electrical Engineering

● Creation of the Code


The next step is to write the program, which consists of patterns 1 through 7 with outputs that
must be followed, after creating the layout for the Arduino and breadboard. Each pattern
produces different outputs that match the intended patterns depending on the assigned code
where the LEDs state themselves in a certain sequence.
College of Engineering – Department of Electrical Engineering

CODE:

int rowPins[] = {2, 3, column], HIGH); 0b00100,


4, 5, 6}; } 0b00100,
int columnPins[] = {A1, } 0b00100};
A2, A3, A4, A5}; } int p1d[] = {
int delayTime = 500; 0b00010,
//turns all lights off 0b00010,
//lights on function int LIGHTSOFF[] = { 0b00010,
uisng integer array and 0b00000, 0b00010,
non-blocking delay 0b00000, 0b00010};
void open(int matrix[], 0b00000, int p1e[] = {
unsigned long duration) 0b00000, 0b00001,
{ 0b00000}; 0b00001,
unsigned long start = 0b00001,
millis(); //turns all lights on 0b00001,
while (start + int LIGHTSON[] = { 0b00001
duration > millis()) { 0b11111, };
for (int column = 0; 0b11111,
column < 5; column++) { 0b11111, //pattern 2
0b11111, int p2a[] = {
digitalWrite(columnPins[ 0b11111}; 0b11111,
column], LOW); 0b00000,
for (int row = 0; //Combination of integer 0b00000,
row < 5; row++) { array per pattern 0b00000,
int LED = //pattern1 0b00000};
(matrix[column] >> row) int p1a[] = { int p2b[] = {
& 1; 0b10000, 0b00000,
if (LED == 1) { 0b10000, 0b11111,
0b10000, 0b00000,
digitalWrite(rowPins[row 0b10000, 0b00000,
], HIGH); 0b10000}; 0b00000};
} int p1b[] = { int p2c[] = {
0b01000, 0b00000,
delayMicroseconds(500); 0b01000, 0b00000,
0b01000, 0b11111,
digitalWrite(rowPins[row 0b01000, 0b00000,
], LOW); 0b01000}; 0b00000};
} int p1c[] = { int p2d[] = {
0b00100, 0b00000,
digitalWrite(columnPins[ 0b00100, 0b00000,
College of Engineering – Department of Electrical Engineering
0b00000, 0b11111, 0b10000,
0b11111, 0b11111, 0b01000,
0b00000}; 0b00000, 0b00100,
int p2e[] = { 0b00000, 0b00010,
0b00000, 0b00000}; 0b00001};
0b00000, int p4c[] = { int p5f[] = {
0b00000, 0b11111, 0b01000,
0b00000, 0b11111, 0b00100,
0b11111}; 0b11111, 0b00010,
//pattern 3 0b00000, 0b00001,
int p3a[] = { 0b00000}; 0b00000};
0b10000, int p4d[] = { int p5g[] = {
0b10000, 0b11111, 0b00100,
0b10000, 0b11111, 0b00010,
0b10000, 0b11111, 0b00001,
0b10000}; 0b11111, 0b00000,
int p3b[] = { 0b00000}; 0b00000};
0b11000, //patern5 int p5h[] = {
0b11000, int p5a[] = { 0b00010,
0b11000, 0b00000, 0b00001,
0b11000, 0b00000, 0b00000,
0b11000}; 0b00000, 0b00000,
int p3c[] = { 0b00000, 0b00000};
0b11100, 0b10000}; int p5i[] = {
0b11100, int p5b[] = { 0b00001,
0b11100, 0b00000, 0b00000,
0b11100, 0b00000, 0b00000,
0b11100}; 0b00000, 0b00000,
int p3d[] = { 0b10000, 0b00000};
0b11110, 0b01000}; int p5j[] = {
0b11110, int p5c[] = { 0b10001,
0b11110, 0b00000, 0b01010,
0b11110, 0b00000, 0b00100,
0b11110}; 0b10000, 0b01010,
0b01000, 0b10001};
//pattern4 0b00100};
int p4a[] = { int p5d[] = { //pattern6
0b11111, 0b00000, int p6a[] = {
0b00000, 0b10000, 0b00000,
0b00000, 0b01000, 0b00000,
0b00000, 0b00100, 0b00100,
0b00000}; 0b00010}; 0b00000,
int p4b[] = { int p5e[] = { 0b00000};
College of Engineering – Department of Electrical Engineering
int p6h[] = { 0b01111,
int p6b[] = { 0b00000, 0b01111,
0b00000, 0b00110, 0b01110,
0b00100, 0b01110, 0b01110,
0b00100, 0b01110, 0b00000};
0b00000, 0b00000};
0b00000}; int p6o[] = {
int p6i[] = { 0b01111,
int p6c[] = { 0b00000, 0b01111,
0b00000, 0b01110, 0b01111,
0b00110, 0b01110, 0b01110,
0b00100, 0b01110, 0b00000};
0b00000, 0b00000};
0b00000}; int p6p[] = {
int p6j[] = { 0b01111,
int p6d[] = { 0b01000, 0b01111,
0b00000, 0b01110, 0b01111,
0b00110, 0b01110, 0b01111,
0b00110, 0b01110, 0b00000};
0b00000, 0b00000};
0b00000}; int p6q[] = {
int p6k[] = { 0b01111,
int p6e[] = { 0b01100, 0b01111,
0b00000, 0b01110, 0b01111,
0b00110, 0b01110, 0b01111,
0b00110, 0b01110, 0b00001};
0b00010, 0b00000};
0b00000}; int p6r[] = {
int p6l[] = { 0b01111,
int p6f[] = { 0b01110, 0b01111,
0b00000, 0b01110, 0b01111,
0b00110, 0b01110, 0b01111,
0b00110, 0b01110, 0b00011};
0b00110, 0b00000};
0b00000}; int p6s[] = {
int p6m[] = { 0b01111,
int p6g[] = { 0b01111, 0b01111,
0b00000, 0b01110, 0b01111,
0b00110, 0b01110, 0b01111,
0b00110, 0b01110, 0b00111};
0b01110, 0b00000};
0b00000}; int p6t[] = {
int p6n[] = { 0b01111,
College of Engineering – Department of Electrical Engineering
0b01111, 0b10101, open(p1d, delayTime);
0b01111, 0b01010, open(p1c, delayTime);
0b01111, 0b10101, open(p1b, delayTime);
0b01111}; 0b01010}; open(p1a, delayTime);
open(LIGHTSOFF,
int p6u[] = { void setup() { delayTime);
0b01111, pinMode (2, OUTPUT);
0b01111, pinMode (3, OUTPUT); //Pattern2
0b01111, pinMode (4, OUTPUT); open(p2a, delayTime);
0b01111, pinMode (5, OUTPUT); open(p2b, delayTime);
0b11111}; pinMode (6, OUTPUT); open(p2c, delayTime);
open(p2d, delayTime);
int p6v[] = { pinMode (A1, OUTPUT); open(p2e, delayTime);
0b01111, pinMode (A2, OUTPUT); open(LIGHTSOFF,
0b01111, pinMode (A3, OUTPUT); delayTime);
0b01111, pinMode (A4, OUTPUT); open(p2e, delayTime);
0b11111, pinMode (A5, OUTPUT); open(p2d, delayTime);
0b11111}; open(p2c, delayTime);
digitalWrite (A1, open(p2b, delayTime);
int p6w[] = { HIGH); open(p2a, delayTime);
0b01111, digitalWrite (A2, open(LIGHTSOFF,
0b01111, HIGH); delayTime);
0b11111, digitalWrite (A3, //Pattern3
0b11111, HIGH); open(p3a, delayTime);
0b11111}; digitalWrite (A4, open(p3b, delayTime);
HIGH); open(p3c, delayTime);
int p6x[] = { digitalWrite (A5, open(p3d, delayTime);
0b01111, HIGH); open(LIGHTSON,
0b11111, } delayTime);
0b11111, open(LIGHTSOFF,
0b11111, void loop() { delayTime);
0b11111}; //calling the patterns open(LIGHTSON,
using the lightsOn delayTime);
function open(LIGHTSOFF,
//pattern 7 //Pattern 1 delayTime);
int p7a[] = { open(p1a, delayTime); open(LIGHTSON,
0b10101, open(p1b, delayTime); delayTime);
0b01010, open(p1c, delayTime); open(LIGHTSOFF,
0b10101, open(p1d, delayTime); delayTime);
0b01010, open(p1e, delayTime);
0b10101}; open(LIGHTSOFF, //Pattern4
int p7b[] = { delayTime); open(p4a, delayTime);
0b01010, open(p1e, delayTime); open(p4b, delayTime);
College of Engineering – Department of Electrical Engineering
open(p4c, delayTime); open(p5b, delayTime); open(p6s, delayTime);
open(p4d, delayTime); open(p5a, delayTime); open(p6t, delayTime);
open(LIGHTSON, open(LIGHTSOFF, open(p6u, delayTime);
delayTime); delayTime); open(p6v, delayTime);
open(LIGHTSOFF, open(p5j, delayTime); open(p6w, delayTime);
delayTime); open(LIGHTSOFF, open(p6x, delayTime);
open(LIGHTSON, delayTime); open(LIGHTSON,
delayTime); open(p5j, delayTime); delayTime);
open(LIGHTSOFF, open(LIGHTSOFF, open(LIGHTSOFF,
delayTime); delayTime); delayTime);
open(LIGHTSON, open(p5j, delayTime);
delayTime); //Pattern 7
open(LIGHTSOFF, //Pattern 6 open(p7a, delayTime);
delayTime); open(p6a, delayTime); open(p7b, delayTime);
open(p6b, delayTime);
//Pattern 5 open(p6c, delayTime); open(p7a, delayTime);
open(p5a, delayTime); open(p6d, delayTime); open(p7b, delayTime);
open(p5b, delayTime); open(p6e, delayTime);
open(p5c, delayTime); open(p6f, delayTime); open(p7a, delayTime);
open(p5d, delayTime); open(p6g, delayTime); open(p7b, delayTime);
open(p5e, delayTime); open(p6h, delayTime);
open(p5f, delayTime); open(p6i, delayTime); open(p7a, delayTime);
open(p5g, delayTime); open(p6j, delayTime); open(p7b, delayTime);
open(p5h, delayTime); open(p6k, delayTime);
open(p5i, delayTime); open(p6l, delayTime); open(p7a, delayTime);
open(p5h, delayTime); open(p6m, delayTime); open(p7b, delayTime);
open(p5g, delayTime); open(p6n, delayTime);
open(p5f, delayTime); open(p6o, delayTime); open(p7a, delayTime);
open(p5e, delayTime); open(p6p, delayTime); open(p7b, delayTime);
open(p5d, delayTime); open(p6q, delayTime);
open(p5c, delayTime); open(p6r, delayTime);

V. Individual Conclusion

Cimanes - In conclusion, the 5x5 LED matrix is a small, flexible, and visually appealing tool and it
consists of 25 tiny lights that can be controlled individually to make different shapes, symbols, or
messages and can be used for all sorts of projects, from basic displays to more complex animations. It's
easy for beginners to use and works with many different types of microcontrollers. In this laboratory
activity, we managed to learn how to create various output patterns. Even though we encountered some
wiring mistakes and not getting the results we wanted, we still managed to properly get the desired
results. Overall, this laboratory activity will enhance our problem solving skills and logical thinking.
College of Engineering – Department of Electrical Engineering

Esguerra - In conclusion, this lab provides practical learning experiences in electronics and
programming through the use of Arduino LED implementation. By using a 5x5 LED matrix to create
various output patterns, it inspires me to learn more about coding logic and develop my skills in
hardware implementation. However, throughout the process of writing the code and planning the
circuit's construction, we ran across a few wiring mistakes and occasionally did not receive the desired
result. Together, with my group members, we overcame the challenges that we faced and resolved the
issues we ran into. All things considered, this lab will sharpen our logical thinking and problem-solving
abilities.It may also stimulate creativity and imaginative thinking in multiple fields by promoting a
better comprehension of the creative potential of technology.

Formento -

Goco - This lab experiment involving the construction of a 5x5 LED matrix using an Arduino board
and breadboard proved to be a challenging experience for me. Through this hands-on experimentation,
I hones my problem solving skills and critical thinking gained invaluable insights into the practical
application of circuitry and microcontroller programming. The process of troubleshooting and
overcoming obstacles not only deepened my understanding of electronic components but also
sharpened my problem-solving skills.

Moreover, the collaborative nature of the project emphasized the importance of teamwork in achieving
common goals. Working closely with peers allowed us to leverage each other's strengths and
perspectives, ultimately leading to successful outcomes.

Overall, this lab experiment served as a bridge between theoretical knowledge and real-world
application, equipping me with the technical proficiency and collaborative abilities necessary for future
endeavors in electronics and embedded systems. It underscored the significance of hands-on learning
experiences in fostering a holistic understanding of complex concepts and preparing individuals for the
challenges of the field.

Teves - Our lab experiment involved using an Arduino board on a breadboard to construct an LED 5x5
matrix with the goal of lighting specific patterns. With careful wiring and programming, we were able
to successfully construct a variety of patterns based on the required patterns. This hands-on event gave
us insights into circuits through microcontroller programming and real-world LED matrix applications.
Overcoming troubleshooting challenges improved our understanding of electronic components and
honed our problem-solving skills. In addition, collaboration was essential as we worked together to
achieve our goals. This experiment enhanced our technical proficiency while also encouraging
collaboration and teamwork. It serves as a bridge between conceptual knowledge and real-world
application, preparing us for future projects in electronics and embedded systems.

You might also like