Library Noise Detector and Short Informa
Library Noise Detector and Short Informa
We, the designers, would like to thank our parents for the support that they
have given us in building the design that we have made; our friends who
who has been patient in giving us lectures and recommendations in the making
of the design; Prof. Benigno Agapito Jr. who checked the format of our
document; Prof. Susana Alabastro who patiently proof read our documents; and
especially God Almighty, who gave us strength and patience in making our
Caryl S. Ferrer
Harvey L. Lim
Aubrey Rae P. Ronquillo
iii
TABLE , F C, NTENTS
TITLE PAGE i
APPROVAL SHEET ii
ACKNOWLEDGEMENT iii
TABLE OF CONTENTS iv
LIST OF TABLES vi
ABSTRACT viii
Design Methodology 23
Design Procedures for Actual Design 23
Hardware Design 26
1. Block Diagram 26
2. Schematic Diagram 27
iv
3. List of Materials 34
Hardware Components 35
Software Design 30
Software Components 38
Prototype Development 40
Conclusion 49
Recommendation 50
BIBLIOGRAPHY 51
v
LIST , F TABLES
vi
LIST , F FIGURES
vii
ABSTRACT
The Library Noise Detector with Short Information Provider is a portable device
that is used in detecting noise in the library. The device is used to control
excessive noise inside the library. The system uses an operational amplifier as a
sensor to detect noise and microcontroller in displaying the output in the
message display. The design was developed as an alternative or additional help
in controlling the noise and prevent disturbances in a specific area of the library.
viii
Chapter 1
signal that is being transmitted. The amount of signal, divided by the amount of
noise that is also present, is often called ‘signal – to – noise ratio’ . Techniques
such as electronic filtering are often used to improve the signal – to – noise ratio.
This is useful if the signal that is being looked for is at particular frequency; the
filter allows that frequency to pass through, but not the other frequencies which
understanding the processes that cause it we can try to reduce it. Judgments of
whether or not environmental sounds are noises are subjective, but the fact is
Such uses of the term noise have been extended to the fields of electricity
and electronics and, in general, to all areas that involve some form of frequency
general, and all circuits posses an inherent level of random noise. External
1
Broadly speaking, the term noise is used in information theory to refer to
addition to such signals. This does not, however, include redundant signals
Noise levels are usually measured in decibel unit. A decibel is one tenth
the reduction in audio level over a 1 mile (1.6 km) length of standard telephone
cable, the bel was originally called the transmission unit or TU, but was renamed
pioneer Alexander Graham Bell. In many situations, however, the bel proved
Its logarithmic nature allows very large or very small ratios to be represented by
decibel is not an SI unit, although the International Committee for Weights and
Measures (CIPM) has recommended its inclusion in the SI system. Following the
The full name decibel follows the usual English capitalization rules for a common
2
noun. The decibel symbol is often qualified with a suffix, which indicates which
reference quantity has been assumed. For example, " dBm" indicates that the
where books, journals, compact discs, microforms, other media, and online
mid 1990’s, there were approximately 76,500 school, 15,200 public, 6,000
corporate, 4,600 college and university, and 4,100 law, medical, and religious
libraries in the United States, and Mexico. These range in size from the Library
libraries serving the media and professions. American libraries currently are
3
A quiet ambiance is essential in the library; it should have a peaceful and
noiseless environment all the time to avoid distractions to library users. But
most of the time, as the people in the library increase; noise is always present
and cannot be easily managed by the library staffs. With this implication, the
groups decided to design a system that can help detect noise in the library with
an alert message provider to let the people become aware whenever they are
making loud noises. The device will monitor the library without further
Generally, the library is a learning place for everyone. In places like this
where people are always present the tendency of having noise cannot be
avoided. When library becomes a noisy environment the main library rule to
probability to have uncontrollable noise inside the library. In this case, the
library staffs have a hard time controlling and informing the people that they are
The design aims to create a device that will detect excessive noise inside
the library as well as inform the library users of the rules and regulations that are
strictly implemented.
project:
4
1 . To be able to lessen the library staff’ s task in maintaining a quiet
ambience;
libraries.
controlling the noise level inside the library with any arrangement of the people.
provider presents a good alternative in posting or displaying the library rules and
regulations.
For the designers being also student is and having the right to use the
library, it is important for them to implement the design to help the library staff
in managing and making the library a better learning place. All the people using
the library will benefit from the design especially when they are annoyed of the
5
e. ConceptuaI Frame5ork
In order to build the design, Ideas and principles related to the design
were studied and discussed. Figure 1 . 1 shows the conceptualized design of the
system. This conceptual framework illustrates how the system of the design
works starting from its inputs then how it will be processed until it produces an
output.
OUTPUT
- A chime sound from a
wireless alarm after a
noise is detected
-A short message to alert
that silence should be
observed (LED Matrix)
The inputs are the noise and the user settings which are independent
variables that come from the user and the surroundings. The noise is the main
input for the design that needs to be detected. The noise level that the detector
detected, the two microcontrollers will act as the communication medium for the
detector and the output devices. The Z8 6 7 3 3 microcontroller will process the
signal that the detector sends and then pass the alert message made or chosen
Matrix. A chime sound will first occur after the detected noise is processed and
6
then followed by a short alert message. This concept describes how the device
ScOpe
1. The noise level that the detector should detect can be varied
through a potentiometer.
format of characters.
5. A chime sound will occur once a noise is detected and the selected
7
DeIimitation
by the user.
design project.
regulations of a library.
detects a noise.
g. Definition of Terms
These are the technical terms which are mentioned in the design
8
2. AnaIog 7 implies a continuous signal in contrast with digital, which
Electronics).
Language).
9
9. FrequenCy 7 the number of complete cycles per second in alternating
(Electronic Devices).
Design).
11. Keypad - a set of buttons arranged in a block which usually bear digits
(Electronic Devices).
materials that are valuable for research (The World Book Dictionary).
nonF volatile memory for the program, volatile memory for input and
Black Book).
10
16. NoiSe LeveI 7 are measured with noise level meters, generally
gain, very high input impedance, very low output impedance, and good
that is widely used due to their low cost, serial programming and reF
such as motion, heat or light and converts the condition into an analog
11
24. Sound 7 created when objects vibrate, resulting in a minute variation
Black Book).
25. Sound LeveI Meter - measures sound pressure level and are
12
Chapter 2
Previous work has shown that the detection of bandFpass noise patterns is
1987). One interpretation of this result is that observers use a channel with an
adjustable bandwidth that matches the bandwidth of the signal when detecting
bandFpass noise ( Green, 196 0). To investigate the notion that observers use
noise detection task under two conditions: an uncertainty condition where the
bandwidth of the noise could vary from trial to trial and a blocked condition
where the bandwidth of the signal was held constant during a block. We used
bandwidth varied from oneFhalf to four octaves. Seven bandwidths were used
and a detection threshold measured at each bandwidth for both the blocked and
three 150 trial thresholds were collected. Noise detection r.m.s. contrast
thresholds increase with the fourthFroot of bandwidth for the ideal observer. For
our blocked condition, we again found that human observers’ noise detection
13
conditions of bandwidth uncertainty, we found that detection thresholds
continued to increase with the fourthFroot of bandwidth. Our results support the
notion that when detecting wideFband noise patterns, observers can adjust the
band of spatial frequencies they use from trial to trial and select the frequency
used as the basis of the circuit of the library noise detector. However instead of
using fixed resistors, a variable potentiometer is used for the variation of noise
levels.
night. If the LED is steady or flashes bright often, then the bedroom is
inadequate and too noisy for sleep. The 70 dB setting is for living rooms. If this
level is often exceeded during the day, the area is uncomfortable. If the noise
14
level is constantly over 8 5 dB, light 8 hours a day, then the environment is
dangerous.
Voltage gain should be measured in order to quantify if the sound entering the
circuit is considered as noise in the circuit. The same IC is used to make the
Figure 2.2 is the picture of the snore alarm electronic device. Breathe is a
noise. The precision of the periodicity of the cycle as well as the number of
15
successive cycles necessary to trigger the alarm can be configured by the use
Based on Figure 2.3 the snore alarm electronic device uses two
potentiometers, one to control the sound level of the tweeter and second to
control the final gain of the analog amplifier. When the user wants to increase
the sensitivity, the knob should be turned clockwise and at the middle course, a
long liner airplane at 10000 feet makes enough noise to switch off the LED. On
power up, a timer is reset and starts to count. The device is active only for the
first two hours and after six hours. If the alarm triggers after fourteen hours, it
means that a new night started and the timer is reset. This is to avoid alarms
16
Figure 2.3 Schematic Diagram of Snore Alarm Electronic Device
17
Noise sensor simpIifies automated noise monitoring
Based on this research study, the Cirrus Environmental has launched its
directly to SCADA systems. The sensor allows noise level data to be incorporated
into Process Measurement and Control systems. The data can be stored to
provide a complete record of a plant' s noise activities, and can also be used to
control noisy processes in real time. For example, a pump or fan can be
throttled back when the noise it generates reaches an excessive level at the site
boundary. Unlike a conventional sound level meter, the MK: 4 2 7 convert the
noise level in decibels into standard 4F20mA and linear DC outputs. With the 4F
20mA output, very long cable lengths can be used without reducing the accuracy
allowing the microphone to be positioned in free space, well away from any
obstructions.
Cirrus said that the pure analogue electronics are reliable and operate
established Cirrus design that has been proven in harsh weather conditions. To
fitted with an electrostatic actuator calibrator. This can be used to make regular
integrity. A preFscaling calibration system allows any 65dB span in the range 20
18
Cirrus Environmental aims to help organizations measure the noise they
make and thereby help manage the impact that noise has on neighbors and the
surrounding environment.
- here? - hy? dB
School playground (outdoors) Avoid annoyance. 55
Hospital rooms To avoid disturbing sleep. 30
To ensure that speakers can understand
Classrooms 35
one another.
To avoid destructions and annoyance to
Libraries 40
others.
Factories, traffic, shopping areas,
To avoid hearing impairment. 70
both indoors and outdoors
These are the measured increase in decibel level that depends on the
19
Based on Table 2.2, the allowable additional amount of decibel level
should only limit with the values given in the table to have an acceptable change
These data are collected from a variety of sources which can help one to
understand the volume levels of various sources and how they can affect our
EN; IR, NMENTAL N, ISE
hearing.
DECIBEL EXAMPLE OF SOUND SOURCES
0 db Weakest sound heard
35 db Whisper Quiet library
60F70 db Normal conversation
80 db Telephone dial tone
85 db City traffic (inside car)
90 db Train whistle at 500’, truck traffic
95 db Subway train at 200’
90F95 db LEVEL AT WHICH SUSTAINED EXPOSURE MAY RESULT IN HEARING LOSS
107 db Power mower at 3’
100 db Snowmobile, motorcycle
110 db Power saw at 3’
115 db Sandblasting, loud rock concert
20
Table 2.4 OSHA Daily Permissible Noise Level Exposure
values of noise level directly proportional to the number of hours per day in
In an orchestral music room, each musical instrument has its own sound
level of music. The commonly used musical instruments are listed with their
The table shows the measurements of sound levels quantify the music
from becoming noise. The sound level may also depend on the kind of music
played by the musicians using these instruments and the volume of the music
21
DECIBEL
60 – 70 db
70 db
75 – 85 db
84 – 103 db
82 – 92 db
85 – 111 db
95 – 112 db
92 – 103 db
90 – 106 db
85 – 114 db
90 – 106 db
85 – 114 db
106 db
94 db
120 – 137 db
120 db
150 db
These statistics for the Decibel Chart were taken from a study by Marshall
Chasin, M.Sc., Aud©, FAAA, Centre for Human Performance & Health, Ontario,
Canada. There were some conflicting readings and, in many cases, authors did
not specify at what distance the readings were taken or what the musician was
actually playing. In general, when there are several readings, the higher one is
chosen.
22
Chapter 3
Design MethodoIogy
The Library Noise Detector with a Short Message Provider was developed
help in controlling noise and prevent disturbances in a specific area of the library.
The design methodology was applied research that is often used to solve
practical problems that relate to this kind of study. This form of research is
information and concepts needed were gathered from books, journals, articles,
and internet for further understanding of the design concepts. With this
information, the group was able to portray the process of the system. This
approach helps the design to obtain a balance to the objectives and expectations
The noise detector application was used as a reference for the design.
The circuit was customized so that the level of sensitivity can be varied. The
logic of the process in making the design was carefully analyzed. The step by
23
1. The problem was determined and the factors that should be
altogether for the design were one of the tasks was to find the
input from a serial data. These researches helped how the design
should be implemented.
3 . The circuit diagram of the noise detector was developed with the
variation of the noise level and the analog output needed by the
and during testing F the blinking of the LED indicator dictates the
inputs, displaying it to the LCD and sending the data to the other
24
how it will function and be connected to other devices. It also
stored the program of the process and how the alarm can be
4 . Program listing was the next process after designing the circuit
input of data was used to test the program to the design itself.
output device for all the inputs in the keypad. The behavior of
each button in the keypad was also included in the program listing
editing the alert message and for choosing the library rules and
25
5. After being tested, the circuit was transferred into a PCB layout to
1. BIOck Diagram
LCD
2x40 characters
PIC16F877
Noise Detector
Microcontroller of 8x8 LED Matrix
the LED
26
Figure 3 . 1 shows an illustration of the System Block Diagram for the
system design. Initially, the user will set the desired noise level in the noise
keypad, the user can input alert messages which are temporarily shown in the
LCD display. When the noise signal is detected and exceeds the noise level set,
receives the signal, it will transfer to the Z8673 3 microcontroller and the alarm
will be turned on. The Z86733 will acknowledge the transferred signal and it will
then pass the user input message to PIC16F877 that controls the 8x8 LED Matrix
2. Schematic Diagram
The schematic diagram of the design system illustrates how the circuitry
Figure 3.2 shows the whole circuit of the Library Noise Detector with Short
components used for the whole design system. This circuit operates as noise
sensor and message provider that are put together as one design system. The
microcontroller. For the schematic diagram of the power supply, refer to Figure
3.6.
27
LCD display and LED matrix. The seven pins of the keypad for the row and
column are connected to the input ports of the Z86733. The input/output ports
of the LCD display are connected to the Z8 6 7 3 3 for displaying the data. The
Figure 3.4 is the schematic diagram of the 8 x 8 LED Matrix display. The
The PIC is connected to the noise detector and the Z86733 microcontroller.
Once the noise is detected, it will trigger the PIC to display the message.
Figure 3.5 refers to the circuit of the noise detector. The noise detector
connected to the input part of the circuit. The circuit has a connection to the
input of the PIC16F877 and connected to Z876733 to trigger the alarm and the
28
Figure 3.2 Schematic Diagram of the whole Library Noise Detector with Short Information
Provider
29
Figure 3.3 Schematic Diagram with Microcontroller Z86733
3
10.240 MHz
Figure 3.4 Schematic Diagram of Microcontroller PIC16F877 for the 8x8 LED Matrix
31
Figure 3.5 Schematic Diagram of the Noise Detector
32
Figure 3.6 Schematic Diagram for the Power Supply
33
3. List of MateriaIs
The following is the list of materials used in creating the circuit of the
design system:
1 pc 1N4001 2 pcs
33k resistor
2 pcs PIC16f877 1 pc
22k resistor
LM358 Dual Operational 1 pc
Lm7805/Lm7808 2 pc Amplifier
34
Hard5 are Components
These figures show the actual PCB layouts of the hardware components in
the circuit.
PCB Layouts
35
Figure 3.8 Z86733 Microcontroller
Figure 3.8 shows the PCB layout for the Z8673 3 Microcontroller. The
layout shows how the other components such as resistors, transistors, and
Figure 3.9 illustrates the actual PCB layout of the PIC16F877. This layFout
LCD DispIay
The saved and input messages are displayed in the LCD. The data to be
displayed will come from the microcontroller. The LCD will display the options of
the user and the selected alert messages will be displayed in the LED Matrix.
36
Keypad
A keypad that operates like a cellular phone keypad was used for the user
input message.
8 x 8 LED Matrix
Since the design displayed short information, an 8x8 LED Matrix was used
to display information visible to the people inside the library. It is displayed the
selected message of the user once noise was detected. It also displayed the
EIectret Microphone
noise to electrical signal given that the circuit is an electrical circuit. Basically, it
unidirectional since all microphones can only absorb when the source is in front.
, perationaI AmpIifier
The operational amplifier has been found to be the best device for the
system design. It is a device that amplifies the signal coming from the
microphone. By getting the voltage gain in this stage, the noise can be
quantified in the circuit. Its unique characteristic helped to make the design
possible.
The microcontroller was used for the design project. It gives control to
the operation of the whole system of the design especially in interfacing the
37
noise detector with the LED Matrix display and also with the other input/ output
The microcontrollers save the data coming from the user for message
display. It also functions as a medium for transmitting the noise signal coming
from the noise detector. The main routine of the program of the
microcontrollers is to save the user input data and to acknowledge the noise
microcontroller which serves as the storage of the received data as well as the
communication medium between the other parts and i/o devices within the
Assembly Language which has simpler and shorter syntax of program codes. For
the PIC16F877 microcontroller, the programming language used was C# for the
LED Matrix display. The program codes are separated according to the different
functions that will be performed by the i/o devices in the system design.
Instruction sets used in the program dictates how each ports in the
microcontrollers should be assigned and how each ports should function either as
38
1 . System FIo5chart
START
Initialization of LCD
N
Continue displaying
the default stand by
Is there a
message
YES
END
39
Figure 3.10 shows the system flowchart of the design project. The
flowchart specifies how the system decides and sets its condition before it
processing the input data of the user and the input data coming from the noise
detector. The flowchart is the overall route of all the inputs until it produces a
certain output.
Prototype DeveIopment
system design.
3. Preparing the list of materials and electronic devices to be used for the
design hardware.
40
4. Designing the circuitry of the noise detector with a variation of noise
level.
5. Testing the circuitry and encoding the program listing for the message
display
41
Chapter 4
Since the design of the noise detector was based on an existing room
fixed values of resistances and several switches for setting the noise level to be
detected. After the device has been constructed, several testing has been made
on the prototype and the operation of each major components of the system. In
program responds with the electronic devices. Hence, checking was made by
data validity and setting of the noise level of the noise detector.
In conducting the test, the circuit of the noise detector and the source of
sound are needed. The initial testing made was checking if the existing room
noise detector with a fixed noise level will work after replacing it with a
potentiometer with variable resistances. The noise detector circuit was formed
and temporarily tested in a bread board with a LED indicator for the noise
detection. After the circuit was formed, it was placed in a slightly noisy
environment. In this testing the exact noise level was not yet exactly measured.
42
The result of this test showed the behavior of the noise detector as it
detected noise or different sources of sounds from its environment. Since the
noise level did not measure the threshold value of the resistance set for 50 db to
8 5 db, noise level the position of the knob showed how the noise level varied.
medium in determining the validity of the data in noise detection. Moreover, the
STATUS OF THE LED can be determined when the LED lighted on as the noise
detector detected noise. The CONDITION results indicated that the tests simply
show that the noise detector is in good condition and that it can determine the
circuit of the noise detector, another test was made which showed how the noise
level was set and how much voltage was needed to reach a certain noise level.
To conduct the test, a digital multimeter and the noise detector circuit were
potentiometer was measured. The noise level depended on the voltage gain of
43
Based on Table 4 . 2 , the resistances in potentiometer are set and the
having a 0 . 0 3 AC voltage. The table shows the values of the output voltages
that should be produced by the circuit in order to obtain the set noise level and
trigger the message display. In order to compute the equivalent decibel value,
the gain was computed based on the formula of db = 20 log (Vout / Vin). When
the input noise reaches these certain amount of voltages, it is considered noise
in the circuit. The standard noise levels can be found based on Chapter 2 on
Review of Related Literature and Related Studies. The results of this test help
the user to understand how the noise is quantified by the noise detector
To perform the test, the noise detector circuit and any sound source were
needed. After learning how the noise level was set and varied from the results
of its detection, another testing was done in a 7.4’ x 6.3’ x 8.1’ room to show
and test how the noise detector detects different sources of noise that are
commonly heard in a school library were used. The Noise Detector was set to 50
db, 65 db, 85 db to detect noise based on the LED indicator and if the
PIC1 6 F8 7 7 was triggered to display an alert message. The status results are
most likely expected to have similar results based on the earlier test done by the
noise detector.
44
At 5 ) db noise IeveI
SOURCE OF
TEST STATUS OF THE LED REMARKS
SOUND
1 Blinking with high intensity of LED Message displayed
Whistle
2 Clapping Continuous blinking of LED Message displayed
Table 4 . 3 shows the different results in testing the library noise detector
with different sources of sound. Based on the results, the noise detector can
45
easily detect constant noise and high pitch sounds. The detection varies with the
kind of sound produced and its distance to the noise detector. The sensitivity of
the sensor depends on the noise level set on the noise detector. If the noise
level is low, the detector can easily detect noise and if the noise level is high,
longer time is needed to detect noise. The intensity of light of the LED indicates
how much noise is detected. When the intensity of light of the LED is high it
means that the noise has reached the sound level set on the noise detector. If
the LED blinks the noise is detected and it can either produce an alarm or not. If
it does not produce an alarm but the LED is blinking, it means that the noise
detector can still detect but the noise does not reach the sound level set on the
microcontroller are transferred to the PIC16F877 for message display in the 8x8
LED Matrix. These messages are only displayed if the noise detector has enough
The following materials were used to conduct the test: sound level meter,
testing room that measured 31’ x 23.5’ x 18.95’ . The setting was only at the
46
considerable noise level in a library environment. Since the device was placed on
each table inside the library, the distance of the source of sound is 0.25m, 0.5m,
and 1 m measured by the pushFpull rule from the noise detector. This testing
aimed to prove that the noise detector can detect different sound sources even if
the source
Sourcewas almost one meter away from the noise Remarks
Distance detector. The sound level
meter Trial
was 1used to measure the amount of noise in terms
0.25 m of detected
Noise decibel.with message
Trial 2 0.50 m display
Trial 3 1m Noise detected but with no
message display
Trial 1 0.25 m Noise detected but with no
Trial 2 0.50 message display
Trial 3
1m Noise detected with message
Trial 1 display
Trial 2 0.25 m Noise detected but with no
Trial 3 0.50 m message display
1m Noise detected but with no
message display
due to the consistency of the sound sources that the sound level meter detects.
The noise level of the sound varies with its distance to the sound level meter.
When the source is near the sound level meter, the decibel value is higher and
as it gets farther, the decibel value decreases. For this reason, the detection of
47
the noise detector also depends on the distance of the sound source. As the
sound level meter measures the noise level, the noise detector also detects the
noise at the same time. It shows that the noise level set in the potentiometer is
detector. The remarks prove the design project set the validity of the input
the 8 x8 LED Matrix if it reaches the set noise level of 5 0 db. Even though
detection of noise is in the process in the noise detector, the warning is only
made if the source of noise will reach or exceed 50 db which proves the
efficiency and quality of the noise detector and the microcontrollers for the
48
Chapter 5
ConcIusion
The design project was able to detect excessive noise and provide a short
message to remind the library users not to make excessive noise. This feature of
the design is an aid to avoid having too much noise created by the people inside
the library.
The library staff takes care of borrowed and returned books as well as
maintaining order in the library. The device will inform the library users through
the detector’ s alarm and alert messages displayed on a LED matrix panel after
detection of excessive noise; thus lessening the library staff’s task of maintaining
a quiet ambience.
Based on the research conducted, a noise detector was designed that can
vary the noise level, and through microcontrollers, a message display device was
used to add functions to the whole design system. The Library Noise Detector
with Message Provider was put into operation by interfacing a noise detector’ s
Most of the time, students go to the library just to hangout, chat with
friends or use for their benefit of the facilities without realizing the disturbances
they create. This design project will be very much effective in maintaining order
in school libraries because it will make the students become aware of the proper
49
Recommendation
other kinds of noise sources and its message provider. Making the design not
just portable but also wireless would be a great improvement of the design itself.
input signals from the microphone to the system design. This device is also used
to create a wireless connection from the noise detector to the message display
device. This is implemented to provide convenience and allows the library staff
maximum. For practicality means it is much better to have only one set of the
Library Noise Detector provided that it can detect noise in a larger area and alert
The design system can also be applied in classrooms, offices and in any
sophisticated look in putting altogether all the parts or input/ output devices of
50
BIBLI, GRAPHY
nd
Detection of Signals in Noise.2 Edition (March 1993); Robert McDonough, Noise
Level
Fay, Thomas H., ed., Noise and Health (1991); Morrison, Ralph, Noise and Other
Integrated and Hybrid Circuits (1993); Stanley, W., Operational Amplifiers with
Taylor, C.P., Bennett, P.J., & Sekuler, A.B. (2003), Noise detection: bandwidth
World Book Dictionary, Volume 1 (AFK) and Volume 2 (LFZ) © 1976, By Field
rd
Mano, Morris,. Digital Design, 3 edition
Herrick, Clyde N., Instruments and Measurement for Electronics, p.17 – p.19
Petruzzelis, Tom, Electronic Sensors for the Evil Genius, p.3 – p.15
51
APPENDI? A
MateriaI Listings and Price Lists
52
List of MateriaIs
MaleFfemale
1 pc P25.00 P25.00
connector
53
Toggle switch 2 pcs P10.00 P20.00
03SBA10 bridge
1 pc P35.00 P35.00
rectifier diode
TotaI P 4,952.20
54
APPENDI? B
Data sheets
55
56
ZILOG Z86733 MICROCONTROLLER
57
58
59
APPENDI? C
Program Listing
60
Program Listing in the : 86733 for Keypad and LCD
.org 00h
.word 0ffffh
;p33 .word 0ffffh
;p32 .word 0ffffh
;p31 .word 0ffffh
;p30 .word
baudrate .wo
rd timer_int
di ; disable interrupt
srp # 1 0 h ; set register pointer to # 1 0 h
ld spl, # 8 0 h ; initialized stack pointer at 8 0 h
ld p0 1 m, # 0 4 h ; set port0 ( p0 ) as output
ld p2 m, # 0 0 1 1 0 0 0 0 b ; set port2 ( p2 ) as output
ld p3m,#01h ; set port2 as digit and push- pull mode
clr irq
clr ipr
ld t1 , # 3 bh
ld pre1 , # 0 0 0 1 0 0 1 1 b
ld pre0 , # 0 0 1 0 0 1 0 1b ; 1 0 4 micro secs.
ld t0,#15 ; note set crystal oscillator 1 1 . 1 5 0 mhz; 1 5 use
1 0 . 2 4 mhz
ld imr, # 3 0 h
ei ; enable interrupt
61
call erase_ ram
ld r4,#29h
ld 28h,#0ffh
clr p3
clr p0
call delay2
call lcd_ init
restart:
ld r6,#>tittle
ld r7,#<tittle
call line1
ld r6,#>school
ld r7,#<school
call line2
call delay2
call line2
ld position,#0c3h ; starting position of char display in the lcd
ld r6,#>clear
ld r7,#<clear
call line1
ld r6,#>clear
ld r7,#<clear
call line2
jr input
loop_ restart:
tm p3,#01h
jr z, loop_ restart
ld r6,#>clear
ld r7,#<clear
call line2
call delay
input:
ld r6,#>lower
ld r7,#<lower
call line1
call delay
call keypad
input_ a:
cp press_no,#02h
jp eq, keyabc
cp press_no,#03h
jp eq, keydef
cp press_no,#04h
62
jp eq,keyghi
cp press_no,#05h
jp eq,keyjkl
cp press_no,#06h
jp eq,keymno
cp press_no,#07h
jp eq,keyprs
cp press_no,#08h
jp eq,keytuv
cp press_no,#09h
jp eq,keywxy
cp press_no,#00h
jp eq,keyzero
cp press_no,#0f3h
jr eq,upper_input
jr input
upper_ input:
ld r6,#>upper
ld r7,#<upper
call line1
call delay
call keypad
upper_ a:
cp press_no,#02h
jp eq,keyABC
cp press_no,#03h
jp eq,keyDEF
cp press_no,#04h
jp eq,keyGHI
cp press_no,#05h
jp eq,keyJKL
cp press_no,#06h
jp eq,keyMNO
cp press_no,#07h
jp eq,keyPRS
cp press_no,#08h
jp eq,keyTUV
cp press_no,#09h
jp eq,keyWXY
cp press_no,#00h
jp eq,keyZERO
cp press_no,#0f3h
jp eq,numlock
jr upper_input
63
numlock:
ld r6 , # > number
ld r7 , # < number
call line1
call delay
or tmr, # 0 ch
numlock_ a:
call keypad
cp press_no,#01h
jr eq,key1
cp press_no,#02h
jp eq,key2
cp press_no,#03h
jp eq,key3
cp press_no,#04h
jp eq,key4
cp press_no,#05h
jp eq,key5
cp press_no,#06h
jp eq,key6
cp press_no,#07h
jp eq,key7
cp press_no,#08h
jp eq,key8
cp press_no,#09h
jp eq,key9
cp press_no,#00h
jp eq,key0
cp press_no,#0f3h
jp eq,input
jr numlock_a
readytosend:
ld r1,#29h
ld r0,#'A'
call tx_ data
ld r0,#'T'
call tx_ data
ld r0,#'+'
call tx_ data
send_ msg:
ld r0,@r1 ;transfer the content data of address to working reg
call tx_ data r0 ;pulse enable
inc r1
cp r1,#6ah
64
jr eq, return1 ;inc address to fetch next character from ascii
jr send_ msg
return1 :
ld r0,#0h
call tx_ data
ld p0,#06h ; this is for the alarm on state
call delay2
ld p0,#0h ; alarm off state
hang:
tm p2,#20h
jr nz, readytosendb
jr hang
readytosendb:
tm p2,#20h
jr nz, readytosendb
jr readytosend
;========= numlock text =========
key1:
ld letra,#02h
ld variable1,#'1'
ld variable2,#02h
call showtxt
jp numlock_a
key2 :
ld letra,#02h
ld variable1,#'2'
ld variable2,#02h
call showtxt
jp numlock_a
key3 :
ld letra,#02h
ld variable1,#'3'
ld variable2,#02h
call showtxt
jp numlock_a
key4 :
ld letra,#02h
ld variable1,#'4'
ld variable2,#02h
call showtxt
jp numlock_a
key5 :
ld letra,#02h
65
ld variable1,#'5'
ld variable2,#02h
call showtxt
jp numlock_ a
key6 :
ld letra,#02h
ld variable1,#'6'
ld variable2,#02h
call showtxt
jp numlock_ a
key7 :
ld letra,#02h
ld variable1,#'7'
ld variable2,#02h
call showtxt
jp numlock_ a
key8 :
ld letra,#02h
ld variable1,#'8'
ld variable2,#02h
call showtxt
jp numlock_ a
key9 :
ld letra,#02h
ld variable1,#'9'
ld variable2,#02h
call showtxt
jp numlock_ a
key0 :
ld letra,#02h
ld variable1,#'0'
ld variable2,#02h
call showtxt
jp numlock_ a
keyabc:
ld letra,#04h
ld variable1,#'a'
ld variable2,#02h
call showtxt
jp input_ a
keydef:
ld letra,#04h
ld variable1,#'d'
66
ld variable2,#03h
call showtxt
jp input_ a
keyghi:
ld letra,#04h
ld variable1,#'g'
ld variable2,#04h
call showtxt
jp input_ a
keyjkl:
ld letra,#04h
ld variable1,#'j'
ld variable2,#05h
call showtxt
jp input_ a
keymno:
ld letra,#04h
ld variable1,#'m'
ld variable2,#06h
call showtxt
jp input_ a
keyprs:
ld letra,#05h
ld variable1,#'p'
ld variable2,#07h
call showtxt
jp input_ a
keytuv:
ld letra,#04h
ld variable1,#'t'
ld variable2,#08h
call showtxt
jp input_ a
keywxy:
ld letra,#05h
ld variable1,#'w'
ld variable2,#09h
call showtxt
jp input_ a
keyzero:
ld letra,#02h
ld variable1,#20h
ld variable2,#00h
call showtxt
jp input_ a
keyautospace:
67
ld letra,#02h
ld variable1,#20h
ld variable2,#0ffh
call showtxt
jp input_a
keyABC:
ld letra,#04h
ld variable1,#'A'
ld variable2,#02h
call showtxt
jp upper_ a
keyDEF:
ld letra,#04h
ld variable1,#'D'
ld variable2,#03h
call showtxt
jp upper_ a
keyGHI:
ld letra,#04h
ld variable1,#'G'
ld variable2,#04h
call showtxt
jp upper_ a
keyJKL:
ld letra,#04h
ld variable1,#'J'
ld variable2,#05h
call showtxt
jp upper_ a
keyMNO:
ld letra,#04h
ld variable1,#'M'
ld variable2,#06h
call showtxt
jp upper_ a
keyPRS:
ld letra,#05h
ld variable1,#'P'
ld variable2,#07h
call showtxt
jp upper_ a
keyTUV:
ld letra,#04h
ld variable1,#'T'
ld variable2,#08h
68
call showtxt
jp upper_ a
keyWXY:
ld letra,#05h
ld variable1,#'W'
ld variable2,#09h
call showtxt
jp upper_ a
keyZERO:
ld letra,#02h
ld variable1,#20h
ld variable2,#00h
call showtxt
jp upper_ a
keyAUTOSPACE:
ld letra,#02h
ld variable1,#20h
ld variable2,# 0ffh
call showtxt
jp upper_ a
69
ld press_no,#03h
ret
four:
call wait_ 1
and p0,#00000000b
or p0,#10110000b
tm p3,#02h
jr nz, five
call delayk
ld press_no,#04h
ret
five:
tm p3,#04h
jr nz, six
call delayk
ld press_no,#05h
ret
six:
tm p3,#08h
jr nz, seven
call delayk
ld press_no,#06h
ret
seven:
call wait_ 1
and p0,#00000000b
or p0,#11010000b
tm p3,#02h
jr nz, eight
call delayk
ld press_no,#07h
ret
eight:
tm p3,#04h
jr nz, nine
call delayk
ld press_no,#08h
ret
nine:
tm p3,#08h
jr nz, ask
call delayk
ld press_no,#09h
ret
ask:
call wait_ 1
70
and p0,#00000000b
or p0,#11100000b
tm p3,#02h
jr nz, zero
call delayk
ld press_no,#'*'
sub press_no,#30h
ret
zero:
tm p3,#04h
jr nz, sharp
call delayk
ld press_no,#0h
ret
sharp:
tm p3,#08h
jp nz, keypad_ a
call delayk
ld press_no,#'#'
sub press_no,#30h
ret
keypad_ out:
ld press_ no, # 0 ffh
ret
delete_ button:
tm p2,#10h
jr z, erase_ char
tm p2,#20h
jp nz, readytosend
tm p3,#01h
jp z, message_ one
jp loop_ keypad
erase_ char:
clr seconds
looperase_ char:
cp seconds,#20
jr ule, looperase_ char
cp position,#0c3h
jr eq, exit_ erase
dec position
dec r4
loop_ erase:
cp seconds, # 3 0 ; timer for erasing all char
jr uge, erase_ lahat
tm p2,#10h
jr z, loop_ erase
71
ld data_out,#20h
call dis_ char
ld press_ no, # 0 edh ; flag for erasing a char
ret
exit_ erase:
ld position, # 0 c3 h
ret
erase_ lahat:
ld r0,#00
ld r1,#29h
clean:
ld @r1,r0
inc r1
cp r1,#069h
jr ne, clean
ld position,#0c3h
ld r4,#29h
ld r6,#>clear
ld r7,#<clear
call line2
ret
;=================================
showtxt:
or tmr, # 0 ch
clr counter
ld value, variable1
showtxt1 :
call lcddisplay
inc counter
cp counter, letra
jr uge, showtxt
call keypad
cp press_no,#0edh
jr eq, exittext
cp press_no,#0d0h
jr eq, exittext
cp press_ no, variable2
jr ne, outshowtx
inc value
clr seconds
jr showtxt1
outshowtx:
cp position,#0e5h
jr eq, stoptxt
cp press_no,#0ffh
72
jr eq, autospace
cp indicator, # 0 ffh ; autospace flag
jr eq, stoptxt
inc position
inc r4
exittext:
ret
stoptxt:
clr indicator
ret
autospace:
inc position
inc r4
ld indicator, # 0 ffh ; the autospace happens
ret
lcddisplay:
ld @r4,value
ld data_ out, value
call dis_ char
ret
73
jr ult, loop_ upto8
and tmr,#0fch
or p0,#01h
ret
baudrate:
rr r0
ld shift_bit,r0
and shift_bit,#01h
and p0,#0feh
inc ctr
inc bitrate
iret
display:
add data_ out, # 3 0 h
dis_ char:
ld data_ set1 , position
call pulse
ld r8,data_out
call pulse1
ret
display_ back:
add data_ out, # 3 0 h
dis_ char1 :
ld data_ set1 , position
call pulse
ld r8,data_out
call pulse1
dec position
ret
line1 :
ld data_ set1 , #8 0 h ;set first address of first
call pulse ;pulse register
call display_ msg ;go to fetching of data from ascii
ret setting ;return
line2 :
ld data_ set1 , # 0 c0 h
call pulse
call display_ msg
ret
display_ msg:
ldc r8,@RR6 ;transfer the content data of address to working reg r8
cp r8,#24h
74
jp eq, return
call pulse1 ; pulse enable
incw RR6 ; inc address to fetch next character from ascii
djnz r9 , display_ msg ; dec working reg. r9 and check if 0 , end of line
return:
ld r9 , # 4 0 ; reset the character counter
clr r8
ret
lcd_ init:
ld data_set1,#02h ;set data length for 8 bits/5x7
call pulse dots/2line ;pulse enable pin
ld data_set1,#28h
call pulse
ld data_set1,#28h
call pulse
ld data_set1,#28h ;entry mode:inc address ,no
call pulse ;pulse enable
ld data_set1,#0ch pin ;set dd
call pulse ram ;puls
ld data_set1,#06h e enable pin
call pulse ;set dd ram
ld data_set1,#01h ;pulse enable
call pulse pin ;set dd
ld data_set1,#02h ram ;puls
call pulse e enable pin
ld data_set1,#40h ;set dd ram
call pulse ;pulse enable
ld data_set1,#80h pin ;set dd
call pulse ram ;puls
call delay
ld r9,#40
ret ;return end of
pulse:
call split_data
and p2,#0f0h
or p2,data_set1
or p2,#80h ;#20h;set enable pin to high
and p2,#7fh state ;#0dfh ;set it low
and p2,#0f0h
or p2,data_set2
or p2,#80h ;#20h;set enable pin to high
and p2,#7fh ;#0dfh
and p2,#0f0h
call wait_ 1 ;wait
ret awhile ;re
pulse1 :
75
ld data_set1,r8
call split_ data
and p2,#0f0h
or p2 , data_ set1 ; load data to port 2
and p2,#03fh ;#0cfh
or p2,#40h ;#10h;set register select high
nop
nop
nop
or p2,#80h ;#20 h;set enable and register select pin high
and p2,#07fh ;#0dfh
call wait_ 1
and p2 , # 0 f0 h
or p2 , data_ set2 ; load data to port 2
and p2,#03fh ;#0cfh
or p2,#40h ;#10h;set register select high
nop
nop
nop
or p2,#80h ;#20 h;set enable and register select pin high
and p2,#07fh ;#0dfh
nop
nop
nop
and p2,#03fh ;#0cfh
call wait_ 1 ;clear both pin
ret
split_ data:
ld data_set2,data_set1
swap data_set1
and data_set1,#0fh
and data_set2,#0fh
ret
erase_ ram:
ld r0,#00
ld r1,#12h
clean2 :
ld @r1,r0
inc r1
cp r1,#07fh
jr ne, clean2
ld r1,#31h
ret
76
inc milli
cp milli,#100
jr uge, segundo
iret
segundo:
clr milli
inc seconds
iret
77
; observe_ silence:
ld r6,#>message1
ld r7,#<message1
call line1
ld r6,#>observe
ld r7,#<observe
call line2
ld 29h,#'O'
ld 2ah,#'b'
ld 2bh,#'s'
ld 2ch,#'e'
ld 2dh,#'r'
ld 2eh,#'v'
ld 2fh,#'e'
ld 30h,#' '
ld 31h,#'s'
ld 32h,#'i'
ld 33h,#'l'
ld 34h,#'e'
ld 35h,#'n'
ld 36h,#'c'
ld 37h,#'e'
loop_ msg1 :
tm p2 , # 2 0 h
jr nz, readytosendmsg1
tm p3,#01h
jr z, message_ two
jr loop_ msg1
readytosendmsg1 :
tm p2 , # 2 0 h
jr nz, readytosendmsg1
call send_ savemessage
jr loop_ msg1
message_ two:
tm p3,#01h
jr z,message_two
call erase_lahat
ld r6,#>message2
ld r7,#<message2
call line1
ld r6,#>do_not
ld r7,#<do_not
call line2
ld 29h,#' '
ld 2ah,#'D'
78
ld 2bh,#'o'
ld 2ch,#' '
ld 2dh,#'n'
ld 2eh,#'o'
ld 2fh,#'t'
ld 30h,#' '
ld 31h,#'l'
ld 32h,#'e'
ld 33h,#'a'
ld 34h,#'v'
ld 35h,#'e'
ld 36h,#' '
ld 37h,#'t'
ld 38h,#'h'
ld 39h,#'i'
ld 3ah,#'n'
ld 3bh,#'g'
ld 3ch,#'s'
ld 3dh,#' '
ld 3eh,#'u'
ld 3fh,#'n'
ld 40h,#'a'
ld 41h,#'t'
ld 42h,#'t'
ld 43h,#'e'
ld 44h,#'n'
ld 45h,#'d'
ld 46h,#'e'
ld 47h,#'d'
loop_ msg2 :
tm p2 , # 2 0 h
jr nz, readytosendmsg2
tm p3,#01h
jr z, message_ three
jr loop_ msg2
readytosendmsg2 :
tm p2 , # 2 0 h
jr nz, readytosendmsg2
call send_ savemessage
jr loop_ msg2
message_ three:
tm p3 , # 0 1 h
jr z, message_ three
call erase_ lahat
ld r6,#>message3
79
ld r7,#<message3
call line1
ld r6,#>sleeping
ld r7,#<sleeping
call line2
; sleeping:
ld 29h,#' '
ld 2ah,#'s'
ld 2bh,#'l'
ld 2ch,#'e'
ld 2dh,#'e'
ld 2eh,#'p'
ld 2fh,#'i'
ld 30h,#'n'
ld 31h,#'g'
ld 32h,#' '
ld 33h,#'a'
ld 34h,#'n'
ld 35h,#'d'
ld 36h,#' '
ld 37h,#'e'
ld 38h,#'a'
ld 39h,#'t'
ld 3ah,#'i'
ld 3bh,#'n'
ld 3ch,#'g'
ld 3dh,#' '
ld 3eh,#'a'
ld 3fh,#'r'
ld 40h,#'e'
ld 41h,#' '
ld 42h,#'n'
ld 43h,#'o'
ld 44h,#'t'
ld 45h,#' '
ld 46h,#'a'
ld 47h,#'l'
ld 46h,#'l'
ld 47h,#'o'
ld 46h,#'w'
ld 47h,#'e'
ld 46h,#'d'
loop_ msg3 :
tm p2 , # 2 0 h
jr nz, readytosendmsg3
tm p3,#01h
80
jp z, loop_ restart
jr loop_ msg3
readytosendmsg3 :
tm p2 , # 2 0 h
jr nz, readytosendmsg3
call send_ savemessage
jr loop_ msg3
message_ four:
tm p3 , # 0 1 h
jr z, message_ three
call erase_ lahat
ld r6,#>message4
ld r7,#<message4
call line1
ld r6,#>cellphone
ld r7,#<cellphone
call line2
; cellphone:
ld 29h,#' '
ld 2ah,#'c'
ld 2bh,#'e'
ld 2ch,#'l'
ld 2dh,#'l'
ld 2eh,#'p'
ld 2fh,#'h'
ld 30h,#'o'
ld 31h,#'n'
ld 32h,#'e'
ld 33h,#' '
ld 34h,#'a'
ld 35h,#'r'
ld 36h,#'e'
ld 37h,#' '
ld 38h,#'n'
ld 39h,#'o'
ld 3ah,#'t'
ld 3bh,#' '
ld 3ch,#'a'
ld 3dh,#'l'
ld 3eh,#'l'
ld 3fh,#'o'
ld 40h,#'w'
ld 41h,#'e'
ld 42h,#'d'
81
loop_ msg4 :
tm p2 , # 2 0 h
jr nz, readytosendmsg4
tm p3,#01h
jp z, loop_ restart
call erase_ lahat
jr loop_ msg4
readytosendmsg4 :
tm p2 , # 2 0 h
jr nz, readytosendmsg4
call send_ savemessage
jr loop_ msg4
send_ savemessage:
ld r1,#29h
ld r0,#'A'
call tx_ data
ld r0,#'T'
call tx_ data
ld r0,#'+'
call tx_ data
loopsend_ msg:
ld r0 , @ r1 ; transfer the content data of address to working reg r0
call tx_ data ; pulse enable
inc r1
cp r1 , # 6 ah
jr eq, return1 a ; inc address to fetch next character from ascii
jr loopsend_ msg
return1 a:
ld r0,#0h
call tx_ data
ld p0 , # 0 6 h ; this is for the alarm on state
call delay2
ld p0 , # 0 h ; alarm off state
ret
82
. ascii "-->uppercase: $"
number:
.ascii "-->num. lock: $"
message1 :
.ascii "-->message one: $"
message2 :
.ascii "-->message two: $"
message3 :
. ascii " - - > message three: $ "
observe:
. ascii " Observe Silence$ "
do_ not:
. ascii " Do not leave your things unattended$ "
sleeping:
. ascii " Sleeping and eating are not allowed$ "
cellphone:
. ascii " Cellphones are not allowed$"
.end
83
APPENDI? D
UserFs ManuaI
84
Library Noise Detector 5 ith Short Information DispIay
UserFs ManuaI
These are the proper ways in using the designed noise detector:
Make sure that the toggle switch on the noise detector is turnedFoff
press the push button beside the keypad. A stored message appears
9. If it is a user input message, enter the short information that you want to
display during the detection of the noise within the library. Enter alert
messages that can really catch the attention of the library user.
1 0 . The keypad functions like the cellular phone keypad and the tact switch
11. Set the desired level of sensitivity of the sensor by turning the knob of the
noise detector. The clockwise direction makes the noise detector turn
12.Turn on the toggle switch in the noise detector to start the communication
85
13. Leave the device on the table or in a specific place in the library then let it
until noise is detected. The chime sound will occur, the LED indicator in
the sensor blinks, and the entered short information will be displayed once
noise is sensed.
Figure 6. Pictures of the actual Library Noise Detector with Short Information
Provider
86