You are on page 1of 7

Department of Electrical Engineering

S U LTA N H A J I A H M A D S H A H DEE30071 – Electronic Computer Aided Design

END OF CHAPTER 3
PART A

1. Draw the circuit in Figure 1 below using Proteus Professional software.

Figure 1 Pedestrian Crossing Circuit

1. Figure 2 shows the list of components to be used.

Figure 2
2. Run Arduino IDE software, create a file named “Pedestrian Crossing”.
3. Set the following configuration :
 Click on Tools and select Board : “Arduino Nano” as in Figure 3.

Figure 3

Page | 1
Department of Electrical Engineering
S U LTA N H A J I A H M A D S H A H DEE30071 – Electronic Computer Aided Design

4. Keyin and then save the following program that sets the operation sequence of the pedestrian
crossing.

int red = 10;


int yellow = 9;
int green = 8;
int greenped = 7; // led for pedestrian "cross now"
int redped = 6; // led for pedestrian "don't cross"
int button = 12; // switch is on pin 12

void setup()
{
pinMode(red, OUTPUT);
pinMode(yellow, OUTPUT);
pinMode(green, OUTPUT);
pinMode(greenped, OUTPUT);
pinMode(redped, OUTPUT);
pinMode(button, INPUT);
digitalWrite(green, HIGH);
digitalWrite(redped, HIGH);
}

void loop()
{
if (digitalRead(button) == HIGH){
delay(15); // software debounce
if (digitalRead(button) == HIGH) {
// if the switch is HIGH, ie. pushed down - change the lights!
changeLights();
delay(8000); // wait for 8 seconds
}
}
}

void changeLights(){
// green off, yellow on for 3 seconds
digitalWrite(green, LOW);
digitalWrite(redped, HIGH);
digitalWrite(yellow, HIGH);
delay(3000);

// turn off yellow, then turn red on for 5 seconds


digitalWrite(yellow, LOW);
digitalWrite(red, HIGH);
digitalWrite(greenped, HIGH);
digitalWrite(redped, LOW);
delay(5000);

// red and yellow on for 2 seconds (red is already on though)


digitalWrite(yellow, HIGH);
delay(2000);

Page | 2
Department of Electrical Engineering
S U LTA N H A J I A H M A D S H A H DEE30071 – Electronic Computer Aided Design

// turn off red and yellow, then turn on green


digitalWrite(yellow, LOW);
digitalWrite(red, LOW);
digitalWrite(greenped, LOW);
digitalWrite(green, HIGH);
digitalWrite(redped, HIGH);
delay(3000);
}

5. To begin the compilation process, first click on File and select ‘Preference’, tick the box for “Show
verbose output during: compilation“, as shown in Figure 4.

Figure 4

6. Click on ‘Sketch’ and then click on ‘Verify / Compile’ in Figure 5.

Figure 5

7. When compilation is
done, copy the .hex file
information that is displayed
at the bottom of the screen as
shown in Figure 6, to the
“Program File “ info, for the
Arduino Nano component in
the schematic capture, as
shown in Figure 7.

Page | 3
Department of Electrical Engineering
S U LTA N H A J I A H M A D S H A H DEE30071 – Electronic Computer Aided Design

Figure 6

Figure 7

8. Run the simulation by clicking the ”Run the simulation” button at the bottom left of the screen as
shown in figure 8, and observe the simulation animation.

Run Pause Stop


Figure 8

9. Verify if the simulation animation is following the sequence of the written program.

PART B

1. Draw the circuit in Figure 9 below using Proteus Professional software.


Page | 4
Department of Electrical Engineering
S U LTA N H A J I A H M A D S H A H DEE30071 – Electronic Computer Aided Design

Figure 9 Two Channel Relay Module

2. List of components to be used:

Figure 10

3. Run Arduino IDE software, create a file named “Relay Module”.


4. Set the following configuration.
 Click on Tools and select Board : “Arduino Nano”. (Refer to the same step in Part A)
5. Keyin and then save the following program that sets the operation sequence of the relay module.

#define relay1 A0
#define relay2 A1
#define interval 700

void setup()
{
pinMode(relay1, OUTPUT);
pinMode(relay2, OUTPUT);
}
void loop()
{
digitalWrite(relay1, HIGH);
delay(interval);
digitalWrite(relay1, LOW);
delay(interval);
Page | 5
Department of Electrical Engineering
S U LTA N H A J I A H M A D S H A H DEE30071 – Electronic Computer Aided Design

digitalWrite(relay2, HIGH);
delay(interval);
digitalWrite(relay2, LOW);
delay(interval);
}

6. To begin the compilation process, first click on File and select ‘Preference’, tick the box for “Show
verbose output during: compilation“. Refer to the same step in Part A.
7. Click on ‘Sketch’ and then click on ‘Verify / Compile’. Refer to the same step in Part A.
8. When compilation is done, copy the .hex file information that is displayed at the bottom of the
screen as shown in Figure 11, to the “Program File “ info, for the Arduino Nano component in the
schematic capture, as shown in Figure 12.

Figure 11

Figure 12

9. Run the simulation by clicking the ”Run the simulation” button at the bottom left of the and
observe the simulation animation.
10. Verify if the simulation animation is following the sequence of the written program.

Page | 6
Department Of Electrical Engineering
PRACTICAL SKILL ASSESSMENT RUBRIC

END OF CHAPTER 3

Student Name: Class:


Registration No: Date:
CLO / PLO: CLO2 / PLO5 DK / DP: DK4 / DK6 / DP1 / DP3

Score Description
Aspects Unsatisfactory Moderate Good Excellent Weightage Score
1 2 3 4
A. Project and Unable to create project and Create project and schematic file Create project and schematic file Create project and schematic
Schematic file schematic file. with assistance. independently. capture files independently and 8% / 4 x 8%
professionally.
B. Component None or very few components are Most components are correct. ALL components are correct. ALL components are correct and
12% / 4 x 12%
selection correct. precise.
C. Component Components are designated with Components are designated with Components designated with Components designated with
12% / 4 x 12%
designator incorrect labels and values. correct labels. correct values. correct labels and values.
D. Component The components are placed The components are not placed The components are placed The components are placed and
placement randomly. according to the circuit diagram, but according to the circuit diagram. organized better than in the circuit 12% / 4 x 12%
the placement is acceptable. diagram.
E. Wire None or only a few wire SOME wire connections are correct. ALL wire connections are correct ALL wire connections are correct
12% / 4 x 12%
connection connections incorrect. and short.
F. Simulation Simulation analysis type and Simulation analysis type or Simulation analysis type and Simulation analysis type and
setting simulation configuration are set simulation configuration is set simulation configuration are set simulation configuration are set 16% / 4 x 16%
incorrectly. correctly. correctly. correctly and precisely.
G. Input setting inputs are set incorrectly Inputs are set within acceptable ALL inputs are set correctly ALL inputs are set correctly and
12% / 4 x 12%
range/values. precisely.
H. Simulation Simulation measurement reading / Simulation measurement reading / Simulation measurement reading
Simulation measurement reading
results waveform produced are incorrect. waveform produced are within and waveform produced are
and waveform produced are
acceptable range. correct. 16% / 4 x 16%
correct, precise and support the
circuit theory.

TOTAL SCORE: 100% ( __/ 100) x 100

Practical Work Assessment Distribution Marks


Practical skill rubric (CLO2) / 100 Supervisor signature
TOTAL EOC: / 100

You might also like