Documente Academic
Documente Profesional
Documente Cultură
2011)
Abstract
The world over the decades has made considerable advancement in automation;
automation is employed in homes, industries, commercial and educational sectors. In
this work, a microcontroller-based automatic school bell is designed. This circuit uses a
programmed microcontroller chip to schedule the school teaching and break periods so
that for every start or end of a period a bell is automatically rang. This design finds a
tremendous use at primary and secondary school levels where the teaching sections can
span over eight periods including breaks. The advantage here is that the bell rings at
the start of each period without any human intervention to a great degree of accuracy.
The time schedule results are compared with that obtained with a clock, however, some
drift is noticed, which is negligible.
Keywords: Automation, break period, time-select switching unit, pull-up resistors,
oscillator characteristics.
is done by pressing the switch that corresponds Table 1 shows some different possible
to the school schedule on the timetable. The timing schedules available for this design.
unit comprises of 11 switches from S1 to S11.
Each switch from S1 to S10 represents a single Table 1. Different timing schedules.
schedule and the set of ten switches gives a
total of ten different timing schedules as shown
in Fig. 3. A single schedule has a total of eight
periods with a breakfast after the fourth period.
The eleventh switch, S11, provides a room for
any emergency that arises which will lead to
the bell ringing, thus called an emergency
switch. This emergency switch is common for
every schedule selected and active at any point
in time during the school hours.
From Fig. 3, VCC = IR, where VCC = +5 V, 2.4 Design of LED Indicators Unit
I = 1.5 mA, R = pull-up resistor. Therefore, R =
VCC / I = 5 V / 0.5 mA = 10 kΩ. The circuit diagram of this unit is as
The pins that were connected to the shown in Fig. 6. The limiting resistance can be
switches are held HIGH by the pull-up calculated as follows. According to Boylestad
resistors. The I/O ports of the 8051 and Nashesky (2007), the voltage across the
microcontroller can be both read and written to LED is 1.7 V. From the datasheet of AT89S51
(bidirectional), therefore, if any of the switches, (2011), the sinking current of port 0.1 and port
after being powered, is pressed to select the 0.2 is 3.2 mA.
schedule, the concerned pin of the For LED to glow, 1.7 V must drop across
microcontroller will be pulled down to ground its terminal. Therefore,
which serves as the input to the
microcontroller. When the microcontroller VCC = VLED + IR,
senses a signal from that pin, it will start
executing some specific instructions as directed where VCC = +5V, R = limiting resistance for
by the software programming. an LED, and
Note: The emergency switch is always
active at every point in time once the schedule R = (VCC – VLED) / I = (5 – 1.7) / (3.2 x 10-3) =
has been chosen. 1.03 kΩ.
U5 U4
T1 2 D1
LINE VREG
R15 VOLTAGE
0.25A fuse 4 1 2.2k COMMON
C4 C5
V1 15V, 2A
220V 3 LED1
D2
C1 1N4007
R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11
10k 10k 10k 10k 10k 10k 10k 10k 10k 10k 10k 1uF 6V Relay
U1 Q1 VR1
U3B U3C
1 P1B0T2 VCC 40 R14
2 P1B1T2EX P0B0AD0 38 100k 50%
3 P1B2 P0B1AD1 39
4 P1B3 P0B2AD2 37 2.2k
5 P1B4 P0B3AD3 36
6 P1B5MOSI P0B4AD4 35
7 34 LED2 R13
8
P1B6MISO P0B5AD5
33 M
P1B7SCK P0B6AD6
9 RST P0B7AD7 32
10 P3B0RXD AT89S51 EAVPP 31 1k 12V DC Motor
11 30
S1 S2 S3 S4 S5 S6 S7 S8 S9 S10 S11 12
P3B1TXD ALEPROG
29 LED3 R12
P3B2INT0 PSEN
13 P3B3INT1 P2B7A15 28
14 P3B4T0 P2B6A14 27
15 P3B5T1 P2B5A13 26 1k
16 P3B6WR P2B4A12 25
17 P3B7RD P2B3A11 24
18 XTAL2 P2B2A10 23
19 XTAL1 P2B1A9 22
20 21
U2 GND P2B0A8
C212MHz C3
START
NO
Choose 45min YES Is S3 NO Is S2 YES Choose 45min
period, 20min break activated? activated? period, 30min break
NO
Choose 40min YES Is S4 NO Is S5 YES Choose 40min
period, 40min break period, 30min break
activated? activated?
NO
NO
Choose 35min YES Is S8 NO Is S9 YES Choose 35min
period, 30min break activated? activated? period, 20min break
NO
Choose 30min
period, 20min break
DELAY
Is it a closing NO
time?
YES
STOP
Fig. 5. Flow chart for the instructions that execute the timing.
1 2 3 4 5 6 7
GND
V
cc
14 1 2 3 4 To the base
P0.
7 of transistor
0
GND
Fig. 9. A 7404 hex inverter pin configuration. Fig. 10. Circuit diagram of the relay driver unit.
The 6 V relay used has the coil resistance applications and it is a feature that certain
of 100 Ω. Therefore, RC = 100 Ω. The NPN semiconductor switches (e.g. transistors, diodes
transistor used is 2N3904. Thus, from the and integrated circuits) cannot provide. Also,
datasheet of 2N3904: the contacts are normally rated for currents
much higher than the current rating of
IC(max )= 200 mA, hFE(max.) = 300. semiconductor switches (Boylestad and
Nasheslky 2007).
Taking hFE to be 100, implies that
3. Results 4. Conclusion
The basic design of the Automatic
After testing the bell, the following
School Bell (mainly for Primary and Secondary
tabulated results shown in Table 2 were
Schools) in this work remains the same though
obtained.
extra functions can be included. This will ring
Table 2. Results obtained from the test. the School Bell at pre-scheduled times of
periods on each day. There are different times
per period varying from one school to the
other. The basic design provides an opportunity
of selecting the suitable time schedule for every
school by momentarily pressing one of the
push-to-on switches. This signals the
microcontroller to carry out the specific task,
thereby ringing the bell at a regular time
interval.
Therefore, from the results obtained, it
can be concluded that the aim of this work has
been practically and theoretically achieved.
5. References
2N3904. 2011. Datasheet. Available:
<http://www.makershed.com/v/vspfiles/asse
ts/images/2n3904.pdf>.
Note: Total drift = 8 * drift per period, since AT89S51. 2011. Datasheet. Available:
every schedule has maximum number of eight <http://www.alldatasheet.com/datasheet-
periods. pdf/pdf/77368/ATMEL/AT89S51-
24AC.html>.
Various deductions can be made from the Boylestad, R.L.; and Nashelsky, L. 2007.
results shown in Table 2. The drift in 45 min is Electronic Devices and Circuit Theory. 9th
more than that of 40 min by 1 sec while in 35 ed., Dorling Kindersley, New Delhi, India.
min and 30 min there is no drift. This means Encyclopedia. 2011. Bell. Available:
that the higher the time schedule is, the more is <http://www.encyclopedia.com/topic/Bell.as
the drift in it. This might occur due to px>.
accumulation of the execution of some Mehta, V.K.; and Mehta, R. 2008. Principles of
microsecond instructions that were not taken Electronics. 11th ed., S. Chand, Ram Nagar,
into consideration during the programming. New Delhi, India.
According to the results in Table 2, it was Theraja, B.L.; and Theraja, A.K. 2003. A
observed that at the end of the school periods Textbook of Electrical Technology. S.
45 min periods have increased by at least 16 Chand, Ram Nagar, New Delhi, India.
sec while that of 40 min have increased by 8 Wikipedia. 2011. Bell (school). Available:
sec. This implies that the seconds’ increment <http://en.wikipedia.org/wiki/School_bell>.
can be negligible since an individual timer
clock varies. Thus, this is accurate enough for
most applications.