Greetings, gas safety enthusiasts! Welcome to my innovative project, an early LPG gas leakage prediction system using Raspberry Pi and ADC1115. With this system, you can have peace of mind knowing that potential gas leaks in your home can be detected and predicted before they become hazardous.
By leveraging the power of the MQ-2 sensor, we can accurately detect multiple gases such as CO, H2, CH4, LPG, propane, alcohol, and smoke. To convert the analog voltage readings to digital format, we utilize the ADC1115 module and implement advanced filtering techniques to identify the target gases with precision.
- Begin by creating a channel named "IOT Gas Leakage Detection" on ThingSpeak. Within the channel, set up eight graphs to visualize the gas concentration values effectively.
- Obtain the write API key for your ThingSpeak channel and update it in the "raspberrypi.py" code, ensuring seamless data transmission.
- For data analysis and storage, follow the instructions provided in this video to upload the data to AWS DynamoDB. Create a data table in DynamoDB and make sure to update the table name and column names in the code.
- Once you have uploaded the "raspberrypi.py" file to your Raspberry Pi, run it to begin the data upload process. This code enables data transmission to ThingSpeak for visualization and AWS DynamoDB for further analysis.
- As the sensor values are being successfully uploaded to AWS DynamoDB, let's proceed with the following steps:
- Access AWS SageMaker and create a notebook instance to perform advanced data analysis.
- Upload the dataset file to the notebook area for seamless integration.
- Copy the code from the "sagemaker.ipynb" file into your notebook and execute it. This code trains an XgBoost model on the dataset, empowering us to predict gas leakages accurately.
- Execute the "EmailAlerts.ipynb" file on your local machine.
- This script fetches the latest uploaded data from DynamoDB and sends it to the endpoint of the trained model to obtain the probability of gas leakage.
- If the probability exceeds 0.5, you will receive an email alert notifying you of a possible gas leakage in your house.li>
For more detailed information on how gas values are calculated and how to work with Raspberry Pi gas sensors, I highly recommend checking out this comprehensive tutorial on Raspberry Pi Tutorials.
Safety is my top priority! While this project enhances gas safety, it is essential to prioritize your well-being. Take necessary precautions, follow safety guidelines, and consult professionals when dealing with gas-related systems. Remember, safety always comes first!
Stay safe and protected with our early gas leakage prediction system! Enjoy peace of mind knowing your home is safeguarded against potential hazards. 💪🔐🏠