Gas Detector and Seismic Alert System for Home/Industrial SafetyObjectives:
Read more- Detect the presence of combustible gases/smoke (e.g., methane, propane, carbon monoxide) and unusual seismic movements or vibrations.
- Activate an immediate local alert (on the OLED display) and send remote notifications via the LoRaWAN gateway to an alert system in The Things Stack.
- Provide an early warning system for fire hazards, gas leaks, or seismic activity, enhancing the safety of people and property.
- Fundamentals of Arduino (C/C++) programming.
- Basic concepts of electronics and sensors (especially gas and motion sensors).
- Familiarity with the Arduino IDE or PlatformIO development environment.
- Understanding of LoRaWAN communication for sending critical alerts to The Things Stack.
- WISBLOCK Base: RAK19003 Mini Base Board (for a compact design)
- WISBLOCK Core: RAK4630 Nordic NRF52840 (with integrated LoRaWAN for alert communication)
- WISBLOCK Sensor:
- RAK12004 Gas Sensor (for combustible gases and smoke)
- RAK12027 Dimron D75 Earthquake Sensor
- RAK12033 IM-42652 6-axis Accelerometer (for general vibration detection or device movement)
- WISBLOCK Miscellaneous: RAK1821 OLED Display
- Other Components / Accessories:
- WisGate Edge Lite 2 (LoRaWAN Gateway, for remote alert forwarding)
- Battery Connector Cable
- Screwdriver
- Arduino IDE or PlatformIO
- Arduino libraries for RAK modules (e.g., RAKwireless_RAK4631_BSP) and specific libraries for the sensors (e.g., for MQ2, D75, IMU like Adafruit_LIS3DH or similar, Adafruit_SSD1306, Adafruit_GFX).
- Configuration software for the RAK7268V2 gateway.
- Account on The Things Stack (for the LoRaWAN network) and a cloud IoT platform to receive alerts (e.g., The Things Stack with integration to notification services like Telegram, SMS, or email).
Estimated Duration: 6-10 hours.
Learning Outcomes:- Ability to implement security systems based on the detection of multiple types of events (gases, seismic activity, movement).
- Skill in processing gas and motion sensor data for critical event detection and alert activation.
- Knowledge in configuring local (visual) and remote (notifications via The Things Stack) alerts.
- Experience in designing IoT systems for security and rapid response applications.
- Hardware Assembly: Connect the RAK4631 (Core) module to the RAK1903 (Mini Base Board). Connect the sensors (MQ2, Earthquake, Accelerometer) and the OLED Display to the corresponding ports. Connect the battery cable.
- Development Environment Configuration: Install Arduino IDE/PlatformIO and support for the RAK4631 board. Install the necessary libraries for the sensors and the OLED.
- Node Programming (RAK4631):
- Write code to initialize and read data from the MQ2 gas sensor. Set an alert threshold for gas/smoke concentration.
- Read data from the D75 seismic sensor (digital) and the IM-42652 accelerometer. Implement logic to detect seismic events or unusual vibrations (e.g., sudden changes in acceleration).
- Display the current sensor status and active alerts on the OLED Display.
- Configure the RAK4631 as a LoRaWAN node. When an alert (gas or seismic/movement) is detected, send a LoRaWAN alert message with the event type.
- Implement low-power modes to keep the device active and continuously monitoring.
- Gateway Configuration (RAK7268V2): Connect the gateway to the network and configure it to connect to The Things Stack.
- The Things Stack Configuration:
- Access The Things Stack console.
- Registerthe Gateway: Add the RAK7268V2 gateway.
- Create an Application: Create a new application.
- Register the Device (RAK4631 Node): Register the device with its LoRaWAN credentials.
- Configure the Payload Formatter (Decoder): Write Javascript code to decode the alert payload (e.g., one byte for alert type, another for severity).
- Configure Integrations for Notifications: In the "Integrations" section, add a "Webhook" to send notifications to services like IFTTT, Zapier, or directly to a server that can send SMS/emails/Telegram messages when a specific alert payload is received.
- Testing: Perform simulated tests: bring a gas source (e.g., unlit lighter) near the MQ2 sensor, or vibrate the seismic sensor/accelerometer to verify that local and remote alerts are activated correctly.
- Gas Sensor Calibration: MQ2 gas sensors require an initial "burn-in" period (several hours) to stabilize. Calibration can be complex and depends on the specific gas and desired concentration. It's crucial to understand their limitations and potential false positives.
- False Alarms: Adjusting thresholds for motion/seismic sensors is critical to avoid false alarms from everyday vibrations (e.g., people walking by, nearby vehicles). Detection logic must be robust.
- Communication Reliability: For a security system, LoRaWAN communication reliability is paramount. Ensure good coverage at the installation location and consider redundancy if possible.
- Power Supply: For a security system, a backup power source (battery) and constant monitoring of its status are vital to ensure uninterrupted operation.
- The system accurately detects the presence of combustible gases/smoke and seismic events/vibrations.
- Local alerts are clearly displayed on the OLED Display immediately.
- Remote notifications are reliably and promptly sent to The Things Stack and configured alert services.
- The system is stable and minimizes false alarms.
- The code is efficient and power consumption allows for continuous monitoring.
11 projects • 9 followers
Teacher at Maude Studio & Erasmus+ project member: "Developing Solutions to Sustainability Using IoT" (2022-1-PT01-KA220-VET-000090202)
Thanks to Jose Miguel Fuentes.
Comments