Application of the hottest USB in data acquisition

  • Detail

The application of USB in data acquisition system

in various industries of industrial production and scientific and technological research, PC or industrial computer is often used to collect various data. There are many places that need to collect various data, such as liquid level and temperature, which are also reflected in the egg tray, such as degree, pressure, frequency, etc. At present, the commonly used acquisition method is through the data acquisition board, including a/d card, 422, 485 and other bus boards. The use of boards is not only troublesome to install and easy to be disturbed by the environment in the chassis, but also impossible to attach many devices due to the limitations of the number and address of computer slots and interrupt resources. The emergence of universal serial bus (USB for short) has solved these conflicts well, and it is easy to realize low-cost, high reliability and multi-point data acquisition

I. Introduction to USB

usb is a serial communication standard formulated by some large PC manufacturers, such as Microsoft and Intel, in order to solve the contradiction between the increasing PC peripherals and the limited motherboard slots and ports. It has been widely supported by PC manufacturers since its debut on Comdex in 1995. At present, almost all PCs produced are equipped with USB interfaces. Microsft's Windows98, NT, MacOS, Linux, FreeBSD and other popular operating systems have increased their support for USB

1. Composition of USB system

usb system is mainly composed of host controller, USB hub and USB peripherals node

2. Main advantages of USB

(1) high speed

usb has two modes: high-speed mode and low-speed mode. The main mode is high-speed mode, with a speed of 12mbps. In addition, in order to adapt to some devices that do not require a large throughput and high real-time performance, such as the mouse, USB also provides a low-speed mode, with a speed of 1.5mb/s

(2) device installation and configuration are easy.

there is no need to open the chassis when installing USB devices, and there is no need to turn off the computer when adding or subtracting installed devices. All USB devices support hot plugging, and the system automatically configures them, completely discarding the previous jumper and dial switch settings

(3) easy to expand

up to 127 peripherals can be dialed by using hub expansion. The standard USB cable length is 3M (5m low speed). The distance between peripherals can reach 30m through hub or repeater

(4) bus power supply

usb bus can be used to provide up to 5V voltage and 500mA current

(5) flexible use

usb has four transmission modes: control, synchronization, interrupt and bulk to meet the needs of different devices

2. Data acquisition equipment using USB transmission

1. Hardware composition

a practical USB data acquisition system includes a/d converter, microcontroller and USB communication interface. In order to expand its use, it can also add multi-channel analog switches and digital i/o ports

the design of a/d and digital i/o of the system can follow the traditional design method, and select the appropriate chip according to the acquisition accuracy, rate, channel number and other elements. During the design, full attention should be paid to the anti-interference performance, especially for a/d acquisition

there are two ways to select the microcontroller and USB interface. One is to use an ordinary single-chip microcomputer and a special USB communication chip. Currently, usbn9602 of national semiconductor and sl11 of scanlogic are popular special chips. The author has used ATMEL's 89C51 single chip microcomputer and u from 2010's 5%sbn9602 chip to form the system, and achieved good results. The design and debugging of this scheme is troublesome, and the cost is relatively high

another scheme is to use a single-chip microcomputer with USB communication function. With the increasingly wide application of USB, Intel, SGS Thomson, cypress, Philips and other chip manufacturers have launched single chip computers with USB communication interfaces. These single-chip computers have strong processing ability. Some of them have multi-channel a/d, the circuit of the system is simple, the debugging is convenient, and the electromagnetic compatibility is good. Therefore, the single-chip computer with USB interface is a better scheme to form the USB data acquisition system. However, due to the USB interface, these chips are usually incompatible with the past development systems, so new development systems need to be purchased with high investment

usb has the advantage of providing power. The power consumption of data acquisition equipment is usually small, so it can be designed as a bus powered equipment

2. Software composition

windows provides a variety of USB device drivers, but it seems that none of them is specific to the data acquisition system, so the driver must be compiled for specific devices. Although the system has provided many standard interface functions, it is still the most difficult thing to compile the driver in USB development, which is usually implemented by windows DDK. At present, many third-party software manufacturers provide various generation tools, such as Compuware's driver works and blue waters' driver wizard, which can easily generate high-quality USB drivers in a few minutes

it is also difficult to compile the single-chip microcomputer program in the equipment, and no manufacturer has provided an automatic generation tool. Compiling a stable and perfect single-chip microcomputer program is directly related to the performance of the equipment, so we must pay full attention to it

the above two programs are concerned by developers and not by users. Users are concerned about how to operate the equipment efficiently through the mouse, how to process and analyze the collected large amount of data, so there must be high-quality user software. The user software must have a friendly interface, strong data analysis and processing capabilities, and provide users with an interface for redevelopment

III. realizing USB remote data acquisition and transmission

the transmission distance is an obstacle to the application of USB in the industrial field. Even if a relay or hub is added, the USB transmission distance usually does not exceed tens of meters, which is obviously too short for the industrial field

at present, there are a large number of data acquisition equipment using RS-485 transmission in the industrial field. RS-485 has its inherent advantages, that is, its transmission distance can reach more than 1200 meters, and multiple devices can be connected. Its shortcomings lie in the slow transmission speed, the adoption of bus mode, the interaction between devices, poor reliability, the need for board support, high cost, troublesome installation, etc. These shortcomings of RS-485 can be made up by USB, and the limitation of USB transmission distance is the advantage of RS-485. If we can combine the two and complement each other, we can produce a fast, reliable and low-cost remote data acquisition system

the basic idea of this system is to use RS-485 protocol to upload the data after digitizing the analog quantity collected by the sensor at the acquisition site. There is a two-way RS-485 ~ USB conversion interface at the PC end, which is used to receive 485 data and transmit it to the PC through the USB interface for analysis and processing. The process of the host sending data to the device is just the opposite: the host sends data to the USB port, and the data is converted into 485 protocol through the 485 ~ USB conversion port and transmitted to the remote end

the key equipment in the scheme is 485 ~ USB converter. Such equipment has been put on the market at home and abroad. The author has also used usbn9602+89c51+max485 of national semiconductor company to realize this function, and achieved good results in practical application

it should be noted that in the 485 to USB converter, the function of the 485 interface is exactly the same as the interface performance (speed, driving capacity, etc.) of the commonly used 485 card, that is, a 485 to USB converter can completely replace a 485 card with much lower cost. At the same time, it has the advantages of convenient installation, no limitation on the number of slots, no external power supply, etc., providing a convenient way for industrial and scientific research data acquisition 3. Flame retardant collection Cheap and effective way

IV. implementation of integrated data acquisition and transmission system

the current data acquisition system usually has two types: distributed and bus. USB interface is easy to realize distributed, while 485 interface is easy to realize bus type. If the two are combined, a comprehensive data acquisition system can be realized. The implementation method is that the USB ~ 485 converter mentioned above is still used to realize the conversion of the two protocols. Since the data transmission rate of USB is much higher than 485, multiple devices can still be attached to each 485 bus, forming the structure shown in Figure 4, where d represents a device

this transmission system is applicable to some occasions where there are multiple spatially dispersed work points, and each work point has multiple data to be collected and transmitted, such as large grain depots, where each grain depot is relatively dispersed in space, and each grain depot needs to collect a series of data such as temperature, humidity, carbon dioxide concentration, etc. In this case, each granary can be assigned a 485 bus to connect the temperature, humidity, carbon dioxide concentration and other collection devices to the 485 bus, and then each granary can be transmitted to the monitoring center through the 485 bus, which is converted into a USB protocol and transmitted to a PC. the transmission data of multiple granaries can be connected to a PC through the hub after being converted into a USB protocol. Because the real-time requirement of various data monitoring in granary is not very high, this method can be used to complete all monitoring work for a large granary with a PC

v. prospects

the application of USB devices is currently in a high-speed development stage abroad, and its application in China has started. We have made some achievements in USB data acquisition, USB industrial control and other fields, and have been successfully applied in reality

the forthcoming USB2.0 protocol has a data transmission rate of 480mbps. Such a high transmission rate can be used where the 1.0 transmission rate cannot meet, such as industrial equipment control with high real-time requirements, real-time transmission of dynamic images, etc. With the progress of the times and the development of technology, USB will be applied in a deeper level in a broader field

Copyright © 2011 JIN SHI