How To Add an Earthquake Sensor To Your Meshtastic Device

Integrate a vibration/earthquake sensor into your ESP32-based LoRa Meshtastic Node with our guide, suitable for boards like Heltec V3 Lora, TTGo, or T-Beam. This setup allows the network to broadcast warnings when seismic activity is detected.

How To Add an Earthquake Sensor To Your Meshtastic Device
Image Credit: https://www.etsy.com/listing/1777099913/mini-meshtastic-solar-node-for-fence

In this guide, we'll walk you through adding an earthquake/vibration sensor to your existing ESP32-based LoRa Meshtastic Node. This guide works for any ESP32-based board like Heltec V3 Lora, TTGo, or T-Beam with minor adjustments.

Hardware

Let's start with the components you'll need:

πŸ“’
When ordering from AliExpress, consider consolidating your purchases from a single seller to maximize savings. For instance, if you're purchasing an antenna from seller X, check if they also offer jumper wires or sensors. By sourcing multiple items from one seller, you can significantly reduce shipping costs.

Assembly

Now that you have your components, let's proceed with the wiring. We'll follow these schematics:

SW-420 Vibration Sensor - Heltec Lora v3 Connections

SW-420 Vibration Sensor - Heltec Lora v3 Connections
  • VCC β†’ 3V3
  • DO (Digital Output) β†’ PIN 46 (or any available GPIO pin of your choice)
  • GND β†’ GND
πŸ’‘
If you're using a different ESP32-based board like TTGo or T-Beam, simply select an available GPIO pin that accepts digital signals, supports pull-up resistors, and isn't already in use. Then, follow the guide using the chosen pin, disregarding the specific pin number mentioned in the instructions.
πŸ’‘
The order of connections might vary by component model. Always follow the labels on your specific components and the provided schematics to ensure accurate wiring.

Once all wiring is completed, double-check your connections and ensure they match the suggested layout before proceeding to the next steps.

Meshtastic Settings

On the Sensor Device

  1. Open Meshtastic App (iOS/Android/Web)
  2. Go to the Settings page
  3. In the module configuration section, go to Detection Sensor
  4. Toggle the switch to enable it
  5. Give the sensor a name (e.g., "Earthquake Sensor")
  6. Set GPIO PIN to monitor to PIN 46 (or whichever pin you used)
  7. Press Save
πŸ’‘
Detection Trigger Type should be High for the SW-420 module since it pulls HIGH when vibration is detected and LOW when idle

On the Client Device

  1. Open Meshtastic App (iOS/Android/Web)
  2. Go to the Settings page
  3. In the module configuration section, go to Detection Sensor
  4. Toggle the switch to enable it
  5. Right under the toggle, select "Client" this time
  6. Press Save

Testing and Calibration

The SW-420 vibration sensor has an adjustable sensitivity via the potentiometer on the module:

  1. Start with the potentiometer in the middle position
  2. Use a small screwdriver to adjust sensitivity:
    • Clockwise: Decreases sensitivity (requires stronger vibration to trigger)
    • Counterclockwise: Increases sensitivity (triggers with lighter vibration)

Finding the right balance is crucial:

  • Too sensitive: May cause false alarms from wind or footsteps
  • Not sensitive enough: Might miss actual seismic events

Conclusion

This guide has walked you through integrating an earthquake/vibration sensor with your ESP32-based Meshtastic Node. The SW-420 provides basic detection capabilities perfect for DIY early warning systems within your mesh network.

Remember that if your sensor is expected to be triggered frequently (such as in areas with regular minor tremors), consider setting detection limits in the Meshtastic settings to avoid saturating the network. Check out our Channel Utilization post for more information on optimizing network traffic.

Explore the potential of your Meshtastic Node by experimenting with different sensitivity settings and placements to create an effective early warning system for your mesh network. Happy building!