0% found this document useful (0 votes)
20 views5 pages

Lab Reporrt For EM

The document describes 6 experiments conducted using an Arduino board: 1. Making an LED blink using the default Pin 13. 2. Making two LEDs blink alternately using Pins 8 and 9. 3. Using an if/else statement to control an LED based on input from Pin 2. 4. Taking user input via serial communication to display personal information. 5. Allowing a user to control LED blinking via serial input of the number of blinks. 6. Developing a program in Proteus to display numbers on a 7-segment display.

Uploaded by

Elias Hailu
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)
20 views5 pages

Lab Reporrt For EM

The document describes 6 experiments conducted using an Arduino board: 1. Making an LED blink using the default Pin 13. 2. Making two LEDs blink alternately using Pins 8 and 9. 3. Using an if/else statement to control an LED based on input from Pin 2. 4. Taking user input via serial communication to display personal information. 5. Allowing a user to control LED blinking via serial input of the number of blinks. 6. Developing a program in Proteus to display numbers on a 7-segment display.

Uploaded by

Elias Hailu
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/ 5

6. Lab report of the course.

Experiment No. 1 - LED Blink using Default Pin 13 using Arduino.


Objective:
In this experiment, we aimed to create a basic Arduino program that would make an LED
connected to the default Pin 13 blink on and off.
Equipment Used: //Program Code
- Arduino board (Arduino UNO) - LED // LED Blink using Default Pin 13
- Resistor (220 ohm) - Jumper wires void setup(){
Procedure: pinMode(13,OUTPUT);
1. We connected the positive leg of the LED to Pin 13 on the }void loop()
Arduino board. {
2. The negative leg of the LED was connected to the ground (GND) digitalWrite(13,HIGH);
pin on the Arduino board using a resistor. delay(1000);
3. The Arduino program was set up as follow. digitalWrite(13,LOW);

4. The program was uploaded to the Arduino board. delay(1000); }

5. We observed the LED closely, ensuring that it blinked on and off


with a 1-second interval.
Results: - Upon execution of the program, the LED connected to Pin 13 started its blinking
sequence. The LED would turn on for 1 second when the program set the digital output of Pin 13
to HIGH, followed by a 1-second period when the LED turned off, indicated by the digital output
being set to LOW.
Conclusion: - The Arduino program effectively achieved the desired outcome of making the
LED connected to Pin 13 blink on and off with a 1-second interval. By controlling the digital
output of Pin 13 using the program, we were able to control the LED's illumination and create
the blinking effect.

Experiment No. 2 - LED Blink using Other Pins (not default) using Arduino.
Objective:
The objective of this experiment was to create an Arduino program that controlled the blinking
of two LEDs using pins 8 and 9 (other pins).
Equipment Used:
- Arduino board (Arduino UNO) - Two LEDs // program code
- Resistors (220 ohm) - Jumper wires //LED Blink using other Pin(not default)
Procedure: void setup()
1. We Connected the positive legs of the LEDs to pins 8 and 9 {pinMode(8,OUTPUT);
on the Arduino board. pinMode(9,OUTPUT);
2. The negative legs of the LEDs connected to the ground (GND) }void loop(){
pins on the Arduino board using resistors. digitalWrite(8,HIGH);
3. The Arduino program was Set up as follows: digitalWrite(9,LOW);

4. The program was uploaded to the Arduino board. delay(1000);

5. We observed the LEDs and confirmed that they blinked digitalWrite(8,LOW);

alternately with a 1-second interval. digitalWrite(9,HIGH);

Results: - Upon executing the program, the LED connected to delay(1000); }


pin 8 turned on while the LED connected to pin 9 turned off for a
1-second interval. Then, the LED connected to pin 8 turned off while the LED connected to pin 9
turned on for another 1-second interval.
Conclusion: - The Arduino program successfully controlled the blinking of two LEDs connected
to pins 8 and 9. The program effectively controlled the digital outputs of the respective pins,
causing the LEDs to alternate their illumination states with a 1-second interval.

Experiment No. 3 - Arduino Program for If...Else Statement.


Objective:
The objective of this experiment was to create an Arduino program that utilized an if...else
statement to control the state of an LED based on the input from a digital pin.
Equipment Used:
- Arduino board (Arduino UNO) - LED
- Resistor (220 ohm) - Jumper wires
Procedure:
1. The LED was connected to Pin 13 on the Arduino board.
2. A digital pin, Pin 2, was set as an input.
3. The Arduino program was set up as follows:
4. The program was uploaded to the Arduino board. // Program code for if...else statement
5. The behavior of the LED was observed while int x;

varying the input on Pin 2. void setup()

Results: - Upon execution of the program, the LED connected {pinMode(13,OUTPUT);


to Pin 13 responded to the input on Pin 2. When the input on pinMode(2,INPUT);
Pin 2 was LOW (0), the LED was turned off by setting the
}void loop() {
digital output of Pin 13 to LOW. Conversely, when the input
on Pin 2 was HIGH (1), the LED was turned on by setting the x=digitalRead(2);
digital output of Pin 13 to HIGH. The delay of 100 if (x==0)
milliseconds provided a short delay between each iteration of
the loop. digitalWrite(13,LOW);
else
Conclusion: - The Arduino program successfully utilized an
if...else statement to control the state of the LED based on the digitalWrite(13,HIGH);
input from Pin 2. When the input was LOW, the LED turned delay(100); }
off, and when the input was HIGH, the LED turned on.

Experiment-4- Arduino Program for Data Input via Serial Communication (form)
Objective:
The objective of this experiment was to create an Arduino program that allowed users to input
their personal information, including faculty, department, ID number, sex, age, and height, via
serial communication. The program would then display the entered information on the serial
monitor.
Equipment Used:
- Arduino board (Arduino UNO) - Serial communication interface
- Computer with Arduino IDE
Procedure:
1. The red LED connected to Pin 13 was defined as "redLED" in the program.
2. The "redLED" pin was set as an output.
3. Serial communication was initiated at a baud rate of 9600.
4. The following steps were repeated in a loop:
a. The program prompted the user with the question "What is your Faculty?"
b. While waiting for input from the user, the program checked if any serial data was available.
c. Once input was received, it was stored in the "faculty" variable.
d. The received value was displayed on the serial monitor.
e. Steps a-d were repeated for the department, ID number, sex, age, and height inputs.
Results: - Upon execution of the program, the Arduino board initiated serial communication
with the connected computer. The program sequentially prompted the user for their faculty,
department, ID number, sex, age, and height. After each input, the entered value was displayed
on the serial monitor.
Conclusion: - The Arduino program successfully implemented serial communication to enable
users to input their personal information. The program effectively prompted the user for specific
details, recorded the input, and displayed the entered values on the serial monitor.

Experiment No.5 - LED Blinking Control via Serial Communication using Arduino.
Objective:
The objective of this experiment was to create an Arduino program that allowed users to specify
the number of times an LED connected to Pin 13 would blink. The program utilized serial
communication to receive user input and control the blinking of the LED accordingly.
Equipment Used:
- Arduino board (Arduino UNO) - Red LED - Resistor
- Jumper wires - Computer with Arduino IDE - Serial monitor (in Arduino IDE)
Procedure:
1. The red LED connected to Pin 13 was defined as "redLED" in the program.
2. The delay time between each blink was set to 1000 milliseconds.
3. Serial communication was initiated at a baud rate of 9600.
4. The program prompted the user to specify the number of times the LED should blink.
5. Once the input was received, the LED blinked the specified number of times, accompanied by
a corresponding message on the serial monitor indicating the LED's status and the current
iteration count.
Results: - The Arduino program successfully utilized serial communication to allow users to
control the blinking of an LED connected to Pin 13. By providing the desired number of blinks,
the LED responded accordingly. Each blink was accompanied by a message on the serial
monitor, displaying the LED's status (HIGH or LOW) and the current iteration count.
Conclusion: - The experiment demonstrated the successful integration of serial communication
and LED control using Arduino. The program effectively received user input, controlled the
LED's behavior based on the input, and provided feedback through the serial monitor.
Experiment No.6: Arduino Program for 7-Segment Display (Common Cathode)
Using Proteus Software.
Objective:
The objective of this experiment was to develop an Arduino program to control a 7-segment
display with a common cathode configuration using Proteus software. The program aimed to
display numeric characters on the 7-segment display by controlling the individual segment pins
in a virtual simulation environment.
Equipment Used:
- Arduino UNO (in proteus) - 7-segment display (common cathode) - Resistors( in proteus)
- Jumper wires (virtual in proteus) - Proteus software (simulation tool) -Arduino Library
Procedure:
1. The Arduino board and 7-segment display components were set up in the Proteus software.
2. The pin connections between the Arduino board and the 7-segment display were configured in
the virtual simulation.
3. The Arduino program code was written in the Arduino IDE, including the necessary setup()
and loop() functions.
4. The program was simulated using the Proteus software, allowing for the virtual control of the
7-segment display.
5. Inside the setup() function, the pin modes for the segment pins were defined as OUTPUT
using the pinMode() function.
6. Inside the loop() function, the logic was written to display specific characters or numbers on
the 7-segment display by selectively turning on/off the segment pins using the digitalWrite().
7. The program was executed in the Proteus simulation environment, and the behavior of the 7-
segment display was observed.
Results: - the Arduino program successfully controlled the 7-segment display with a common
cathode configuration in the Proteus software simulation. The program accurately displayed the
desired numeric characters or numbers on the virtual 7-segment display by selectively
controlling the individual segment pins.
Conclusion: - The experiment demonstrated the successful development and simulation of an
Arduino program using Proteus software to control a 7-segment display with a common cathode
configuration. The virtual simulation allowed for the accurate representation of the program's
behavior in controlling the display.

You might also like