Seismic Sensor with MQTT for use with Home Assistant
UPDATE: This project is cancelled, will go on with seismoM5 project: https://github.com/febalci/seismoM5. Will leave this as archive purposes.
This project is an online Seismic Senor based on MPU6050 accelerometer. It sends xy and z gravity changes during an earthquake and send it to MQTT server.
- Nodemcu
- MPU 6050 accelerometer
- Openlog (optional)
- DS3231 RTC
- Red, Yellow, Green LEDs
- Resistors for LEDs
The code is written on platformio.
- electroniccats/MPU6050@^0.2.1
- NTPClient=https://github.com/arduino-libraries/NTPClient.git
- ayushsharma82/AsyncElegantOTA @ ^2.2.5
- khoih-prog/ESPAsync_WiFiManager@^1.6.0
- bblanchon/ArduinoJson@^6.17.3
- marvinroger/AsyncMqttClient@^0.8.2
- makuna/RTC@^2.3.5
- platform: mqtt
name: "Seismometer XY"
state_topic: "seismoha/state"
qos: 1
availability:
- topic: "seismoha/status"
payload_available: "online"
payload_not_available: "offline"
value_template: '{{ value_json["xy"] }}'
unit_of_measurement: g
- platform: mqtt
name: "Seismometer Z"
state_topic: "seismoha/state"
qos: 1
availability:
- topic: "seismoha/status"
payload_available: "online"
payload_not_available: "offline"
value_template: '{{ value_json["z"] }}'
unit_of_measurement: g
- Web Page: Use %% instead of % in css styles. Otherwise placeholder template fails in asyncweb. or you can use #define TEMPLATE_PLACEHOLDER '~' in build parameters and can use ~PLACEHOLDER~ instead of %PLACEHOLDER%
- Openlog:
- Uppercase / Lowercase letters both work, but prefer lowercase filenames.
- When creating new file with append, it still creates LOG0000xx.TXT with 0 bytes. So delete this with rm first.
- For command mode send 3 x escape (26) and put a delay later. Delay is required after every command.
- append ends command mode.
- TXO creates problems during Serial firmware upload, so only used RXO on Serial1 on D4 for Openlog.