Journal

Earthquake Sensor in the Bedroom: A Small Device That Can Save Your Life

เซนเซอร์ตรวจจับแผ่นดินไหวในห้องนอน อุปกรณ์เล็กที่ช่วยชีวิตในเหตุการณ์ไม่คาดฝัน

May 16, 2026 · 1 min read
Earthquake Sensor in the Bedroom: A Small Device That Can Save Your Life

Thailand's Earthquake-Prone Regions You Should Know

Thailand has several active fault lines, concentrated in the northern and northwestern regions. The Mae Chan–Mae Lao fault in Chiang Rai is the most prominent — a magnitude 6.3 earthquake in 2014 caused widespread damage across Mae Lao district and surrounding areas. Other active faults include Mae Tha–Chiang Mai, Mae Hong Son, and Mae Ping in Tak province. Even Bangkok has felt tremors from earthquakes originating in Myanmar and Indonesia. Most major events occur at night, making rapid automated alerting essential.

How Earthquake Sensors Work

Earthquake sensors use 3-axis accelerometers (X, Y, Z) — and sometimes a gyroscope — to distinguish seismic vibration from ordinary household movement. When measured acceleration exceeds a set threshold, the device triggers an alert immediately. On the wave-detection side, earthquakes first emit P-waves (Primary waves) — fast-moving but low-damage — followed by the destructive S-waves (Secondary waves). High-quality sensors detect the incoming P-wave and alert occupants before the more violent S-wave arrives.

Recommended Devices for the Bedroom

For general users, the Aqara Vibration Sensor (Zigbee, approx. 800–1,200 THB) is compact, lasts over two years on battery, and integrates directly with Home Assistant via a Zigbee hub. For DIY enthusiasts, an ESP32 paired with an ADXL345 sensor (total under 500 THB) connects via MQTT to Home Assistant and allows full sensitivity customisation. A Shelly Plus 1 wired to a geophone sensor suits those wanting professional-grade accuracy. Integrating the USGS Earthquake API into Home Assistant adds a second layer — alerting you whenever a qualifying earthquake is detected within a defined radius.

Home Assistant Automation for Maximum Safety

Practical automations to configure: when the sensor detects above-threshold vibration, turn on all lights and play an audio alert through a Smart Speaker; send a push notification via the Home Assistant app and Telegram with your home's GPS coordinates; automatically close the gas valve via a Smart Relay to prevent leaks after shaking; and cut power to high-risk circuits via Smart Switch. For residents of Chiang Rai, Chiang Mai, or Mae Hong Son, a bedroom earthquake sensor is not a luxury — it is an affordable, high-value safety investment.

Questions & answers

Which Thai provinces face the highest earthquake risk?
Chiang Rai, Chiang Mai, Mae Hong Son, and Tak have active fault lines. Chiang Rai experienced a magnitude 6.3 earthquake in 2014 that caused widespread damage.
How much does a bedroom earthquake sensor cost?
The Aqara Vibration Sensor (Zigbee) costs approximately 800–1,200 THB. A DIY ESP32+ADXL345 setup costs under 500 THB in total.
Can earthquake sensors connect to Home Assistant?
Yes. The Aqara Vibration Sensor pairs via a Zigbee hub, while ESP32-based DIY sensors communicate via MQTT — both are fully supported by Home Assistant.
Can Home Assistant automatically close a gas valve during an earthquake?
Yes. Connect a Smart Relay to your gas valve and create an automation that triggers valve closure when the sensor detects above-threshold vibration.
What does the USGS API add to an earthquake alert system?
Home Assistant can pull data from the USGS Earthquake API to alert you when a qualifying quake is detected within a set radius — supplementing local sensor readings.

Related reading