Design of multi-channel fire hydrant waterless monitoring system based on nRF401 chip

Publisher:暗里著迷Latest update time:2009-12-25 Source: 现代电子技术Keywords:nRF401 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
The fire water supply system is an important fire control equipment. Whether it can function normally is related to the safety of people's lives and property. However, in actual applications, fire hydrants are often covered and the water pressure is low. What is more serious is that the fire hydrants are out of water due to misoperation of valves or leakage of pipes. Once a fire occurs, there is no water when the fire hydrant tap is opened. Firefighters and the public cannot put out the fire in time, which will escalate the severity of the fire and cause significant losses of life and property. To this end, it is necessary not only to build a complete fire water supply system, but more importantly to ensure the normal operation of the system and a normal water supply pressure. In response to this situation, this article designs and introduces a detection system for whether the water pressure of the fire water supply system is normal, which is used to detect whether the water pressure of the fire water supply system is normal, and give a display and alarm.

1 System composition

The system consists of three parts: microcomputer, communication processing module, and single-chip fire hydrant information acquisition module. The composition of the system is shown in Figure 1.

The host computer is composed of a PC and is located at the top of the entire system. It is mainly responsible for controlling and managing all communications in the entire system and processing the data collected from each module.

The communication processing module is composed of a W77E58 single chip controller. On the one hand, it communicates with the host computer through the RS 232 interface bus; on the other hand, it communicates with the fire hydrant information acquisition module using the wireless communication chip nRF401.

The single-chip fire hydrant information acquisition module uses the single-chip microcomputer AT89S51 to realize the collection of fire hydrant information and the control of the transceiver function of the wireless communication chip nRF401.

2 System Hardware Design

2.1 Communication processing module

The communication processing module circuit is shown in Figure 2. Since this module uses two serial ports to communicate with the upper and lower layers respectively, the main controller uses Winbond's W77E58 microcontroller.

The W77E58 microcontroller contains two enhanced serial ports and a 32 KB large-capacity FLASH memory. The instruction set is fully compatible with the 51 series microcontrollers and is very suitable for use in intelligent monitoring systems. The connection of the W77E58 is very convenient. The external components required by the circuit are only a crystal oscillator plus two capacitors to drive the on-chip oscillator, a resistor and a capacitor connected to the reset pin. Using the on-chip power-on reset circuit, XTAL1 and XTAL2 are the reference oscillator terminals, and the crystal oscillator frequency is 11.059 MHz. Among them, serial port 0 is connected to the PC through the RS 232 bus interface, and serial port 1 is responsible for connecting the wireless communication chip nRF401. The W77E58 has a watchdog timer, which is a timer that runs independently of the CPU. The system can set it as a system monitor, a time base generator or an event timer through programming. Because the signal level of the microcontroller conforms to the TTL/CMOS standard, the typical RS 232 signal of the PC serial port swings between positive and negative levels, so the MAX202 chip is needed to achieve level conversion.

The nRF401 wireless communication chip is produced by Nordic. The chip uses the 433 MHz IGM frequency band and integrates high-frequency transmission, high-frequency reception, PLL synthesis, FSK modulation, FSK demodulation, multi-channel switching and other functions. It has the characteristics of excellent performance, low power consumption and easy use. Through its external pins, the chip can be switched between the transmission mode and the reception mode at any time without any initialization settings. The nRF401 communicates directly with the MCU through the microcontroller serial port, without the need for Manchester encoding of the data.

In the interface between nRF401 and W77E58 microcontroller. The working mode of nRF401 circuit is controlled by 19-pin TXEN. When 19-pin is high, data is sent and when it is low, data is received. When sending, the binary serial data transmitted from the microcontroller serial port TXD (P1.3) to the 9-pin DIN port of nRF401 is modulated and transmitted through the antenna; when receiving, the signal is received from the antenna and converted into a binary serial number, and then transmitted to the microcontroller serial port RXD (P1.2) through 10-pin DOUT. The chip works in the 433.92 MHz frequency band when CS=0 on pin 12 and the 434.33 MHz frequency band when CS=1. The 18-pin PWR_UP low power control is in the working state when it is high; it is in the standby state when it is low.

2.2 Single chip fire hydrant information acquisition module

The fire hydrant information acquisition module is shown in Figure 3. It needs to complete two aspects of work. On the one hand, it reads the fire hydrant information of the external device through the I/O interface, and on the other hand, it responds to the query request sent by the host computer through the wireless communication chip nRF401 and sends back the current fire hydrant information. The fire hydrant information acquisition module consists of the slave control AT89S51 microcontroller, the water pressure acquisition part, the A/D conversion circuit, the wireless transceiver circuit, etc.

The water pressure acquisition and conversion part converts the pressure signal into a digital signal that can be processed by the single-chip microcomputer. It consists of a CYG1512 sensor and an analog-to-digital converter ADC0832. The pressure sensitive element of CYG512 is designed and manufactured using the most advanced MEMS technology of the time. The three-dimensional integrated, double-sided processed silicon piezoresistive pressure sensitive element has excellent linear accuracy. The high consistency of the Wheatstone strain bridge made by ion implantation and fine photolithography technology makes it have a very small temperature drift. The use of silicon-silicon direct bonding technology makes the silicon film force-sensitive structure have high sensitivity, excellent stability, excellent dynamic performance and ultra-thin thickness. The total thickness of its combined force-sensitive structure and substrate reinforcement structure is only 0.6 mm, which is more conducive to obtaining a thinner final size thin sensor. The CYG1512 sensor is a CYG512 series product and a signal amplification and conditioning part that are separated and installed in a small instrument box connected to the wire. It can provide an output of 0~5 V and is convenient for interfacing with ADC0832. The standard measuring ranges of CYG512 are 100 kPa, 160 kPa, 250 kPa, 400 kPa, 600 kPa, 1 000 kPa, 1 600 kPa, 2 500 kPa, and 4 000 kPa.

ADC0832 is an 8-bit successive approximation analog-to-digital converter with serial input and output, and its conversion time is 80μs. Its two analog input channels are programmable, and the channels can be specified by the 3-bit control word of the serial input port DI. The CYG1512 sensor provides the pressure signal to ADC0832 in the form of a voltage signal. Select CH1 of ADC0832 as the single-ended input working mode, and CHO as not working. Therefore, the control word input from the DI end is "111", and DI can be fixed to a high level. When the P1.2 port of the microcontroller sets the CS pin of ADC0832 to a low level, the first 3 pulses of CLK rise and input the control word "111" from the DI end, and the next 8 pulses complete the conversion process, and the converted 8-bit data is read into the microcontroller from the P1.0 port.

The status indicator is a light emitting diode, which indicates the working status of the system. When the light emitting diode is off, it means that the water pressure in the water pipe is normal. When the light emitting diode is on, it means that there is no water in the water pipe. When the diode flashes, it means that the water pressure in the water pipe is low.

3 System software design

The software design of the system mainly consists of two parts: the communication processing module and the fire hydrant information collection module.

The software design of the communication processing module mainly includes the program initialization part, the RS 232 communication part and the wireless communication part. Serial port initialization. The serial port O of W77E58 works in working mode 1 and communicates with the PC through RS 232. Serial port 1 works in working mode 1 to control the communication of nRF401. Both serial ports use timer 1 to control the communication baud rate, and the baud rate is set to 9600 b/s.

Due to the particularity of wireless communication, external interference makes the bit error rate high. Therefore, the software design must first ensure that it can identify noise and valid data, and the design of the communication protocol is very important. The following communication protocols are used in the design:

(1) Data is sent using the query method and received using the interrupt method.

(2) The data frame includes a frame header, a frame tail, an address, data, and a checksum. The format of the data frame is shown in Figure 4. The frame header uses two bytes 0x55 and 0xAA, and the frame tail ends with 0x01; the address is a two-byte address, a total of 16 bits. In terms of address allocation, the addresses of various current acquisition modules are not connected to maintain a certain degree of fault tolerance; the data part is one byte; the address part and the data part are sent in hexadecimal ASCII; the checksum part of the frame uses CRC4 check.

(3) The receiver detects consecutive 0x550xAA bytes, indicating that a valid data frame has been received. If the frame check passes, the receiver sends the corresponding data according to the command request. If the frame structure is illegal, the frame is discarded without any processing.

(4) After sending a query request, the sender will start a monitoring timer and wait for a response. If no corresponding data response is received within the specified time, the sender will resend the request and count errors to avoid data loss. If the error count reaches a certain value, the sender stops sending requests and enters error handling.

Fire hydrant information collection module software design, when the slave receives its own address and responds to the host, it switches to receiving mode. If no query signal from the host is received within a period of time, it is considered that the host has correctly received the response signal sent back by the slave, completing a correct communication, and the slave switches to receiving mode. The partial flow chart of the fire hydrant information collection module is shown in Figure 5.

4 Conclusion

This system fully considers the interference of the environment on communication. When sending data during debugging, you should first try to send 0X55AA continuously to check the bit error rate of data transmission and reception. If the bit error rate is large, the circuit should be redesigned. Due to the use of wireless communication chip nRF401, multi-point data collection is very convenient and fast. It is especially suitable for controlling complex places such as factories and warehouses.

Keywords:nRF401 Reference address:Design of multi-channel fire hydrant waterless monitoring system based on nRF401 chip

Previous article:Development and application of micro-power consumption data acquisition system based on MSp430
Next article:Research and design of ultrasonic distance measurement system based on single chip microcomputer

Recommended ReadingLatest update time:2024-11-17 01:59

msp430 RS232 Example Program
/****************************************************** ***** Program function: Receive characters from PC and then resend them to PC ------------------------------------------------------- Communication format: N.8.1, 9600          no checksum, 8 data bits, 1 stop bit, baud rate 9600 -----------------------------
[Microcontroller]
Implementation of Universal GSM Wireless Fax Terminal Based on W77E58 Single Chip Microcomputer
1 Introduction With the continuous progress of the contemporary information society, wireless technology and GSM networks have also developed rapidly. As a new service of GSM, wireless fax has outstanding features such as original transmission and real-time recording. It is particularly suitable for news interviews, t
[Microcontroller]
Realizing the communication between PIC microcontroller and QT host computer based on RS232 serial port
Introduction: The host computer sends a message to the slave computer through the RS232 serial port. The slave computer receives the message and performs two actions: (1) LED light changes. (2) Return the message to the host computer through the RS232 serial port; After receiving the message, the host computer d
[Microcontroller]
Realizing the communication between PIC microcontroller and QT host computer based on RS232 serial port
Detection of transistors
The unijunction transistor is also called a double base diode. Its symbol and appearance are shown in the attached figure. The method to determine the emitter E of a single junction transistor is: set the multimeter to the R*100 or R*1K position, connect the black probe to the assumed emitter, and the red probe to t
[Test Measurement]
Detection of transistors
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号