Intercoms and calling bells fit properly only in the luxurious hotels, lodges and high class buildings. In small vicinity like small hotels, offices and clinics, these are not the correct options to choose for communication between the working/assisting staffs and people. It is all because of the cost and the fact that this provision can be made for limited number of points. Here’s a simple and economical room-monitoring system that provides audio-visual identification of the call point. In addition to this, the system also provides feedback to the caller (in the form of busy signal). Using minimal hardware and software, this project offers a clean and easy way to communicate.
Circuit Description of Monitoring System using At89c51
From the circuit diagram, it is clear that the heart of the circuit is microcontroller IC AT89C51 (IC1) which is usually the common component when we talk about the microcontroller based projects. In this particular project, two ports: 0 and 2 of the microcontroller are used in output mode for the seven-segment display and LEDs. In a similar way, port 1 is set in input mode so as to receive input signals from the switches. The overall configuration is depicted clearly in the figure below.
Seven-segment display, switches, few LEDs, piezo-buzzer and passive components are the key elements of this circuit along with the IC. Once the connection is set up, the circuit is ready for installment. On doing so, one must fix the switches and their respective LEDs in eight different rooms enabling the person to make a request when the system is not busy responding to another request. And, the remaining circuit is set up in the control room where the request are received and responded. Pull-up resistors R1-R8 are connected across the switches and current-limiting resistors R10-R17 are fixed next to corresponding LEDs to protect circuit components from electrical hazards. Few more components are connected to the microcontroller pins 9,19 18 and 31 for reset and clocking purpose as shown in the circuit diagram.
Once an individual presses the switch, the call-point number corresponding to that switch is displayed on the seven-segment display DIS1 (LTS542) which is configured in common-anode mode since this display is interfaced to the port 0 of the microcontroller. And, then the piezo-buzzer connected to the port pin 0.0 sounds indicating that a request is being made.
The display and buzzer keep on displaying and sounding for certain interval as programmed in the IC. In order to avoid system failure during this particular interval when the system is busy responding to one request and if one or more request is being made, all the eight LEDs are left blinking to indicate the situation. Hence, an individual gets notified and waits until the LED stops blinking. Now, when the blinking stops, any person can ask for help with the controller and press the switch. When the controller responds to the request, the blinking process continues to avoid system interruption.
The software section of this project is simplified with the use of assembly language in programming the microcontroller (source code is attached at the end). As a result, more people can understand and implement the project. The source code for programming is attached at the end along with a table which constitutes of codes to generate seven-segment display and corresponding RAM locations of microcontroller to store the codes.
PARTS LIST OF MONITORING SYSTEM USING AT89C51 MICROCONTROLLR
|Resistor (all ¼-watt, ± 5% Carbon)|
|R1 – R8, R9 = 10KΩ|
R10 – R17 = 470 Ω
R18 = 150 Ω
|C1 = 10µF/16V|
C2, C3 = 33 pF
|IC1 = AT89C51|
LED1 – LED8 = Red LED
DIS1 = LT542 Common Anode Display
|SW1 – SW8 = Push-to-on Switch|
XTAL1 = 11.0592 MHz Cristal
PZ1 = Piezo-buzzer
Talking about the software design section, it is much simpler since the entire program can be coded using any text editor applications. However, it needs to be saved as ‘MS.ASM’ file. To work with the project, we should generate the HEX file; MS.HEX with the help of ASM51.EXE assembler.
Foe simplicity, the steps are summarized below:-
- Using AT and C51 programmer, program the microcontroller with the MS.HEX file generated.
- Once programming is successful, extract the microcontroller carefully from the programmer kit and fix it on the IC base of the circuit PCB.
- When above steps are implemented, assemble and solder the entire circuit components on the PCB and connect a 5 VDC external power supply to start circuit operation.
- On pressing a switch, the respective call-point number is displayed on the display and all LEDs start blinking, also the buzzer starts sounding for the time interval as programmed.
- If the project doesn’t work as prescribed in steps above, then check all the connections and verify the program and repeat the steps again. And, if it works properly, install the circuit. The eight switches and respective LEDs are fixed at different call points where required. Similarly, the remaining circuit with seven-segment display and buzzer must be placed in the control room. Codes for Display Generation Along with RAM Location for Their Storage
|LT542 pin no.||10||9||1||2||4||6||7||Buzzer|
|0000 1 ORG 00H ;locate reset routine at 00H|
0000 0143 2 AJMP START ;jump START of main program
0003 3 ORG 03H ;locate interrupt 0
0003 32 4 RETI ;returns from external interrupt 0
000B 5 ORG 0BH ;locate timer interrupt 0000B 32 6 RETI ;returns from timer 0 interrupt 0
0013 7 ORG 13H ;locate interrupt 1
0013 32 8 RETI ;returns from external interrupt 1
001B 9 ORG 1BH ;locate timer 1 interrupt
001B 32 10 RETI ;returns from timer 1 interrupt
0023 11 ORG 23H ;locate serial port interrupt
0023 32 12 RETI ;returns from serial port interrupt
0025 13 ORG 25H ;locate beginning of delay program
0025 14 DELAYMS:
0025 7F00 15 MOV R7,#00H ;delay of millisecond
0027 16 LOOPA:
0027 OF 17 INC R7 ;incremrnt R7 by one
0028 EF 18 MOV A,R7 ;store R7 value to accumulator (A)
0029 B4FFFB 19 CJNE A,#0FFH,LOOPA
002C 22 20 RET
002D 21 DELAYHS:
002D 7E00 22 MOV R6,#00H ;hafl second delay
002F 7D08 23 MOV R5,#008H;initialize R5
0031 24 LOOPB:
0031 0E 25 INC R6 ;to call milliseconds delay
0032 1125 26 ACALL DELAYMS ;call ms delay routine above
0034 EE 27 MOV A,R6 ;store R6 value to A
0035 70FA 28 JNZ LOOPB ;go to LOOPB unless R6=OO
0037 E5A0 29 MOV A,0A0H ;store port-2 value to A
0039 F4 30 CPL A ;complement A and output A to port 2 to
003A F5A0 31 MOV 0A0H,A ;blinks all port LEDs003C 7400 32 MOV A,#00H ;intialize A
003E 1D 33 DEC R5 ;decrement R5
003F ED 34 MOV A,R5 ;move R5 value to A
0040 70EF 35 JNZ LOOPB ;if A is not 0 then go to LOOPB
0042 22 36 RET ;delay routine eight times
0043 37 START:
0043 756100 38 MOV 61H,#00H ;store 1st code at 61H
0046 7562B0 39 MOV 62H,#0B0H ;store 2nd code at 62H
0049 756304 40 MOV 63H,#04H ;store 3rd code to 63H
004C 756424 41 MOV 64H,#24H ;store 4th code to 64H
004F 756532 42 MOV 65H,#32H ;store 5th code to 65H
0052 756660 43 MOV 66H,#60H ;store 6th code to 66H
0055 756748 44 MOV 67H,#48H ;store 7th code to 67H
0058 7568F2 45 MOV 68H,#0F2H ;store 8th code to 68H
005B 46 LOOP:
005B E590 47 MOV A,90H ;continuously read the inputs
005D B4FF02 48 CJNE A,#0FFH,L1 ;detect any switch press
0060 015B 49 AJMP LOOP ;again jump to LOOP to read port-1
0062 50 L1:
0062 7C00 51 MOV R4,#00H ;scan for any switch is pressed
0064 52 L2:
0064 D3 53 SETB C ;loop L2 unless carry=0 detected
0065 33 54 RLC A ;rotate A with carry flag
0066 0C 55 INC R4 ;increment R4, each time loop L2 is run
0067 40FB 56 JC L2
0069 EC 57 MOV A,R4 ;R4 value for switch number