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.
Previous article:Analysis and detection technology of common faults of oil-immersed transformers
Next article:Overcurrent protection solution using USB 3.0
- Popular Resources
- Popular amplifiers
- High signal-to-noise ratio MEMS microphone drives artificial intelligence interaction
- Advantages of using a differential-to-single-ended RF amplifier in a transmit signal chain design
- ON Semiconductor CEO Appears at Munich Electronica Show and Launches Treo Platform
- ON Semiconductor Launches Industry-Leading Analog and Mixed-Signal Platform
- Analog Devices ADAQ7767-1 μModule DAQ Solution for Rapid Development of Precision Data Acquisition Systems Now Available at Mouser
- Domestic high-precision, high-speed ADC chips are on the rise
- Microcontrollers that combine Hi-Fi, intelligence and USB multi-channel features – ushering in a new era of digital audio
- Using capacitive PGA, Naxin Micro launches high-precision multi-channel 24/16-bit Δ-Σ ADC
- Fully Differential Amplifier Provides High Voltage, Low Noise Signals for Precision Data Acquisition Signal Chain
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- How to choose between mobile phone and tablet
- During electrical inspection, Warning Unconnected Power Object On Net GND appears
- How to understand the parameters of the second bus chip PB620?
- Trinocular Stereo Vision Epipolar Line Correction and Its FPGA Implementation
- TE Award-winning Event | How to effectively respond to current challenges in the field of test and measurement
- Questions about the design of the power supply system of the weighing instrument
- TMS320F28335 IO Control Timing Operation
- What is red light plus green light?
- How to choose operating system for RK3399
- MYC-CZU3EG core board information