MTE-Lab-002
MTE-Lab-002
Objectives:
Proteus Diagram:
The Proteus diagram for this experiment includes an Arduino UNO board and a
common cathode 7-segment display component. Each of the seven segments labeled a
through g is connected to designated digital output pins on the Arduino board (pins 2
to 8). These connections are critical as they allow the microcontroller to individually
activate or deactivate segments to form the desired numeric output. The common
cathode pin of the display is connected to the ground, enabling proper current flow
through the selected segments. Resistors may also be included in the simulation to limit
current through each segment, preventing potential damage. This setup is essential for
understanding how binary control signals from a microcontroller can produce a
readable numeric output through segment illumination. Creating and verifying the
schematic in Proteus helps ensure the correctness of logical design before actual
hardware implementation, making this an invaluable step in embedded system
development.
[2]
in Proteus Simulation.
[3]
Upon successfully running the simulation in Proteus, the 7-segment display lights up to
show the number '7', as programmed in the Arduino code. This output confirms that the
logic and electrical connections are functioning correctly, and the intended behavior is
achieved. The simulation visually demonstrates how microcontroller output pins can
manipulate the display through precise digital signals. By illuminating specific
segments (a, b, and c), the number '7' is represented on the display, validating both the
hardware configuration and the program logic. This process not only tests the circuit
design but also reinforces the importance of code accuracy and debugging in digital
electronics. It provides students with a hands-on opportunity to relate software
commands to hardware actions without needing physical components.
Arduino Code:
void setup() {
// put your setup code here, to run once:
pinMode(2,OUTPUT);
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);
pinMode(8,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
zero();
one();
two();
three();
four();
five();
[4]
six();
seven();
eight();
nine();
}
void zero() {
digitalWrite(2,HIGH);
digitalWrite(3,HIGH);
digitalWrite(4,HIGH);
digitalWrite(5,HIGH);
digitalWrite(6,HIGH);
digitalWrite(7,HIGH);
digitalWrite(8,LOW);
delay(1000);
}
void one(){
digitalWrite(2,LOW);
digitalWrite(3,HIGH);
digitalWrite(4,HIGH);
digitalWrite(5,LOW);
digitalWrite(6,LOW);
digitalWrite(7,LOW);
digitalWrite(8,LOW);
delay(1000);
}
void two() {
digitalWrite(2,HIGH);
[5]
digitalWrite(3,HIGH);
digitalWrite(4,LOW);
digitalWrite(5,HIGH);
digitalWrite(6,HIGH);
digitalWrite(7,LOW);
digitalWrite(8,HIGH);
delay(1000);
}
void three() {
digitalWrite(2,HIGH);
digitalWrite(3,HIGH);
digitalWrite(4,HIGH);
digitalWrite(5,HIGH);
digitalWrite(6,LOW);
digitalWrite(7,LOW);
digitalWrite(8,HIGH);
delay(1000);
}
void four() {
digitalWrite(2,LOW);
digitalWrite(3,HIGH);
digitalWrite(4,HIGH);
digitalWrite(5,LOW);
digitalWrite(6,LOW);
digitalWrite(7,HIGH);
digitalWrite(8,HIGH);
delay(1000);
[6]
void five() {
digitalWrite(2,HIGH);
digitalWrite(3,LOW);
digitalWrite(4,HIGH);
digitalWrite(5,HIGH);
digitalWrite(6,LOW);
digitalWrite(7,HIGH);
digitalWrite(8,HIGH);
delay(1000);
}
void six() {
digitalWrite(2,HIGH);
digitalWrite(3,LOW);
digitalWrite(4,HIGH);
digitalWrite(5,HIGH);
digitalWrite(6,HIGH);
digitalWrite(7,HIGH);
digitalWrite(8,HIGH);
delay(1000);
}
void seven() {
digitalWrite(2,HIGH);
digitalWrite(3,HIGH);
digitalWrite(4,HIGH);
digitalWrite(5,LOW);
[7]
digitalWrite(6,LOW);
digitalWrite(7,LOW);
digitalWrite(8,LOW);
delay(1000);
}
void eight() {
digitalWrite(2,HIGH);
digitalWrite(3,HIGH);
digitalWrite(4,HIGH);
digitalWrite(5,HIGH);
digitalWrite(6,HIGH);
digitalWrite(7,HIGH);
digitalWrite(8,HIGH);
delay(1000);
}
void nine() {
digitalWrite(2,HIGH);
digitalWrite(3,HIGH);
digitalWrite(4,HIGH);
digitalWrite(5,HIGH);
digitalWrite(6,LOW);
digitalWrite(7,HIGH);
digitalWrite(8,HIGH);
delay(1000);
}
[8]
Conclusion: