Nowadays, in school dormitories, accidents such as theft of students' valuables and fires caused by students' negligence often occur. These are "big problems" that have always troubled students, student workers and school security departments. Traditional preventive measures have great drawbacks. For example, when an accident occurs, protective iron doors and iron railings will become the biggest obstacle for the owner to escape. The use of intelligent fire and theft alarm system can solve such problems well. However, the price of fire and theft alarm systems on the market is too high for college students. This system is designed and manufactured for university dormitories from a low-cost perspective.
1 System composition and working principle
This system is simulated by a monitoring room and two dormitories, and communication is achieved through the RS 485 bus. Considering that the monitoring room should be able to monitor the entire dormitory building in reality, the powerful ARM7 chip LPC2103 is used as the host control chip, and the slave uses the low-cost 51 series microcontroller as the control chip. The dormitory uses pyroelectric sensors to detect human bodies, smoke sensors to detect fireworks, and infrared sensors to detect the number of people entering and leaving the dormitory. The host monitors the slave in real time through the RS 485 bus. When an abnormality occurs, the alarm devices in the dormitory and the monitoring room will sound at the same time. Only the members of the dormitory can remove the alarm state by entering the password of the slave in the dormitory. The detailed structure diagram of the system is shown in Figure 1.
2 Hardware circuit design and related theoretical analysis
The hardware of the fire and theft prevention intelligent alarm system is mainly composed of seven parts: the host part processor circuit, the slave part processor circuit, the sensor detection circuit part, the sound and light alarm circuit, the RS 485 bus interface circuit, the keyboard interface circuit and the display circuit.
2.1 Sensor detection and sound and light alarm circuit
The sensor module consists of a pyroelectric sensor, a smoke sensor MQ211 and an infrared sensor.
The internal resistance of the smoke sensor changes with the concentration of smoke, so it needs to be converted into a changing voltage signal. Here, it is composed 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 about 130 kΩ when it is powered on. When the smoke is thick, the internal resistance is about 6 kΩ. When there is no smoke, the negative input of the comparator is about 2.5 V and the positive input is about 1.2 V. When there is smoke, the negative input is 2.5 V and the positive input is 3 to 5 V. This circuit can achieve level conversion very well. The pyroelectric infrared sensor is composed of RE200B, signal processing component BISS0001 and a small number of external components. The circuit is shown in Figure 3.
The infrared sensor circuit is composed of an infrared emitting diode and 1838B. The microcontroller is used to detect the order of the low levels of the two sensors to determine the entry and exit of people. The principle is shown in Figure 4. The sound and light alarm module is composed of a buzzer, (red, green) light-emitting diodes and an NPN transistor drive circuit. The specific circuit diagram is shown in Figure 5. [page]
2.2 RS 485 communication circuit
This module uses the MAX485, a low-power, slew-rate limited transceiver for RS 485 and RS 422 communications. The MAX485's driver slew rate is not limited, and a maximum transfer rate of 2.5 Mb/s can be achieved.
3 Software Programming
The software part of the system mainly completes the initialization of the system and each module, the detection of alarm signals (fire alarm/theft alarm), system settings, RS 485 bus protocol and the programming of sound and light alarm. The specific program flow chart is shown in Figure 6 and Figure 7.
4 Communication Protocol
In the RS 485 bus communication system, due to the influence of factors such as power supply, spatial noise and transmission path, the data transmission process is easily disturbed or signal attenuated, resulting in 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 host in the monitoring room are a simple multi-point to point communication.
4.1 Baud rate setting and communication method selection
Considering the characteristics of RS 485 bus and the speed and stability of data communication, the baud rate is 2 400 b/s, which can transmit data over a longer distance. Since the communication is a many-to-one relationship, the serial port selects working mode 3.
4.2 Determination of data verification method
When using RS 485 bus communication technology to transmit data, it is easy to encounter interference, which will change the transmitted data and cause transmission errors. Considering the actual requirements of the system, this design adopts an 8-bit CRC (cyclic redundancy check) check method.
The calculation of CRC checksum is a cyclic calculation. From a mathematical point of view, CRC checksum is the remainder obtained by dividing a polynomial (represented by a data block) by a generating polynomial (algorithm rules). CRC checksum is to add some check bits to a data block to be transmitted. These check bits (CRC check bits) are calculated from the data block and transmitted together with the data block. At the receiving end, the CRC checksum is recalculated for the received data block according to the specified algorithm, so as to determine whether there is an error in the data transmission process.
4.3 Communication Data Encoding
To ensure the reliability and accuracy of data transmission, the data frame format used in this design is shown in Table 1. Among them, the first two bytes are the starting synchronization signal, the address code occupies 1 byte (0-255), which is used to mark different bed numbers; the data to be sent includes: smoke sensor signal (1 B), infrared sensor signal (1 B), pyroelectric sensor signal (1 B) and acquisition time (7 B); the check code is an 8-bit CRC check code. The transmission order is: smoke sensor signal, infrared sensor signal, pyroelectric sensor signal (high bit first, low bit last), acquisition time (in order: seconds, minutes, hours, days, months, years); when sending a response command, the data to be sent is 2 B of 0xCC or 0xBB.
4.4 RS 485 communication protocol
The RS 485 bus communication of this system adopts the polling method. The host sends the address of each slave to the RS 485 bus, and inquires each slave in turn to see if there is an alarm in the slave part. If a slave has an alarm, it will send a command report to the host through the RS 485 bus, and then the host and the slave communicate, the slave sends a data packet, the host receives and parses the data packet, and makes corresponding processing. The host will continuously query the status of each slave to achieve real-time monitoring.
5 System Testing and Result Analysis
After testing, the system has stable sensor performance. The detection distance of the pyroelectric sensor can reach 5 to 8 meters. The smoke sensor can well realize the fire prevention function. The infrared sensor is very sensitive and can effectively detect the entry and exit of personnel. The RS 485 bus can well realize the communication between the host and the slave, and achieve real-time monitoring. The various modules can be well linked together and have high stability. After many debugging, the system has achieved the design requirements. The overall effect is satisfactory.
6 Conclusion
The dormitory intelligent fire and burglar alarm system described in this paper provides a feasible way for dormitory security. The system uses multi-sensor detection and automatically realizes external help through the RS 485 bus. It has the characteristics of intelligence and automation. The system has a relatively broad application prospect. For the increasingly high security requirements, in the future further improvement of the system, real-time monitoring can be carried out by adding a microprocessor to the detector. It is of great significance to the safety construction of college dormitories.
Previous article:Design of LCD driver terminal based on ARM9
Next article:Design of power distribution control module based on LPC2119
Recommended ReadingLatest update time:2024-11-24 17:55
- Popular Resources
- Popular amplifiers
- Practical Deep Neural Networks on Mobile Platforms: Principles, Architecture, and Optimization
- ARM Embedded System Principles and Applications (Wang Xiaofeng)
- ARM Cortex-M4+Wi-Fi MCU Application Guide (Embedded Technology and Application Series) (Guo Shujun)
- An ARM7-based automotive gateway solution
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- The power supply is hardware, please read the Huawei Hardware Engineer Manual
- EEWORLD University ---- Basics of Power Electronics Magnetic Technology
- Introduction to PID Control Algorithm and Strategy
- Application of TI PD solutions in the security market
- Regarding the buzzing music playback of the 51 microcontroller, let’s find out what the problem is.
- Qualcomm adds power management chips to cover all market segments
- DSP28335 Peripheral Clock
- Please explain the role of the window comparator here
- EEWORLD University Hall----Live Replay: TI MSP430 low-power analog peripherals help home portable healthcare products
- TI linear chargers & portable medical devices, jointly opening a new era in the medical field!