Acceleration Measurement System Designed Based on LPC2103

Publisher:omega34Latest update time:2014-12-26 Source: eccn Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Reference address:Acceleration Measurement System Designed Based on LPC2103

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

Design of wireless communication system based on LPC2103 and SI4432
Abstract: At present, most wireless communication devices have short communication distance, high hardware cost and complex design. This design adopts a wireless communication system based on micro-power communication chip SI4432, LPC2103 microcontroller and μC/OS-II embedded operating system. It not only has long com
[Microcontroller]
Design of wireless communication system based on LPC2103 and SI4432
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号