introduction
ADXL202 is a dual-axis acceleration measurement system produced by ADI. It has analog input and can measure dynamic acceleration and static acceleration. The measurement range is ±(2~10)g. The output is a pulse width modulation signal with adjustable period, which can be directly connected to a microcontroller or a counter. LPC2103 is an ARM7 series microcontroller of Philips, which is mainly used in industrial control, medical systems, access control, POS machines, communication gateways and other fields. This paper uses LPC2103 to realize the acquisition and processing of ADXL202 acceleration data.
1 ADXL202 accelerometer
1.1 Pin definition and basic characteristics of ADXL202
ADXL202 is a monolithic integrated circuit with high integration and simple structure. It contains a polysilicon surface microprocessing sensor and a signal control circuit to realize an open-loop acceleration measurement structure. Compared with other accelerometers, ADXL202 can greatly improve the working bandwidth, reduce the influence of noise, and the zero gravity deviation and temperature drift are relatively low. Figure 1 shows the pin definition of the ADXL202 sensor.
ST: Self-test, used to control the chip self-test function. When connected to VDD, the output duty cycle is 10%, indicating that the chip is working normally.
COM: Pins 4 and 7. When in use, connect the two COM terminals together and ground them.
T2: grounded through resistor RSET to adjust the output signal cycle. Output signal cycle T2 = RSET/(125 MΩS-1).
VDD: Power supply. The operating voltage range is +3.0 to +5.25 V and can be connected to the power supply through a 100Ω decoupling resistor.
XFILT, YFILT: Grounded via capacitors, used to change bandwidth, filter noise and suppress zero drift.
Xout, Yout: output.
Figure 2 is a schematic diagram of the internal structure of the ADXL202 sensor.
The ADXL202 sensor consists of an oscillator, an X and Y direction sensor, a phase detection circuit and a duty cycle modulator, and has a digital output interface and an analog voltage signal output interface. The X and Y direction sensors are two mutually orthogonal acceleration sensors that work simultaneously and can measure dynamically changing acceleration and constant acceleration. The phase detector is cascaded after the sensor, which is mainly used to correct the signal and determine the direction of the signal. The signal output by the detector drives the duty cycle modulator through a 32 kΩ resistor, and the bandwidth is changed by connecting capacitors CX and CY to the XFILT and YFILT pins.
1.2 Calculation and processing of measurement data
(1) Calculation of signal bandwidth
The bandwidth is set by CX and CY, and capacitors are connected to the XFILT and YFILT pins to reduce noise through a low-pass filter. The formula for 3 dB bandwidth is:
f=5 μF/C(x, y) (minimum capacitance is 1 000 pF)
(2) Calculation of acceleration
The output signal period T2 = RSET/(125 MΩs-1), as shown in Figure 3.
After the signal passes through the low-pass filter, the duty cycle modulator converts the signal into a digital signal for output. The period of T2 (0.5-10 ms) can be changed by an external resistor at the T2 pin, which is very suitable for use in situations with different accuracy requirements. The duty cycle of the output duty cycle signal can be calculated by a counter. The acceleration can be calculated by the following formula:
For example, when the acceleration is 0g, the signal width T1 is the same as the idle width (T2-T1), and the duty cycle of the output signal is 50%; when the acceleration is 1g, the ratio of the signal width T1 to the idle width (T2-T1) is 5:3, and the duty cycle of the output signal is 62.5%.
1.3 Typical Applications of ADXL202
One of the most important applications of the ADXL202 sensor is the measurement of inclination. When measuring inclination, the sensitive axis (x-axis) of the sensor needs to be perpendicular to the direction of gravity. If it is parallel to the direction of gravity, the effect of the object's inclination on the acceleration data can be ignored. Figure 4 shows the schematic diagram of acceleration measurement.
When the ADXL202 is perpendicular to the gravity vector, its output changes with the inclination by about 17.5 mg per degree. When the two are 45 degrees apart, the output changes by only 12.2 mg per degree, and the resolution is reduced. Table 1 shows the relationship between the inclination angle and the acceleration change.
2 Application Circuit Design
2.1 Hardware interface design
LPC2103 is a 32-bit ARM7TDMI-S CPU that supports real-time simulation and tracing, and has 8 KB on-chip SRAM and 32 KB embedded high-speed on-chip Flash memory. LPC2103 has a small LQFP48 package, extremely low power consumption, multiple 32-bit timers, 8-way 10-bit ADC, 2 external interrupts, and up to 32 GPIOs. The CPU clock frequency of up to 70 MHz can be achieved through the programmable on-chip PLL (possible input frequency range: 10 to 25 MHz). The interface circuit between the ADXL202 sensor and the LPC2103 is shown in Figure 5. [page]
T2 of the ADXL202 accelerometer is grounded via a 125 kΩ resistor, and the signal output period is 1 ms. Pins 13 and 14 are connected to a +5 V power supply, and XFILT and YFILT are grounded via a 0.1 μF capacitor to set a 50 Hz bandwidth. The two outputs are connected to the PO.0 and PO.2 pins of the LPC2103 as data transmission lines. There are two methods for data transmission, namely the ordinary GPIO port method and the timer capture interrupt method.
2.2 Ordinary GPIO port mode
Since the sensor outputs are all DCM signals, no matter what method is used to receive data, the timer/counter needs to work to time the DCM signal. Therefore, the program must first initialize the timer. Then the high and low level durations of the DCM signal are timed respectively to obtain the values of T1 and T2, and then the acceleration is calculated. Since the GPIO is in normal I/O mode by default, there is no need to set the PIN-SEL register at the beginning. The program for normal GPIO port mode is as follows:
The program of the ordinary GPIO port mode is relatively simple. Although the execution of the program takes time, since the main frequency of LPC2103 can reach 40 MHz, it only takes a few microseconds to execute several instructions, so the error will be very small. However, when the program of the ordinary GPIO mode is executed, the CPU is always waiting for the rising edge or falling edge to arrive, which greatly reduces the efficiency of CPU use. You can use the interface mode of Xout and LPC2103 shown in Figure 5.
2.3 Timer capture interrupt mode
As shown in Figure 5, Yout is connected to the PO.2 pin of LPC2103. By using the function multiplexing of P0.2, the timer capture interrupt mode can be used to receive sensor data. The main program segments are as follows:
After the interrupt processing program runs, the signal cycle should be T2 = t1 + t2. Therefore, the acceleration is (((fp32)t1/((fp32)t2+(fp32)t1))-0.5)*8. The use of interrupt service routines greatly improves the efficiency of CPU usage, but the program is more complicated and occupies an interrupt vector channel.
Conclusion
The application method of ADXL202 sensor has been verified to be completely feasible and can achieve high measurement accuracy. Due to its high integration, the system composed of ADXL202 and ARM series microcontroller can be fully used in the safety control system of vehicles such as cars and trains. ADXL202 has a wide range of applications in inertial navigation, tilt sensing, earthquake monitoring and car insurance. Its high accuracy, high integration and low power consumption make it completely replace traditional acceleration sensors.
Previous article:Wireless bus measurement and control system based on LPC2132
Next article:Design of sleep monitoring alarm device based on S3C440X
Recommended ReadingLatest update time:2024-11-16 15:50
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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
- MSP430F5529 MCP4725 Program
- [STM32WB55 Review] This Nucleo is a little special
- HIFU ultrasonic knife (high energy focusing control circuit)
- ARM transplantation encounters a long wait for a solution
- Single bus temperature sensor DS18B20 reading and writing example
- Using C language editor
- Why does this error always occur in the joint simulation of Xilinx 12.4 and modelsim?
- 【K210 Series】3. Core board connection
- The problem of repeated declaration of global variables in embedded C programming
- UWB can use the frequency band in China,,,,