Application of LM331 in AD conversion circuit

Publisher:星际穿越Latest update time:2011-03-24 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Data collection and processing are widely used in the field of automation. Due to different application occasions, the hardware required for data collection and processing is also different. In the control process, sometimes several analog signals need to be collected and processed. The acquisition and processing of these signals do not require high speed. Generally, A/D conversion circuits composed of chips such as AD574 or ADC0809 are used to realize signal collection and analog-to-digital conversion. However, A/D converters such as AD574 and ADC0809 are expensive and have complex circuits, which increases product prices and project costs. In this article, starting from practical applications, an A/D conversion circuit composed of V/F converter LM331 chip is given . The V/F converter LM331 chip can convert voltage signals into frequency signals with good linearity. Through computer processing, the frequency signal is converted into a digital signal to complete the A/D conversion. Compared with AD574 and other circuits, it has the characteristics of simple wiring, low price, high conversion accuracy, etc. In addition, the LM331 chip does not require software program drive during the conversion process , which is much more convenient to use than AD574 and other A/D conversion circuits that require software program control .

1. Chip Introduction

LM331 is an integrated chip with a high performance-price ratio produced by NS Corporation of the United States. It is currently the simplest high-precision V/F converter, A/D converter, linear frequency modulation and demodulation, long-time integrator and other related devices. LM331 is a dual in-line 8-pin chip, and its pin diagram is shown in Figure 1.

Figure 1 LM331 logic block diagram

The functions of each pin of LM331 are as follows: Pin 1 is the pulse current output terminal, which is equivalent to a pulse constant current source internally, and the pulse width is the same as the internal monostable circuit; Pin 2 is the output pulse current amplitude adjustment, the smaller the RS, the larger the output current; Pin 3 is the pulse voltage output terminal, OC gate structure, the output pulse width and phase are the same as the monostable, and can be left floating or grounded when not in use; Pin 4 is ground; Pin 5 is the monostable external timing time constant RC; Pin 6 is the monostable trigger pulse input terminal, which is effective when the voltage is lower than Pin 7, and the input negative pulse width is required to be less than the monostable output pulse width Tw; Pin 7 is the comparator reference voltage, which is used to set the effective trigger level of the input pulse; Pin 8 is the power supply Vcc, and the normal working voltage range is 4~40V. Good linearity, maximum nonlinear distortion less than 0.01%, good linearity even at operating frequency as low as 0.1Hz; high conversion accuracy with digital resolution up to 12 bits; simple external circuit, only a few external components are needed to easily form V/F or F/V conversion circuits, and easy to ensure conversion accuracy.

Figure 2 Voltage-frequency conversion circuit

Figure 2 is a commonly used voltage-frequency conversion circuit. According to Figure 2, the circuit is designed. LM331 is powered by a single power supply, the power supply voltage is VCC, and the analog signal The input range is -VCC~0V, the frequency range is 1~500KHZ, and the nonlinearity is less than 0.01%. Analog signal After being integrated by the integrator LF356, the voltage at the INPUT terminal becomes the same as the input voltage. The stable current input proportional to the voltage is converted into a frequency signal proportional to the voltage after V/F conversion by the LM331 chip. The frequency signal output from the FOUT terminal is sent to the counting/timing port of the computer, and the computer collects, processes and stores the frequency signal. Thus, the conversion of analog signals to digital signals is realized. Since the conversion linearity of LM331 directly affects the accuracy of the conversion result, the reason for the nonlinear error in V/F conversion is usually the output impedance of pin 1, which makes the output current change with the input voltage, thus affecting the conversion accuracy. To overcome this shortcoming, the high-precision V/F converter adds an integrator between pins 1 and 7. This integrator is an anti-integrator composed of a conventional op amp LF356 and an integral capacitor C4. After adding the integration circuit, since the current source (pin 1) always maintains the ground potential, the voltage does not change with the input voltage. or FOUT changes, so it has high linearity.

2. Frequency-to-digital signal conversion

Figure 3 LM331 A/D conversion framework

In Figure 3, the analog signal is converted into a pulse signal through the voltage/frequency converter LM331, and the pulse signal is sent to the counting/timing port of the computer, where the computer receives, processes, and stores the frequency signal. Since the voltage/frequency conversion relationship of the voltage/frequency converter LM331 is linear, we can know the size of the analog signal based on the collected frequency data, thereby realizing the conversion of analog signals to digital signals. The frequency counter and timer can use the counting/timing port of the computer and be realized through software programming. The reference frequency and data processing are also realized through software programming, and the data can be stored in the internal data storage or the external data storage.

3. Computer Software Programming

To achieve A/D conversion, LM331 needs to be used in conjunction with a counter. The output FOUT of LM331 is connected to the T0 port of the MCU counter. Timer T1 is used for timing. According to the formula f=D/T, D is the count value; T is the count time. The count time T is determined by timer T1, and FOUT is calculated, and then data is processed and stored. The brief program and instructions are as follows:

The main program MAIN sets the working modes of timer T0 and T1 to 16-bit counting and timing respectively, and sets the initial value. T1 opens the interrupt. The timing time of T1 is determined according to the conversion accuracy. If the conversion accuracy is 12 bits, the maximum frequency is 100KHZ, and the full-scale time is FFFH/100K=8.192ms. When the single-chip microcomputer uses a 12MHZ crystal oscillator, the machine cycle = 1µs, and the initial value of the timing is

The DATA subroutine is mainly used for data processing and storage. The data obtained is 12-bit A/D conversion data. By changing the initial timing value, the A/D conversion bit can be adjusted, such as 13 bits, 14 bits, etc.

in conclusion:

Using LM331 to realize A/D conversion has the characteristics of simple circuit, low cost, high measurement accuracy and adjustable conversion bit number. Before actual work, the circuit device parameters are adjusted. After adjustment, the system stability is good. Compared with circuits such as AD574, the price is several times cheaper.

Reference address:Application of LM331 in AD conversion circuit

Previous article:Analysis and detection technology of common faults of oil-immersed transformers
Next article:Overcurrent protection solution using USB 3.0

Latest Analog Electronics Articles
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号