Embodiment
A kind of intelligent alarm main frame as shown in Figure 1, comprises the single-chip microcomputer local circuit, and the used single-chip microcomputer of single-chip microcomputer local circuit is a 89C2051 type single-chip microcomputer, and this type single-chip microcomputer cost is very cheap, perfect in shape and function.Connecting digital display circuit, external panalarm circuit, signal deteching circuit, number storage circuit and keyboard circuit on the signal input part of this single-chip microcomputer local circuit respectively, producing transtation mission circuit by dtmf on the signal output part of this single-chip microcomputer local circuit and link to each other with the dislodging machine circuit.Digital display circuit is in order to show corresponding data.External panalarm circuit is in order to connect panalarms such as electric bell, audible-visual annunciator.Signal deteching circuit is in order to connect probes such as door status switch or temperature control, light-operated, acoustic control sensor.The number storage circuit is in order to storing telephone number.Keyboard circuit carries out man-machine conversation in order to single-chip microcomputer input control data.So just need not to have dialled, be particularly suitable in the warehouse etc. not having the place of phone to import man-machine conversation operations such as telephone number by answering the call outward.It is the dual-tone multifrequency circuit that dtmf produces transtation mission circuit, transmits through telephone wire in order to produce sound signal.The dislodging machine circuit is in order to the audio transmission signal in the connection or the line of hanging up the telephone.
As shown in Figure 2, single-chip microcomputer local circuit 1 used single-chip microcomputer is a 89C2051 type single-chip microcomputer.L3, L4 are the input end of telephone wire in the dislodging machine circuit 2, and ZY is a voltage dependent resistor (VDR), prevent the high voltage damaged circuit that thunder and lightning produces.B2 is a polar protective circuit, guarantees that L3, L4 telephone line are fashionable, are output as a positive end and remain unchanged.The f end links to each other with the P3.7 end of single-chip microcomputer, in the time will connecting with telephone wire, sends high level by single-chip microcomputer P3.7 end, base resistance R4 by Q2 produces base current, makes the Q2 conducting, and the base stage of Q1 produces base current by R2, R3, make also conducting of Q1, thereby make the R6 place in circuit.R6 is the pull-up resistor of telephone line, and effect is the connection that keeps telephone line.In the communication of China regulation, the pull-up resistor behind the closing of the circuit must not be greater than 300 ohm, and herein, it is 300 ohm resistance that R6 has selected nominal value for use.
The model that dtmf produces IC2 in the transtation mission circuit 3 is HT9200A (a double-tone multi-frequency coding chip), can be connected with various types of microprocessors easily, can produce 16 times and 8 times of tone signals by software programming, and by the output of DTMF pin.HT9200A is the work in series mode.The CE of HT9200A, DATA, CLK end link to each other with P1.2, P1.1, the P1.0 port of single-chip microcomputer respectively, and R9, R10 are pull-up resistor.M2 and C6, C7 form crystal oscillating circuit.The sound signal that produces is sent into telephone wire from the output of 7 pin dtmf end through the amplifying circuit that R8, Q3, C5, R7 form.
Because the port of 89C2051 type single-chip microcomputer is less, have only 20 pin, use the method for traditional matrix keyboard input to take very much port resource, so keyboard circuit 4 has used the method for making contact to realize, method than the matrix keyboard input is saved the one-chip machine port resource, and principle is earlier the P1 mouth to be put one, then zero setting scanning by turn, when the input port has two to be zero, then be judged as key and pressed.When judging that singly-bound is pressed, during as SET OK key, earlier the P1 mouth is put one, judge by turn then to get final product.Keyboard is used for carrying out the operation of function conversion of alarm and the input and the modification of telephone number.
Digital display circuit 5 is made up of a LED seven segment numerical display tube IC3,74LS164 chip and R11-R17 current-limiting resistance.The P3.0 of 74LS164 and single-chip microcomputer, P3.1 are under the single-chip microcomputer serial communication working method, and external shift register belongs to serial input/and line output.The A of 74LS164, B end links to each other, and is connected with the P3.0 of single-chip microcomputer, and CP signal controlling end is connected with the P3.1 of single-chip microcomputer, RS termination power high level.When CP signal rising edge arrives, one of AB end data input, and move to right.The Q0-Q7 end is parallel output terminal, and it is luminous to drive charactron, video data.Microcontroller serial port is operated in mode 0.
External panalarm circuit 6 is made up of+5V relay K, diode VD2, triode Q4 and R22, SB2.R22 is ended by the conducting of single-chip microcomputer P3.2 mouth control Q4 after the SB2 closure, thus pilot relay contact break-make.Relay normally open contact K1 in the external panalarm circuit is connecting electric bell tab terminal DIP2, can be used to connect external alert equipment, and as electric bell etc., the time spent can not disconnect SB2 and do not select for use.
Signal deteching circuit 7 has adopted the two-in-one light lotus root of TLP521-1.A1, the b1 of G1 part connect the door status switch of tongue tube open type or other normally opened contact, 2 points are connected in closed back, make the triode conducting on its right, R24 produces the light emitting diode conducting that voltage makes G2, trigger the triode conducting on G2 the right, the P31 port of single-chip microcomputer is input as low level, and single-chip microcomputer start to interrupt is reported to the police, and R12, R11 are used for the interference of filtering clutter to signal.The a of G2, b, c place connect probe sensor, and a, c two places provide power supply, and b is the input end of detectable signal.After probe detects signal, voltage signal is added on the b, it is luminous by diode the diode portion of G2 to be divided, the triode conducting on the right, the P31 port of single-chip microcomputer is input as low level, and single-chip microcomputer starts interruption and reports to the police.The effect of diode VD3 and VD4 is in order to prevent that two testing circuits from interacting in the circuit, and the transistor collector of the port of single-chip microcomputer P31 connects+5V voltage, is in order to protect one-chip machine port.Equally, with the separately design of two testing circuits, also be for this consideration.Simultaneously, two light lotus roots connect in this way, logically are equivalent to the function of disjunction gate, and when two-way used simultaneously, no matter there was detection signal on that road, can both send single-chip microcomputer to and report to the police.
Number storage circuit 8 has used IC4AT20C01, E2PROM serial programmable storer, and capacity is 128 * 8K, and the data outage does not disappear, data can be erasable repeatedly, have page or leaf and write function, native system is because allow to deposit in 3 telephone numbers during design, so capacity is enough.A0, A1, A2 are the address of devices selection wire, and SDA is a serial data line, and SCL is a serial time clock line, and WP is the write-protect end.A0, A1, A2 ground connection among the figure, promptly the pin address of AT24C01 is 000.WP holds ground connection, can carry out read/write operation to it, and SCL, SDA are connected with P3.4, the P3.5 of single-chip microcomputer respectively.
Single-chip microcomputer and reset circuit 9 and crystal oscillating circuit 10 have been formed the operating circuit of this machine, and what M1 selected for use is the crystal oscillator of 6MHz, and the SB1 among Fig. 9 is the hand-reset key.
During use, probe is connected, operates then:
1: the number input operation: press No. 4 keys of lower keyboard, charactron can demonstrate numeral " 4 ", press the OK key, the numeral that charactron can demonstrate " " is glimmered, and expression can have been carried out the input operation of first number.Power on by lower keyboard successively and talk about the numerical key of number correspondence, press the OK key then, system automatically returns to original state, and first telephone number storage finishes.And then press key No. 5, and charactron can demonstrate numeral " 5 ", press the OK key, the numeral that charactron can demonstrate " two " is glimmered, and expression can be carried out the input operation of second number.Power on by lower keyboard successively and talk about the numerical key of number correspondence, press the OK key then, system automatically returns to original state, and second telephone number storage finishes.Press key again No. 6, charactron can demonstrate numeral " 6 ", press the OK key, the numeral that charactron can demonstrate " three " is glimmered, and operation is the same, after having imported, automatically returns to original state.
2: the setting of the back time departure of deploying troops on garrison duty
Alarm is reported to the police after should allowing owner leave before work again, therefore, a delay time be arranged.Establishing method is to press key No. 2, presses the OK key, and charactron shows that time initial direction is the appearance that are rotated counterclockwise 90 degree (charactrons can't upright demonstration tee), glimmers.Press the 0-9 any key, the setting duration of time is the digital X5 second that sets, and such as pressing key No. 4, the time is 4X5=20 second just so, press the OK key after, return original state automatically.
3: the setting of delayed alarm time
The setting of delayed alarm time is for after going home owner, gives owner to cancel the time of warning, can set up on their own as required, press key No. 3, charactron has demonstration, glimmer and to distinguish direction mutually opposite for time departure, establishing method is with the setting of time departure.
4: enter the monitoring, alarming state
Press key No. 1, charactron can demonstrate numeral " 1 ", press the OK key, charactron demonstration " A " (abbreviation of ALARM) glimmered.
When system detects alert, after time-delay, single-chip microcomputer promptly begins to control HT9200A dialing (if be circumscribed with equipment such as siren then connect earlier and report to the police), behind closing of the circuit, make HT9200A produce low-frequency audio frequency by software again and send into telephone wire, after answering be " too ... " chimes of doom, do not need to join in addition again the voice device.Time of fire alarming approximately continues 50-60 second, dials latter two telephone number then automatically, and situation is dialed 3 times repeatedly with for the first time.Cancel when deploying troops on garrison duty, as long as close swap switch.When using later on, after powering on, directly enter, do not need to be provided with again any parameter by No. 1 key.