Share this

Distributed Vibration Signal Detection Method Based on Microcontroller and MXA2500GL Sensor

2026-04-06 07:40:09 · · #1
Introduction Due to the distance limitations of the connecting cables for accelerometers and charge amplifiers, centralized data acquisition and processing systems are difficult to implement in situations with long spatial distances, and their reliability and anti-interference issues are difficult to solve. Distributed detection methods are often used: multiple data acquisition stations are set up, each using a separate data acquisition and processing system, interconnected through network communication, and then a single system unit performs centralized data processing to extract relevant feature information. C8051F020 Microcontroller Performance Characteristics: CYGNAL's C8051F020 is a mixed-signal system-on-chip (SoC) microcontroller integrating analog and digital signals, fully compatible with the instruction set of commonly used 51 series microcontrollers. It uses a 100-pin TQFP package, is small in size, and has a fast processing speed. It uses CYGNAL's patented CIP-51 microprocessor core. CIP-51 takes a new approach to improving the speed of the 8051, namely, by implementing pipelined instruction execution while maintaining the CISC architecture and instruction set unchanged. In this mode, the concept of machine cycles is abolished, and instructions are executed in clock cycles. On average, one single-cycle instruction can be executed per clock cycle, significantly improving instruction execution speed. Compared to the 8051, the C8051F020 achieves 12 times the single-cycle instruction execution speed under the same clock cycle, and the average execution speed of the entire instruction set is 9.5 times that of the 8051, propelling the CYGNAL microcontroller series into the ranks of high-speed 8-bit microcontrollers. Simultaneously, the C8051F020 microcontroller continues the priority digital crossbar configuration technology unique to the C8051F series. The core of this technology is the hardware-based configuration of internal digital resource port I/O pins. Unlike standard multiplexed digital I/O, this structure supports more functional combinations. PCAs, comparators, timers, etc., are assigned to selected ports according to priority. Users can also allocate I/O pins only for the digital resources they use. Any unconfigured port I/Os are grouped together as GPIOs. The MXA2500GL accelerometer is a dual-axis absolute analog output accelerometer manufactured using patented technology from MEMSIC. Based on the principle of thermal convection, it can measure dynamic acceleration (e.g., vibration) and static acceleration (e.g., gravitational acceleration) along both axes, making it widely used in automotive stability control, safety control, approach angle control, blood pressure monitors, electronic compass tilt correction, digital cameras, elevators, and other fields. Unlike ordinary piezoelectric accelerometers, the MXA2500GL is actually a monolithic integrated circuit manufactured using standard CMOS technology. Its output is a voltage signal of 0.1–4.9V (with a 5V power supply), allowing direct connection to an A/D card without a charge amplifier. This results in a compact testing system with strong anti-interference capabilities. The basic working principle is as follows: a gas heat source is suspended in a cavity at the center of a silicon wafer, and aluminum/polycrystalline silicon thermocouples are evenly placed at the four diagonals (two axial directions) of the heat source. When acceleration is zero, the temperature gradient of the heat source is symmetrical, so the temperatures of the four thermoelectric piles are the same, and therefore the output voltages in the two axial directions are the same. Acceleration in any direction will disrupt this balanced temperature pattern, causing the temperature gradient of the heat source to become asymmetrical. According to the principle of free convection in heat conduction, the temperatures and output signals—voltages—of the four thermoelectric piles are different. However, these voltage signals change proportionally to the acceleration. Thus, the acceleration value can be determined by measuring the voltage. The sensor has two identical acceleration signal channels, one measuring the X-direction and the other measuring the Y-direction. Figure 1 shows its basic structure. Figure 1: Structure diagram of the MXA2500GL accelerometer; Hardware architecture of the distributed detection system. The system uses a C8051F020 microcontroller as the slave and a PC as the master. Due to the small size, powerful functions, and low price of the microcontroller, it offers a very high cost-performance ratio. Currently, mainstream PCs have two standard RS-232 serial ports using EIA level, while the C8051F020 microcontroller's TX pin (transmit data) and RX pin (receive data) use TTL level. Reliable communication between the two requires a level conversion chip; the system uses the MAX232/MAX485 chip. To achieve resource sharing and task allocation in a distributed computer system, ensuring accurate and reliable data communication between the host and each slave device is crucial. Since PCs themselves do not have multi-machine communication capabilities, two common communication methods are used: one utilizes "bridge" hardware—a multi-machine communication card. Communication cards generally come in two forms, the most widely used being those based on the 51 microcontroller and incorporating chips such as the 8255, 6116, and 2716. This card can be inserted into the PC's expansion slot, allowing each slave device to communicate serially with the microcontroller on the card, while the PC communicates in parallel with the microcontroller on the card via the 8255 chip. Another type of communication card consists only of a single microcontroller (that is, sacrificing a single microcontroller for communication relay), and the communication between the slave device and the communication card and between the PC and the communication card is serial communication; another method is to simulate the 9th bit data function of the serial port of the 51 series microcontroller on the PC serial port to realize multi- machine communication. The system adopts the latter method. In addition, due to long-distance transmission, the system uses the MAX485 chip, and also uses opto-isolation to improve the anti-interference capability of the system. Figure 2 shows the overall hardware architecture. Figure 2 Hardware architecture of the distributed detection system Multi-machine communication protocol The C8051F020 microcontroller has special functions suitable for multi-machine communication, namely mode 2 (3). In these two modes, the 9th bit received enters RB8, and then becomes the stop bit. The serial port can be programmable: when the stop bit is received, a serial port interrupt is generated only when RB8=1. This feature can be controlled by setting SM2 in SCON. The method for using this feature in multi-machine communication is as follows: When the master wants to send a data block to one of several slaves, it first sends an address byte of the target slave, with bit 9 of the address byte set to 1 and bit 9 of the data byte set to 0. When SM2=1, the data byte will not interrupt any slaves; however, the address byte will interrupt all slaves. This allows each slave to check the received address to see if it is addressing itself. The addressed slave clears the SM2 bit to 0, preparing to receive the transmitted data byte, while the unaddressed slaves keep SM2 set and continue processing other tasks. The information frame format of the C8051F020 microcontroller in mode 3 is shown in Figure 3. The asynchronous serial communication port of a PC uses a Universal Asynchronous Receiver/Transmitter (UART) as its core. There are many UART product models, most of which use the Ins8250 chip. Programming the UART is actually operating its internal registers. The UART has 10 internal registers. The first step in programming is to determine the serial communication data format. This is done by writing the selected data format parameters into the Line Control Register (LCR). Next, the baud rate factor needs to be written into the Baud Rate Factor Register to determine the transmission baud rate between the two parties. Then, the Line Status Register (LSR) is read to determine whether the chip is ready or has encountered an error. The format of the Communication Line Control Register (LCR) is shown in Figure 4. Figure 4: Communication Line Control Register (LCR) By writing parameter bytes into the line control register, the UART can be programmed into the following serial communication data format: 1 start bit, 8 data bits, 1 parity bit, 1 stop bit, 1 frame (11 bits in total). Since a 11-bit data format can be implemented on a PC, and changing the values ​​of bits D5, D4, and D3 in the line control register can set the parity bit to "constantly 1" or "constantly 0," if the parity bit is set to "constantly 1" when sending address frames and "constantly 0" when sending data bits, the multi-machine communication points of the 51 series microcontrollers can be simulated on a PC. This feature can then be directly utilized to achieve master-slave distributed multi-machine communication. The master and slave machines follow a master-slave principle; the master selects the slave machine using a call method. Data is transmitted bidirectionally between the master and slave machines, and communication between slave machines requires the master as an intermediary. The master and slave machines should also transmit commands and status words for their identification, such as 00H indicating that the master is sending a command to the slave to receive, and 01H indicating that the slave is sending a command to the master to receive, etc. Implementation Method of PC Master Communication Program Programming the PC's UART is the core of the master communication program. Generally, UART operation can be implemented in two ways. One approach is to directly access the underlying address to operate on the LCR, LSR, and baud rate factor registers. This method is only applicable to Windows 9x. In Windows NT, the system prohibits user programs from directly accessing hardware and physical addresses, making this method unacceptable. The specific process is achieved by calling the standard communication functions inp() and outp(). Another approach is to indirectly operate on the LCR, LSR, and baud rate factor registers through communication controls or Windows API functions. Therefore, this system also uses the MSComm control, while Windows API functions are more suitable for applications in multi-process environments. Conclusion Practice has proven that the distributed vibration signal detection system based on the C8051F020 microcontroller and MXA2500GL sensor is reliable and significantly reduces costs. Therefore, this system has great potential for widespread application in the testing and diagnostic processes of automobiles and their components.
Read next

CATDOLL Miho Soft Silicone Head

You can choose the skin tone, eye color, and wig, or upgrade to implanted hair. Soft silicone heads come with a functio...

Articles 2026-02-22