“Usually in the measurement and control system, the sensor is an important device for information collection, and the data collection relies on the sensor. How to realize its network, known as the “neural tentacle”, is also a current hot research issue. In most of the current measurement and control systems, the sensors are mostly wired, but in some special cases, the wired cable connection will obviously cause a lot of inconvenience and cannot meet the actual needs.
Usually in the measurement and control system, the sensor is an important device for information collection, and the data collection relies on the sensor. How to realize its network, known as the “neural tentacle”, is also a current hot research issue. In most of the current measurement and control systems, the sensors are mostly wired, but in some special cases, the wired cable connection will obviously cause a lot of inconvenience and cannot meet the actual needs. With the development of emerging wireless technologies (such as Bluetooth technology) and the reduction of the price of its Chips, wireless methods have been applied in many occasions to replace the original wired interface methods. Wireless networked sensors are bound to become an important direction of sensor development. On the basis of introducing IEEE1451.2 and bluetooth technology, this paper proposes a wireless networked sensor structure model based on bluetooth protocol, and focuses on the realization of the simulated experimental device developed based on the model and its application in remote monitoring of patients .
1 Wireless networked sensor based on IEEE1451.2 and Bluetooth protocol
1.1 IEEE1451.2 standard
IEEE1451.2, as a standard of intelligent sensor interface module, provides an interface standard for realizing networked sensors and transmitters, and adopts a general A/D or D/A conversion device as the I/O interface of the sensor, and connects various sensors. The analog quantity is converted into data in the format specified by the standard, together with a small memory – the sensor Electronic datasheet (TEDS, transducer electronic datasheet) is connected with the target model of the processor specified by the standard – the network adapter (NCAP, networkcapableap2plicationprocess), so that the data can be Connect to the network according to the protocol specified by the network. The standard structure model provides a connection model of smart transmitter interface (STIM, smarttransducerinterfacemodule) and NCAP’s 10-wire standard interface — transmit independent interface (TII, transmitterindependenceinterface). Its workflow is that after the analog signal output by the sensitive element is converted by A/D and the corresponding data processing (filtering, calibration), the network processing device encapsulates it into a data frame according to the program setting and (TCP/IP), and passes the network interface. transmitted to the network.
1.2 Bluetooth Technology
As a new short-range wireless communication protocol, Bluetooth technology provides an open standard for wireless data and voice communication. It has many unique advantages: strong portability and can be used in various communication occasions; simple hardware application , low cost, easy to implement, and easy to promote; Bluetooth low power consumption, less harm to the human body; Bluetooth uses spread spectrum frequency hopping technology, strong anti-interference ability, increasing the security of information transmission. Bluetooth technology is attracting extensive attention of many ZJ scholars with its unique advantages.
1.3 Sensor structure model
The wired network sensor structure model based on IEEE1451.2 includes three parts: STIM, TII and NCAP. The wireless networked sensor based on IEEE1451.2 and Bluetooth protocol in this design uses Bluetooth module instead of TII to realize wireless connection, which is similar to the mode of realizing a wireless STIM and wireless NCAP receiving terminal. The Bluetooth PeakNet realizes mutual communication in a master-slave manner.
STIM is connected to Ethernet (Ethernet) or In2ternet through wireless NCAP, and NCAP is connected to the network through the assigned IP address, as shown in Figure 1. Compared with the typical wired mode, the above wireless network model adds two Bluetooth modules. For the Bluetooth module part, the standard Bluetooth external interface circuit generally uses the RS232 or USB interface, and the TII is a serial port that controls the STIM linked to it. Therefore, it is necessary to design a Bluetooth circuit similar to the TII interface, and construct a special processor to complete the functions of controlling STIM and converting data to the Bluetooth host control interface (HCI, host control interface). Interface modules can be used in hardware implementation, and standard STIM software modules can be used in software implementation: STIM module, STIM sensor interface module, TII module, TEDS module, and address and function modules.
2 Realization of the simulation experimental device
The implementation of the sensor is described below by taking the simulation device developed in the laboratory as an example. The structural block diagram of the device is shown in Figure 2. The temperature value in the temperature sensor is collected periodically in the front-end wireless STIM, and the data is transmitted to the NCAP via the Bluetooth wireless network. NCAP will be stored in a specific location. When a browser wants to view the value, the value will be embedded in the corresponding web page program, and the entire program will be encapsulated by TCP/IP and sent to the client’s browser.
2.1 Implementation of STIM
The micro-conversion chip ADμC812 of AD Company is adopted in STIM. The chip has an 8052 compatible and complies with the IEEE1451.2 standard. It uses the 640B data memory inside the chip ADμC812 as a rewritable TEDS storage, and uses an internal 12-bit ADC to achieve A/D conversion and through the chip. The UART serial port realizes the communication with the bluetooth module. The Bluetooth module selected is the Ericsson ROK101008 series that supports point-to-multipoint, and the module comes with a radio frequency microstrip antenna. The internal structure of the ROK101008 Bluetooth module complies with the Bluetooth specification 1.1, and its internal baseband controller also provides a UART interface. The host controller interface (HCI) is provided inside the Bluetooth module to realize a unified interface for accessing the Bluetooth hardware. Combined with the RS232 serial port, the data communication between the host controller and the host at the transport layer can be realized. The baseband and radio frequency provide the upper layer. links and services. At the same time, ADμC812 should also complete the initialization, data acquisition and processing of the temperature sensor.
(1) Temperature sensor DS18B20 interface and driver.
The temperature sensor is DS18B20. This temperature chip is a one-line digital temperature sensor produced by DALLAS. It is mainly composed of 4 parts: 64-bit ROM, temperature sensor, non-volatile temperature alarm triggers TH and TL, and configuration register. The 64-bit serial number in the ROM is the address serial code of the DS18B20. The function of the ROM is to make each DS18B20 different, so that multiple DS18B20s can be connected to one bus. The host controls the DS18B20 to complete the temperature conversion and must go through three steps: initialization, ROM operation instructions, and memory operation instructions. The work flow is: initialization→ROM operation instruction→memory operation instruction→data transmission. The working sequence includes initialization sequence, write sequence and read sequence. During operation, DS18B20 must be started to start conversion, and then read out the temperature conversion value. Its hardware interface is shown in Figure 3.
(2) The Bluetooth module ROK101008 is initialized.
When the Bluetooth module is powered on, it completes the initialization work, so that it can establish a connection channel with Bluetooth within the signal range. This process is mainly completed by sending the HCI command to the Bluetooth module through the microcontroller MCU. The HCI instruction includes instruction grouping, data grouping and event grouping, and the specific format is: total length of opcode parameter parameter 0 parameter N.
The following is the HCI command to realize the ACL data connection between the master and slave devices (the opcode of the command corresponding to the character, consisting of the first 10 bits and the last 6 bits, the parameters of the command are in brackets): After the slave device is powered on, the query is realized. Enable to reset Write_scan_enable (0x03). The master device sends the query as 0x00000000000, then the HCI command to establish the ACL connection is Create_Connection (0x000000000000, 0x18, 0, 0, 0, 0), and the slave device receives the connection request command as Accept_connection_request (0x111111111111, 0), assuming the master device address is 0x111111111111 . In this way, an ACL data connection is established between the master and slave devices. For example, the corresponding opcode of Inquiry is x0001, 0x01. For specific HCI commands, please refer to the Bluetooth specification.
2.2 Implementation of NCAP
The function of NCAP is to realize the access of the Bluetooth module to the Ethernet (Ether2net), and the ROK101008 series Bluetooth module is also selected, so that multiple STIMs can be connected to the same NCAP. The 8-bit microprocessor W77E58 and the TCP/IP protocol stack chip W3100A are used to realize the network interface of access to Ethernet.
(1) The protocol stack chip W3100A is initialized.
W3100A is a TCP/IP protocol stack chip, including each protocol layer: TCP, IP, UDP, ICMP and Ethernet protocol data link DLC and MAC protocols, its working mode is similar to Windows SoketAPI, in order to facilitate the realization of Sensor access, the sensor can be designed as a web server function. W3100A supports full-duplex mode, with a dual-port SRAM data buffer inside, and its package is a 64-pin LQFP, which provides two ways of parallel port and serial port to communicate with the MCU. The hardware interface between MCU and W3100A is shown in Figure 4. Among them, the RTL8201 chip is the equipment selected for the Ethernet physical layer.
W3100A provides MII interface to connect with RTL8201, among which pins RX_CLK, RXDV, RXD[0: 3]and COL are used for data reception, and TX_CLK, TXE, TXD[0: 3]are used for data transmission.
An analog I2C interface is provided in the MCU to communicate with the W3100A.
Chip W3100A must complete the corresponding initialization for normal operation. The initialization is mainly to set the necessary registers accordingly, these registers include: gateway address register GAR, subnet mask register SMR, hardware address register SHAR and IP address register SIPR and so on. After the above registers are set, the chip is activated by executing bit 0 Sys_init of the control register CR.
(2) WEB service function realization.
The protocol stack chip W3100A implements the TCP/IP protocol from the hardware, so it is obviously easier to integrate the device with the Web service function, that is, the corresponding HTTP protocol should be implemented on the wireless NCAP, which is equivalent to a “gateway” in terms of network functions. To realize the interaction between the remote browser and the sensor, the E2PROM (FM24C04) added in the sensor NCAP can be used to store the corresponding web page files. When interacting, HTTP uses the uniform resource locator URL (uniform resource locator) to determine which resources the sensor should provide to the browser.
The web files are stored in the FM24C04 in the sensor. When the browser of the monitoring center sends a page request, the processor on the NCAP embeds the monitoring value from the STIM side into the special flag in the corresponding web page file during TCP packaging, and then adds the corresponding HTTP header to the web page file. , returned to the requesting user, so that the user can see the actual monitoring value on the browser. Therefore, to realize the Web function, the software should complete the HTTP protocol on the NCAP, and an E2PROM (FM24C04) should be added to the hardware.
3 Application of simulation device in patient monitoring system
The above networked sensor (experimental device) is used in patient monitoring, the patient can collect and detect a certain signal through the sensor carried on his body in a different place (such as at home), and at the same time, the sensor transmits the signal to the monitoring device through Ethernet or Internet. center. The schematic diagram of the structure of the patient remote monitoring system is shown in Figure 5.
Using the WEB function in the simulation device, this scheme adopts the B/S (browser/server) mode to realize the access of the remote monitoring center PC to the sensor. In this way, the requirements of the monitoring center PC can be reduced by ZDCD, and the design of client software is also eliminated. The monitoring PC can easily query and monitor the sensor information through its browser (such as IE). The following is a simple dynamic web page program stored in the temperature sensor, in which “@” is used to insert the temperature mark in the web page, and the web page file is stored in the E2PROM in the sensor. When the browser of the monitoring center sends a page request, the processor on the NCAP embeds the monitoring value from the STIM side into the “@” in the corresponding web page file during TCP packaging, and then adds the corresponding HTTP to the web page file. header, returned to the requesting user, so that the user can see the actual monitoring value on the browser.
The wireless networked sensor design based on the Bluetooth protocol proposed in this paper has safe and reliable information transmission and strong feasibility. The special advantage of its wireless can meet the needs of some special situations, and has broad application prospects and good market value. If the developed simulation experimental device is further verified and improved by clinical practice, it can be used in the patient remote monitoring system to realize real-time detection, monitoring, recording and storage of human body temperature. For example, after adding sensors such as blood pressure and heart rate on this basis, monitoring and recording processing of the blood pressure and heart rate of the human body can be realized.