Joke Collection Website - Mood Talk - The teacher asked me to design and solve an anti-theft alarm system for school dormitories. Who can tell me how to do it?
The teacher asked me to design and solve an anti-theft alarm system for school dormitories. Who can tell me how to do it?
The theft of valuables in school dormitories and the fire in dormitories caused by improper operation of students are all "big problems" that have been plaguing schools. Traditional school preventive measures have great disadvantages. For example, when an accident happens, protective iron gates and iron railings will become the biggest obstacle to escape. Intelligent fire alarm system can solve this kind of problem well. However, the price of fire prevention and anti-theft system in the market is too high for major universities. The system designed by Beijing Weak Current Engineering Company is designed and manufactured from the perspective of low cost for university dormitories. System composition and working principle The system is simulated by a monitoring room and two dormitories, and communication is realized through RS485 bus. Considering that the monitoring room should be able to monitor the whole dormitory in reality, the powerful ARM7 chip LPC2 103 is used as the master chip, and the low-priced 5 1 series single chip microcomputer is used as the slave chip. In the dormitory, pyroelectric sensors are used to detect human body, smoke sensors detect fireworks, infrared sensors detect the number of people entering and leaving the dormitory, and the upper computer monitors the lower computer in real time through RS485 bus. When there is any abnormality, the alarm devices in the dormitory and the monitoring room will sound at the same time, and only the dormitory members can cancel the alarm state by entering the slave password. Hardware circuit design and related theoretical analysis The hardware of intelligent fire alarm system mainly consists of seven parts: host processor circuit, slave processor circuit, sensor detection circuit, acousto-optic alarm circuit, RS485 bus interface circuit, keyboard interface circuit and display circuit. 1. Sensor detection and acousto-optic alarm circuit The sensor module consists of pyroelectric sensor, smoke sensor MQ2 1 1 and infrared sensor. The internal resistance of smoke sensor changes with the change of smoke concentration, so it needs to be converted into a changing voltage signal, which consists of a voltage comparator LM339 and several corresponding voltage dividing resistors. The specific circuit design is shown in Figure 2. The internal resistance of the sensor is about130kΩ when energized, 6kΩ when smoky, 2.5V when smokeless, 1.2V when positively charged, 2.5V when smoky and 3 ~ 5V when positively charged. This circuit can realize level conversion well. The pyroelectric infrared sensor consists of RE200B, signal processing elements BISS000 1 and a few external elements. The infrared sensor circuit consists of an infrared light emitting diode and 1838B. The low-level sequence of two sensors is detected by single chip microcomputer to judge people's entry and exit. Its principle is shown in Figure 4. Acousto-optic alarm module consists of buzzer, (red, green) light-emitting diode and NPN transistor driving circuit. 2.RS485 communication circuit This module uses the transceiver MAX485 with low power consumption and limited slew rate for RS485 and RS422 communication. MAX485 has unlimited driving slew rate, which can achieve a transmission rate as high as 2.5 MB/s. The software part of the software programming system mainly completes the initialization of the system and each module, alarm signal detection (fire/theft), system setup, RS485 bus protocol and acousto-optic alarm programming. Communication protocol In the RS485 bus communication system, due to the influence of power supply, space noise and transmission path, data transmission is easily disturbed or signal attenuation, which leads to communication failure. Therefore, it is necessary to design a transmission protocol to ensure a reliable data connection on this unreliable physical link. In this system, the data collector and the monitoring room host are simple multipoint-to-multipoint communication. 1. Baud rate setting and communication mode selection Considering the characteristics of RS485 bus and the speed and stability of data communication, the baud rate is 2400 b/s, which can transmit a longer distance. Because communication is a many-to-one relationship, serial port chooses working mode 3. 2. Determination of data verification method When using RS485 bus communication technology to transmit data, it is easy to encounter interference, which will change the transmitted data and lead to transmission errors. Considering the actual requirements of the system, this design adopts 8-bit CRC (Cyclic Redundancy Check) check mode. The calculation of CRC checksum is a cyclic calculation. From a mathematical point of view, CRC checksum is to divide a polynomial (represented by data blocks) by generating polynomial (algorithm rules), and CRC checksum is the remainder after division. CRC check is to attach some parity bits to the data block to be transmitted. These parity bits (CRC parity bits) are calculated from the data block and transmitted together with the data block. At the receiving end, the CRC checksum of the received data block is recalculated according to the specified algorithm, so as to judge whether there is an error in the data transmission process. 3. Coding of communication data In order to ensure the reliability and accuracy of data transmission, the data frame format adopted in this design is shown in table 1. Among them, the first two bytes are the initial synchronization signal, and the address code occupies 1 byte (0 ~ 255) to mark different bed numbers; The data to be sent include: smoke sensor signal (1B), infrared sensor signal (1B), pyroelectric sensor signal (1B) and acquisition time (7b); The check code is an 8-bit CRC check code. The transmission sequence is: smoke sensor signal, infrared sensor signal, pyroelectric sensor signal (high before and low after) and acquisition time (in turn: seconds, minutes, hours, days, months and years); When sending the reply command, the data to be sent is 0xCC or 0xBB of 2B. 4.RS485 communication protocol The RS485 bus communication of this system adopts polling mode. sps.net/news.php? Id = 50 The host sends the addresses of all slaves to the RS485 bus and asks each slave in turn to see if there is an alarm in the slave part. If the slave has an alarm, it will send an instruction report to the host through RS485 bus, then the host communicates with the slave, the slave sends a data packet, and the host accepts and analyzes the data packet and makes corresponding processing. The master device will constantly query the status of each slave device to realize real-time monitoring. The system test and result analysis show that the performance of the sensor is stable, the detection distance of pyroelectric sensor can reach 5 ~ 8 m, and the smoke sensor can achieve fire prevention function well. The infrared sensor is very sensitive and can effectively detect people's entry and exit; RS485 bus can well realize the communication between master and slave and realize real-time monitoring. Each module can be well linked together with high stability. After many debugging, the system meets the design requirements. The overall effect is satisfactory. The intelligent fire alarm system for dormitory provides a feasible method for dormitory safety. The system adopts multi-sensor detection, automatically realizes external help through RS485 bus, and has the characteristics of intelligence and automation. The system has a broad application prospect. For the increasing security requirements, in the further improvement of the future system, a microprocessor can be added to the detector for real-time monitoring. It is of great significance to the safe construction of student dormitories.
- Previous article:How to learn to show yourself?
- Next article:Living in the city, how can we have a quality weekend?
- Related articles
- A word to your own mood. Since you are alive, live well and live for yourself every minute.
- The sunset, the autumn mood is strong, what is the next sentence?
- A good sentence from a friend on New Year's Eve.
- Love my choice, the Great Wall Gun shows a new look and talks about feelings.
- Is the wind from the west delicious?
- Why do you feel guilty about spending your husband's money?
- The funniest joke in history
- How much is the ticket for Suzhou Lingering Garden?
- What are the more popular places to enjoy and shoot flowers around Sichuan?
- Classic phrases for understanding life through WeChat