Sie sind auf Seite 1von 7

Title: Clap counting and switching appliance

Pre-requisites:
-Knowledge of 8051uC
-Knowledge of LCD interfacing.
-Programming of 8051 in assembly language using interrupt.

Problem Statement:
To design an electronic circuit using 8051uC for switching the
appliance with a clap and counting respective claps.

Software used:Keil uvision 3,Proteus Software

Block Diagram:



Block diagram Explanation: The block diagram is as shown
above.The microphone (sensor) is interfaced with 8051uC

I nput
(sensor)
8051 uC
LCD
Display
through a transistorized amplifier since the o/p of sensor is very
small.It requires amplification.The second block is uC.The third
block is the LCD panel display.
Theory:
1.Clap counting and switching is a reliable circuit which counts the clap
and counting respective appliance.
2.When anyone claps, the microphone senses the clap and gives the o/p
in mV.
3.The o/p voltage is then amplified by the special circuit for
amplification. The BC547 and BC 548 are used for amplification.
4.The amplified voltage is given as an interrupt to uC.
5.As soon as the interrupt receives the IE1 flag is raised which switches
the light(appliance).
6.With the switching process uC also displays the number of clap counts.

Circuit components:
1)Microphone element:
It is a simple,cheap microphone which gives the o/p in mV.
Such microphones are widely used in small circuits(application).It is a
condenser microphone which is used to sense the sound of clap.
The switching circuit is made from transistor is employed after
amplifier and its purpose is to convert analog signal to digital discrete
signal.Which is i/p MCU.
Switching ckt is used as high TTL logic is not received at
microphone
Due to noise signal.
Algorithm:
main:
1)Start
2)Set IT1 for edge trigger.
3)Ennable external interrupt 1 (IE-84H)
4)Wait for interrupt on step 4.
5)Jump to location 0013H on step 4.
6)Stop.

serial:
1)START
2)Complement the port P2.3
3)Increment register R3.
4)Compare R3 with 99H jump to main
5)Call function Fun to initialise LCD.
6)Call function BCDA to convert Hex to ASCII value and display
repective
Count.
7)STOP

Fun:
1)START
2)Move value 38H to accumulator and call the command to command
LCD.
3)Move 0EH to accumulator and process it as a command to LCD.
4)Move 01H, 00H, 87H to accumulator and give it to LCD as command.
BCDA: (Hex to ASCII)
1)START
2)Move reg. R3 value to accumulator.
3)Move the accumulator to B.
4)Swap accumulator.
5)And the accumulator value to 0FH.
6)Add the accumulator with 30H.
7)Adjust the decimal.
8)Call it for display.
9)Move the value from B to accumulator.
10)And the accumulator with 0FH.
11)Add the accumulator with 30H and adjust the decimal.
12)Compare accumulator with 39H and if equal display the same and
06H to it.
13)Then jump to last step if not equal jump to step 13.
14)Call display function.
15)Stop.
Flowchart:







No(IE1=0)

Yes (IE1=1)







Initialize LCD


START
Load TCON with 04H
Load IE with 84H
CLR A
Check
IE=1?
Call serial
CPL P2
INC R3
Call RUN
Call BCDA
RET



Display:
















Load R2 to A
Load A to B
Swap the content of A
AND [A] with 0FH
Add A to 30H
Load value of B to A
AND [A] with 0FH
If
A=39H?
Add [A] with 30H
Start
Yes

No

Conclusion:
1) We have limit the clap counting and clap switching circuit using
uC.
2) We also saw the o/p on the simulator software.
3) We learn the working of condenser microphones amplifying circuit
and switching transistor.


References:
The 8051 uC and embedded system
-M. A. Mazidi
-J. Z. Mazidi.



Display A
Display A
RET
Add 06H to A
Move value of A to R3

Das könnte Ihnen auch gefallen