Sheet 2
Sheet 2
Sheet [2]
1 Two push buttons (b1 and b2) are connected to the microcontroller through a pull-up and pull-down
resistances respectively. When the first button pressed the LED output turned on, and when the
second button pressed the LED output turned off. Draw the microcontroller circuit connection and
write the code.
Pull up
5V
10 k ...4,7k MC
Pull down P2
5V b1 Led
P7
220
b2 P3
10 k
2 It is required to count from 0 to 99 and display the count on two seven signals, the counter starts at
0 and increment by one every 500ms until it reaches 99 the counter will reset. Draw the
microcontroller schematic connection and with the code.
1
3 A zebra crossing operates according to the following sequence.
1- At the normal condition the green lamp and no-passing lamp
are on.
2- When the passing-button is pressed, after a delay of 3sec the
green lamp turned off and the yellow lamp turned on for
3sec. then the yellow lamp turned off and the red lamp
turned on.
3- After 5sec delay the passing lamp is on and no-passing lamp
is off for 20 sec. Then the passing lamp turned off and no-
passing lamp will turned on.
4- After 5 sec the system will returns back to its normal
condition.
5- the process will not repeated before 100 sec pass
All the lamps are supplied from 220V ac source and the push button
is connected to the microcontroller through a pull-down resistance
and its supply is 24V.
Draw the circuit schematic and write the micro controller code.
220 V
24 V 24 V 24 V 24 V 24 V
Passing Lamp
Green Lamp
No Passing Lamp
Yellow Lamp
Red Lamp
MC ULN 2003
24 V
P3
8k
P4
b1
P5
P2
P6
P7
2k
24 V
2
3
4 In a fire alarm system, there are three fire sensors for three different zones provide inputs to a set-
reset function block so that if one of the sensors is activated the alarm is set and remain set until it is
cleared by using rest button. Also, there are three indication Lamps used to determine which zone has
a fire and will not turn off until the sensors sense no fire.
The fire sensors, the alarm, Lamps, and set-reset button require a 24v supply.
Draw the microcontroller connection circuit and write the microcontroller code.
24 V
24 V
8k 24 V 24 V 24 V 24 V 24 V
Z1
24 V
Zone 2 Lamp
Zone 3 Lamp
Zone 1 Lamp
Alarm
8k 2k P2 ULN 2003
MC
Z2 P6
24 V P7
8k P3 P8
2k
P9
Z3
P4
24 V
2k
8k P5
b1
24 V
N
2k
Wrong answer:
4
Correct answer:
5
5 An automated garage door is operating as the following, once the open signal is received a three-
phase induction motor will run to open the gate until the gate touch the open complete limit switch,
the gate will kept open until the closed signal received, the motor will reverse its direction and keep
working until the gate touch the closed complete limit switch.
The three-phase induction machine need 380V LL supply and the contactors used to drive the three-
phase induction machine need a 48V to activate.
Draw the micro controller connection circuit and write the code.
24 V
8k
A
LS 1 B IM
24 V C
48 V
8k 2k P2 ULN 2003 CC 1 A
MC
LS 2 B
P6
24 V C
P7 48 V
P3 CC 2
8k
2k
OS
P4
24 V
2k
8k P5
CS 48 V
2k
6
6 It’s required to use the microcontroller to Up motor
control an advertising board. Draw the
circuit connection and write the code.
The advertising board is working Aaluminum Beginning of
part
according to the following sequence: the slide photo
cell
• At the beginning the motor at the
upper shaft pull the roll until, it First and Last
sensor
7
24 V
24 V
8k 24 V 24 V
Down
Up motor
S1 ULN 2003 motor
MC
P2
2k
P6
24 V
P7
8k
S2
P3
2k
24 V
8
9