Lab Reporrt For EM
Lab Reporrt For EM
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);
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.