0% found this document useful (0 votes)
10 views17 pages

Experiment Template - Micro LATEST

This document serves as a template for laboratory reports in the Microprocessor and Microcontroller Systems and Design course at National University Fairview. It outlines the structure and content required, including sections for objectives, equipment, procedures, and source codes for Arduino programs controlling LED arrays. Example scenarios demonstrate the functionality of the programs, emphasizing the use of logic gates and circuit design.

Uploaded by

ren49047
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views17 pages

Experiment Template - Micro LATEST

This document serves as a template for laboratory reports in the Microprocessor and Microcontroller Systems and Design course at National University Fairview. It outlines the structure and content required, including sections for objectives, equipment, procedures, and source codes for Arduino programs controlling LED arrays. Example scenarios demonstrate the functionality of the programs, emphasizing the use of logic gates and circuit design.

Uploaded by

ren49047
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

NATIONAL UNIVERSITY FAIRVIEW MICROPROCESSOR AND MICROCONTROLLER SYSTEMS AND DESIGN LABORATORY REPORT

* ERASE THIS MESSAGE BOX AFTER READING *

National University This is the TEMPLATE for all your


LABORATORY REPORTS.
551 M.F. Jhocson St., Sampaloc, Manila
Data and information in this document
College of Engineering are EXAMPLE ONLY. Contents and
pictures may not be related to each other.
 The PURPOSE of this DOCUMENT is to
show the proper format in a laboratory
report.
 Other notes are written in RED font color.
 Feel free to contact me thru our group
chat or in MS Teams for any questions and
Laboratory Activity 02 concerns.
 Goodluck Engineers. Stay safe. Always.
*[ Activity Title ]

This is your Front Page

Presented by:
[ GROUP NAME ]
Leader : [ Name of Leader ( LN, FN, MI ) ]
Members :
 [ Name of Members in Alphabetical Order ( LN, FN, MI ) ]

Engr. Rafael A. Ventura


Professor
[ Date Performed ]

Submitted to : ENGR. RAFAEL A. VENTURA


NATIONAL UNIVERSITY FAIRVIEW MICROPROCESSOR AND MICROCONTROLLER SYSTEMS AND DESIGN LABORATORY REPORT

PROCEDURE ANSWERS

*If the given experiment has procedure questions, put your answers here.

ACTIVITY DETAILS

SCENARIOS
*Discuss given problem / scenarios here..

 SCENARIO 01

*brief explanation of what your program can do

An Arduino program that will :


 turn ON LED L0 to L7 and vice versa one at a time ( Running Light ).
 once the switch is pressed, SSD1 will display the LED number of the current LED which is
turned ON.
 when a switch is pressed, the Running Light will stop on the current LED ( which is turned
ON ) and displays the LED number in the SSD.
 when a switch is pressed again, it will go back to its Running Light behavior.

Conditions :
 the potentiometer controls the transition speed of the Running Light.

 SCENARIO 02

*brief explanation of what your program can do

An Arduino program that will :


 turn ON LED L0 to L7 and vice versa one at a time ( Running Light ).
 once the switch is pressed, SSD1 will display the LED number of the current LED which is
turned ON.
 when a switch is pressed, the Running Light will stop on the current LED ( which is turned
ON ) and displays the LED number in the SSD.
 when a switch is pressed again, it will go back to its Running Light behavior.

Conditions :
 the potentiometer controls the transition speed of the Running Light.

Submitted to : ENGR. RAFAEL A. VENTURA


NATIONAL UNIVERSITY FAIRVIEW MICROPROCESSOR AND MICROCONTROLLER SYSTEMS AND DESIGN LABORATORY REPORT

 SCENARIO nth

*brief explanation of what your program can do

An Arduino program that will :


 blah blah blah...

Conditions :
 blah blah blah….

Submitted to : ENGR. RAFAEL A. VENTURA


NATIONAL UNIVERSITY FAIRVIEW MICROPROCESSOR AND MICROCONTROLLER SYSTEMS AND DESIGN LABORATORY REPORT

OBJECT IVE OF THE ACTIVITY

 To be able to familiarize the used of common logic gates.


 To be able to implement a given Boolean Expression to its equivalent Logic Circuits
 To blah blah blah….
 To blah blah…

*Apply proper learning objectives here.

EQUIPMENTS AND MATERIALS

*itemize all the components and devices used in the experiment in general.

Name Quantity Value *Symbol Remarks

I/O Components
 LED Array 1 0.5 watts L0 – L7 8 LEDs in an Array
 Seven Segment 1 0.5 watts SSD1 Common Anode
Display
 10kΩ Potientiometer 1 10kΩ P1 ----
 Momentary Switch 1 --- S1 Push to ON – Normally Open

Controllers and ICs


 Arduino Uno Board 1 --- --- ----
 7448 Decoder 1 --- --- Seven Segment Decoder

Others
 Breadboard 1 Full --- ---
 USB Data Cable 1 1m --- Type A Male to B Male
 Connecting Wires 30 10cm --- Male to Male

*Symbol – the symbol used in Schematic Circuit Diagram.

Submitted to : ENGR. RAFAEL A. VENTURA


NATIONAL UNIVERSITY FAIRVIEW MICROPROCESSOR AND MICROCONTROLLER SYSTEMS AND DESIGN LABORATORY REPORT

HARDWARE CONFIGURATIONS AND INTERFACING

*List the connections used in the experiment. Since the exercises / scenario is progressive, use the
setup and connection of the last exercise / scenario only.

Arduino Board pins


 Digital Pins
 D2 – D9 connected to LED Array ( L0 – L7 respectively )
 D10 connected to S1
 Analog Pins
 A4 connected to P1
 A3 connected to input A of the 7448 Decoder
 A2 connected to input B of the 7448 Decoder
 A1 connected to input C of the 7448 Decoder
 A0 connected to input D of the 7448 Decoder

 INITIAL SETUP CONDITION

*state the initial conditions of the hardware for each scenario here

SCENARIO 01
 SSD1 is set to zero.
 S1 is set to OFF.
 P1 is set halfway.
 Running Light LED transition activated.

SCENARIO 02
 SSD1 is set to zero.
 S1 is set to OFF.
 P1 is set halfway.
 Running Light LED transition activated.

SCENARIO NTH
 SSD1 is set to zero.
 S1 is set to OFF.
 P1 is set halfway.
 Running Light LED transition activated.

Submitted to : ENGR. RAFAEL A. VENTURA


NATIONAL UNIVERSITY FAIRVIEW MICROPROCESSOR AND MICROCONTROLLER SYSTEMS AND DESIGN LABORATORY REPORT

SCHEMATIC CIRCUIT DIAGRAM

* Since the exercises / scenario is progressive, use the setup and connection of the last exercise / scenario
only.

*insert schematic circuit diagram here complete with proper labels and
symbols

*the labels and symbols must be readable at 100% document magnification

Submitted to : ENGR. RAFAEL A. VENTURA


NATIONAL UNIVERSITY FAIRVIEW MICROPROCESSOR AND MICROCONTROLLER SYSTEMS AND DESIGN LABORATORY REPORT

PICTORIAL CIRCUIT DIAGRAM

* Since the exercises / scenario is progressive, use the ACTUAL setup and connection of the last exercise /
scenario only.

* properly label the components and parts

SOURCE CODES

Submitted to : ENGR. RAFAEL A. VENTURA


NATIONAL UNIVERSITY FAIRVIEW MICROPROCESSOR AND MICROCONTROLLER SYSTEMS AND DESIGN LABORATORY REPORT

*must include program line numbers


*all curly brackets and function names must be in bold format
*exercise proper program indentation.

 SCENARIO 01

SCENARIO DESCRIPTION

*brief explanation of what your program can do

An Arduino program that will :


 turn ON LED L0 to L7 and vice versa one at a time ( Running Light ).
 once the switch is pressed, SSD1 will display the LED number of the current LED which is
turned ON.
 when a switch is pressed, the Running Light will stop on the current LED ( which is turned
ON ) and displays the LED number in the SSD.
 when a switch is pressed again, it will go back to its Running Light behavior.

Conditions :
 the potentiometer controls the transition speed of the Running Light.

INITIAL CODES

Submitted to : ENGR. RAFAEL A. VENTURA


NATIONAL UNIVERSITY FAIRVIEW MICROPROCESSOR AND MICROCONTROLLER SYSTEMS AND DESIGN LABORATORY REPORT

*your group’s basic raw source code as long as it is working and complies with all the requirements.

*it is ok for the codes here if it is not yet optimized and full of user comments

Experiment 1
{ for(int y = sPin; y<=ePin && flag==0; y+
1 int A = A3; 36
+)
2 int B = A2; 37 { digitalWrite(y,HIGH);
3 int C = A1; 38 delay(tDelay);
4 int D = A0; 39
5 40 switchData = digitalRead(switchPin);
6 int sPin = 2; 41 if(switchData == 1)
7 int ePin = 10; 42 { while(switchData == 1)
{ switchData =
8 43
digitalRead(switchPin);
9 int potPin = A4; 44 }
10 45 val = y - 1;
11 int switchPin = 11; 46 flag = 1;
12 93 break;
13 int flag = 0; 94 }
14 int tDelay = 0; 95 allLEDOff();
15 int val = 0; 96 }
16 int switchData = 0; 97
17 98 for(int z = ePin; z>=sPin && flag==0; z--)
18 void setup() 99 { digitalWrite(z,HIGH);
10
19 { pinMode(A, OUTPUT); delay(tDelay);
0
10
20 pinMode(B, OUTPUT);
1
10
21 pinMode(C, OUTPUT); switchData = digitalRead(switchPin);
2
10
22 pinMode(D, OUTPUT); if(switchData == 1)
3
10
23 { while(switchData == 1)
4
10 { switchData =
24 for(int x = sPin; x<=ePin; x++)
5 digitalRead(switchPin);
10
25 { pinMode(x,OUTPUT); }
6
10
26 } val = z - 1;
7
10
27 flag = 1;
8
10
28 Serial.begin(9600); break;
9
11
29 } }
0
11
30 allLEDOff();
1
11
31 void loop() }
2
11
32 { tDelay = analogRead(potPin); }
3
33 switchData = digitalRead(switchPin); 11
Submitted to : ENGR. RAFAEL A. VENTURA
NATIONAL UNIVERSITY FAIRVIEW MICROPROCESSOR AND MICROCONTROLLER SYSTEMS AND DESIGN LABORATORY REPORT

4
11
34 if(switchData == 1) void allLEDOff()
5
11
35 { while(switchData == 1) { for(int a = sPin; a <=ePin; a++)
6

OPTIMIZED CODES

*your group’s OPTIMIZED final working source code.

*code, process, memory, etc. optimization techniques are already applied in the source code.

Experiment 1
{ for(int y = sPin; y<=ePin && flag==0; y+
1 int A = A3; 36
+)
2 int B = A2; 37 { digitalWrite(y,HIGH);
3 int C = A1; 38 delay(tDelay);
4 int D = A0; 39
5 40 switchData = digitalRead(switchPin);
6 int sPin = 2; 41 if(switchData == 1)
7 int ePin = 10; 42 { while(switchData == 1)
{ switchData =
8 43
digitalRead(switchPin);
9 int potPin = A4; 44 }
10 45 val = y - 1;
11 int switchPin = 11; 46 flag = 1;
12 93 break;
13 int flag = 0; 94 }
14 int tDelay = 0; 95 allLEDOff();
15 int val = 0; 96 }
16 int switchData = 0; 97
17
18 void setup()
19 { pinMode(A, OUTPUT);
20 pinMode(B, OUTPUT);
21 pinMode(C, OUTPUT);
22 pinMode(D, OUTPUT);
23
24 for(int x = sPin; x<=ePin; x++)
25 { pinMode(x,OUTPUT);
26 }
27
28 Serial.begin(9600);
29 }
30
31 void loop()
Submitted to : ENGR. RAFAEL A. VENTURA
NATIONAL UNIVERSITY FAIRVIEW MICROPROCESSOR AND MICROCONTROLLER SYSTEMS AND DESIGN LABORATORY REPORT

32 { tDelay = analogRead(potPin);
33 switchData = digitalRead(switchPin);
34 if(switchData == 1)
35 { while(switchData == 1)

 SCENARIO 02

SCENARIO DESCRIPTION

*brief explanation of what your program can do

An Arduino program that will :


 turn ON LED L0 to L7 and vice versa one at a time ( Running Light ).
 once the switch is pressed, SSD1 will display the LED number of the current LED which is
turned ON.
 when a switch is pressed, the Running Light will stop on the current LED ( which is turned
ON ) and displays the LED number in the SSD.
 when a switch is pressed again, it will go back to its Running Light behavior.

Conditions :
 the potentiometer controls the transition speed of the Running Light.

Submitted to : ENGR. RAFAEL A. VENTURA


NATIONAL UNIVERSITY FAIRVIEW MICROPROCESSOR AND MICROCONTROLLER SYSTEMS AND DESIGN LABORATORY REPORT

INITIAL CODES

*your group’s basic raw source code as long as it is working and complies with all the requirements.

*it is ok for the codes here if it is not yet optimized and full of user comments

Experiment 1
{ for(int y = sPin; y<=ePin && flag==0; y+
1 int A = A3; 36
+)
2 int B = A2; 37 { digitalWrite(y,HIGH);
3 int C = A1; 38 delay(tDelay);
4 int D = A0; 39
5 40 switchData = digitalRead(switchPin);
6 int sPin = 2; 41 if(switchData == 1)
7 int ePin = 10; 42 { while(switchData == 1)
{ switchData =
8 43
digitalRead(switchPin);
9 int potPin = A4; 44 }
10 45 val = y - 1;
11 int switchPin = 11; 46 flag = 1;
12 93 break;
13 int flag = 0; 94 }
14 int tDelay = 0; 95 allLEDOff();
15 int val = 0; 96 }
16 int switchData = 0; 97
17 98 for(int z = ePin; z>=sPin && flag==0; z--)
18 void setup() 99 { digitalWrite(z,HIGH);
10
19 { pinMode(A, OUTPUT); delay(tDelay);
0
10
20 pinMode(B, OUTPUT);
1
10
21 pinMode(C, OUTPUT); switchData = digitalRead(switchPin);
2
10
22 pinMode(D, OUTPUT); if(switchData == 1)
3
10
23 { while(switchData == 1)
4
10 { switchData =
24 for(int x = sPin; x<=ePin; x++)
5 digitalRead(switchPin);
10
25 { pinMode(x,OUTPUT); }
6
10
26 } val = z - 1;
7
10
27 flag = 1;
8
10
28 Serial.begin(9600); break;
9
29 } 11 }

Submitted to : ENGR. RAFAEL A. VENTURA


NATIONAL UNIVERSITY FAIRVIEW MICROPROCESSOR AND MICROCONTROLLER SYSTEMS AND DESIGN LABORATORY REPORT

0
11
30 allLEDOff();
1
11
31 void loop() }
2
11
32 { tDelay = analogRead(potPin); }
3
11
33 switchData = digitalRead(switchPin);
4
11
34 if(switchData == 1) void allLEDOff()
5
11
35 { while(switchData == 1) { for(int a = sPin; a <=ePin; a++)
6

OPTIMIZED CODES

*your group’s OPTIMIZED final working source code.

*code, process, memory, etc. optimization techniques are already applied in the source code.

Experiment 1
{ for(int y = sPin; y<=ePin && flag==0; y+
1 int A = A3; 36
+)
2 int B = A2; 37 { digitalWrite(y,HIGH);
3 int C = A1; 38 delay(tDelay);
4 int D = A0; 39
5 40 switchData = digitalRead(switchPin);
6 int sPin = 2; 41 if(switchData == 1)
7 int ePin = 10; 42 { while(switchData == 1)
{ switchData =
8 43
digitalRead(switchPin);
9 int potPin = A4; 44 }
10 45 val = y - 1;
11 int switchPin = 11; 46 flag = 1;
12 93 break;
13 int flag = 0; 94 }
14 int tDelay = 0; 95 allLEDOff();
15 int val = 0; 96 }
16 int switchData = 0; 97
17
18 void setup()
19 { pinMode(A, OUTPUT);
20 pinMode(B, OUTPUT);
21 pinMode(C, OUTPUT);
22 pinMode(D, OUTPUT);
23
24 for(int x = sPin; x<=ePin; x++)
Submitted to : ENGR. RAFAEL A. VENTURA
NATIONAL UNIVERSITY FAIRVIEW MICROPROCESSOR AND MICROCONTROLLER SYSTEMS AND DESIGN LABORATORY REPORT

25 { pinMode(x,OUTPUT);
26 }
27
28 Serial.begin(9600);
29 }
30
31 void loop()
32 { tDelay = analogRead(potPin);
33 switchData = digitalRead(switchPin);
34 if(switchData == 1)
35 { while(switchData == 1)

 SCENARIO nth

SCENARIO DESCRIPTION

*brief explanation of what your program can do

An Arduino program that will :


 turn ON LED L0 to L7 and vice versa one at a time ( Running Light ).
 once the switch is pressed, SSD1 will display the LED number of the current LED which is
turned ON.
 when a switch is pressed, the Running Light will stop on the current LED ( which is turned
ON ) and displays the LED number in the SSD.
 when a switch is pressed again, it will go back to its Running Light behavior.

Conditions :
 the potentiometer controls the transition speed of the Running Light.

Submitted to : ENGR. RAFAEL A. VENTURA


NATIONAL UNIVERSITY FAIRVIEW MICROPROCESSOR AND MICROCONTROLLER SYSTEMS AND DESIGN LABORATORY REPORT

INITIAL CODES

*your group’s basic raw source code as long as it is working and complies with all the requirements.

*it is ok for the codes here if it is not yet optimized and full of user comments

Experiment 1
{ for(int y = sPin; y<=ePin && flag==0; y+
1 int A = A3; 36
+)
2 int B = A2; 37 { digitalWrite(y,HIGH);
3 int C = A1; 38 delay(tDelay);
4 int D = A0; 39
5 40 switchData = digitalRead(switchPin);
6 int sPin = 2; 41 if(switchData == 1)
7 int ePin = 10; 42 { while(switchData == 1)
{ switchData =
8 43
digitalRead(switchPin);
9 int potPin = A4; 44 }
10 45 val = y - 1;
11 int switchPin = 11; 46 flag = 1;
12 93 break;
13 int flag = 0; 94 }
14 int tDelay = 0; 95 allLEDOff();
15 int val = 0; 96 }
16 int switchData = 0; 97
17 98 for(int z = ePin; z>=sPin && flag==0; z--)
18 void setup() 99 { digitalWrite(z,HIGH);
10
19 { pinMode(A, OUTPUT); delay(tDelay);
0
10
20 pinMode(B, OUTPUT);
1
10
21 pinMode(C, OUTPUT); switchData = digitalRead(switchPin);
2
10
22 pinMode(D, OUTPUT); if(switchData == 1)
3
10
23 { while(switchData == 1)
4
10 { switchData =
24 for(int x = sPin; x<=ePin; x++)
5 digitalRead(switchPin);

Submitted to : ENGR. RAFAEL A. VENTURA


NATIONAL UNIVERSITY FAIRVIEW MICROPROCESSOR AND MICROCONTROLLER SYSTEMS AND DESIGN LABORATORY REPORT

10
25 { pinMode(x,OUTPUT); }
6
10
26 } val = z - 1;
7
10
27 flag = 1;
8
10
28 Serial.begin(9600); break;
9
11
29 } }
0
11
30 allLEDOff();
1
11
31 void loop() }
2
11
32 { tDelay = analogRead(potPin); }
3
11
33 switchData = digitalRead(switchPin);
4
11
34 if(switchData == 1) void allLEDOff()
5
11
35 { while(switchData == 1) { for(int a = sPin; a <=ePin; a++)
6

OPTIMIZED CODES

*your group’s OPTIMIZED final working source code.

*code, process, memory, etc. optimization techniques are already applied in the source code.

Experiment 1
{ for(int y = sPin; y<=ePin && flag==0; y+
1 int A = A3; 36
+)
2 int B = A2; 37 { digitalWrite(y,HIGH);
3 int C = A1; 38 delay(tDelay);
4 int D = A0; 39
5 40 switchData = digitalRead(switchPin);
6 int sPin = 2; 41 if(switchData == 1)
7 int ePin = 10; 42 { while(switchData == 1)
{ switchData =
8 43
digitalRead(switchPin);
9 int potPin = A4; 44 }
10 45 val = y - 1;
11 int switchPin = 11; 46 flag = 1;
12 93 break;
13 int flag = 0; 94 }
14 int tDelay = 0; 95 allLEDOff();
15 int val = 0; 96 }
16 int switchData = 0; 97
Submitted to : ENGR. RAFAEL A. VENTURA
NATIONAL UNIVERSITY FAIRVIEW MICROPROCESSOR AND MICROCONTROLLER SYSTEMS AND DESIGN LABORATORY REPORT

17
18 void setup()
19 { pinMode(A, OUTPUT);
20 pinMode(B, OUTPUT);
21 pinMode(C, OUTPUT);
22 pinMode(D, OUTPUT);
23
24 for(int x = sPin; x<=ePin; x++)
25 { pinMode(x,OUTPUT);
26 }
27
28 Serial.begin(9600);
29 }
30
31 void loop()
32 { tDelay = analogRead(potPin);
33 switchData = digitalRead(switchPin);
34 if(switchData == 1)
35 { while(switchData == 1)

CONCLUSION

*State all that you have learned in the activity.

REFERENCES

*State all the references you used in the Laboratory Report.

Submitted to : ENGR. RAFAEL A. VENTURA

You might also like