Journal

What Is the MPU6050 Sensor and Why Is It Ideal for Earthquake Detection

เซ็นเซอร์ MPU6050 คืออะไร และทำไมจึงเหมาะสำหรับการตรวจจับแผ่นดินไหว

May 16, 2026 · 1 min read
What Is the MPU6050 Sensor and Why Is It Ideal for Earthquake Detection

Getting to Know the MPU6050

The MPU6050 is a six-axis sensor module developed by InvenSense, combining an accelerometer for measuring linear acceleration and a gyroscope for measuring rotational velocity in a single chip. It detects all three axes X, Y, and Z for both functions, totaling six measurement channels. Originally designed for drones, robots, and VR devices, it has gained strong popularity in earthquake detection due to its well-matched capabilities and accessible price.

Key Capabilities of the MPU6050

Several features make the MPU6050 well-suited for earthquake detection. It offers 16-bit resolution for both the accelerometer and gyroscope, capturing subtle changes with precision. Its sampling rate reaches up to 1,000 Hz, sufficient for analyzing earthquake wave patterns that require real-time data. I2C or SPI connection requires minimal wiring and is simple to implement. Its price of approximately 50 to 150 THB per unit is low enough for household installation, and it is supported by a large ESPHome and Arduino community.

How the MPU6050 Detects Earthquakes

When the ground shakes, an MPU6050 mounted on a structural wall or column detects acceleration changes across all three axes simultaneously. This data passes through I2C to an ESP32 running ESPHome, which processes it and sends readings to Home Assistant via MQTT. When acceleration values exceed the defined threshold, HA immediately triggers the configured Automation chain.

Real earthquakes produce a distinctive wave pattern: a P-wave arrives first with lower frequency, followed by the more powerful S-wave. Analyzing this pattern alongside threshold values allows the system to distinguish genuine earthquakes from normal household vibration.

Calibration: The Step You Cannot Skip

Properly calibrating the MPU6050 is the foundation of accuracy. The basic process covers setting offset values to compensate for each chip's initial bias, applying a low-pass filter to remove high-frequency noise unrelated to seismic events, and testing against real vibration in each home's specific environment. HappySmart factory-calibrates every sensor unit before delivery, so customers receive a system ready for immediate use without needing to calibrate themselves.

Limitations to Understand

While the MPU6050 suits household use well, there are limitations to be aware of. Its high sensitivity can pick up noise from footsteps or appliances, requiring installation on stable surfaces such as concrete columns or plaster walls, along with appropriate threshold and filter settings. Its accuracy does not match laboratory-grade seismometers, but it is sufficient for home and commercial building protection.

MPU6050 Compared to Alternative Sensors

Alternatives include the ADXL345 offering higher accuracy at a higher price, and the BNO055 with built-in sensor fusion for easier processing but at significantly higher cost. For household use and accessible budgets, the MPU6050 remains the best value option. HappySmart also offers industrial MEMS sensor options for customers who need maximum accuracy.

Questions & answers

Can the MPU6050 detect small earthquakes
Yes. The MPU6050 has sufficient sensitivity to detect low-level vibration. However, appropriate thresholds must be tuned for each home's specific environment to prevent false alarms from normal household activity.
Should I use ESP32 or ESP8266 with the MPU6050
Both work, but ESP32 is recommended because of its faster CPU, more RAM, and Bluetooth support. This allows smoother sensor data processing, especially when simultaneously transmitting data over Wi-Fi.
Where in the home should the MPU6050 be installed
Mount on a primary structural column or concrete wall on the lowest floor. Avoid wooden floors, lightweight partition walls, or locations near washing machines, air conditioners, or other vibration-generating equipment.
How often does the MPU6050 need maintenance
Check connections and test the system every one to three months, update firmware via OTA whenever ESPHome releases an update, and recalibrate if the sensor is relocated. HappySmart handles all these steps as part of its after-sales service.
How does HappySmart industrial MEMS differ from the MPU6050
Industrial MEMS sensors offer higher accuracy, better environmental durability, and more detailed factory calibration. They suit the highest-risk locations requiring maximum reliability. The price is higher than the MPU6050 but remains cost-justified.

Related reading