Guys, In this post, I will show you how you can create this Arduino Home Safety Monitor to identify LPG Leakage, temperature rise, ambient light, humidity and pressure of your home, especially the kitchen, and see the data in these interactive dashboards in real time.
Smart Home Safety Monitor System using Arduino Video TutorialGuys. Before going further, if you find this video useful, consider supporting my channel by giving this video a like and subscribe to my channel by clicking the subscribe button below. I would really appreciate it.
This will also alert you via SMS, mail or Telegram, if something goes wrong or if it detects any danger. You can access this dashboard and monitor your home from anywhere in the world.
In this tutorial, I will share everything to make this one yourself. I will explain the circuit, share with you the PCB Design and layout, and the Arduino code.
Learn Arduino the Easy WayAre you new to Arduino? Do you want to improve your skills in Arduino programming? You are in the right place. We have a complete beginner-level tutorial for Arduino which covers everything from scratch.
In this free Arduino Tutorial for Beginners guide, we will be taking a look at Introduction to Arduino Platform, Getting Started with Arduino IDE, Different Types of Arduino Boards, Arduino
What is Ubidots?Ubidot provides a simple and secure method for sending and receiving data to and from IoT devices using the global cloud network in real time. Ubidots provides a firm platform for hobbyists, enthusiasts as well as professionals, enabling them to easily retrieve and use the sensor data around the world and turn it into something useful.
We can use the Ubidots platform to send various sensor values or other data to the cloud, store it there safely and retrieve them anytime we want using simple API calls.
Components Needed for Arduino Home Safety Monitor
- Arduino Nano 33 IOT
- BME 280
- MQ2 Gas Sensor
- LDR
- Home Safety Monitor PCB
The Reason why I chose Arduino Nano 33 IOT is, they are very small, pin to pin compatible with arduino nano R3 and it even have an inbuilt WiFi module which will come in handy.
So lets get started.
StepsStep 1 – Building the PCBGuys, I have designed a PCB layout where you can easily mount your Arduino Nano 33 IOT and your Sensors, set this up without using messy wires and cables hanging around. The board is lightweight and can be powered using a 9V battery or a 9-12 V power adapter.
Why not make a PCB for your Project?Making a PCB for your DIY project is not hard nowadays. PCB helps to get rid of all messy wires and stuff and gives your project an awesome look. And it’s cool to make your own PCB for your project right?
Design your own PCBs for your Project!I used Altium designer to draw the circuit and design the PCB. It is a powerful tool that can be used to design and create our own PCBs for our project as well as complex and multi-layer PCBs for industrial use.
If you are a DIY Electronic enthusiast, I bet this is gonna be really useful for you guys. I have been using it for the past 3-4 years and let me tell you guys, this is amazing! You can download the Free Trial of Altium PCB Designer from here.
PCB Design Tutorial using AltiumCheck out the below video to start designing your own PCBs in Minutes!
Here is the Circuit Diagram and the PCB Layout.
Getting the PCB from PCBWay
To order your PCB from PCB way, Go to PCBWay
and fill the board details in the instant order form.
From there you will be directed form where you can provide more elaborate board details and Gerber upload.
Update your board requirement information in the PCB Specification screen.
You can change the board thickness, board color, silk color, and even the type of finish you want. Some of these add-ons are going to increase the board cost.
Once you have all of the various options for your PCB selected, submit it for review. Before your board goes into manufacturing their team of professional technicians will review your design for any potential errors.
Once the review is completed, all that is left is to add to cart, make payment, and wait for your PCBs to arrive. It could take anywhere from 3 – to 6 days to be produced depending on the number of boards you ordered.
Soldering
Once you get all the components, it’s time for you to solder them together. Solder all the components onto the board and make sure to check the polarity of the components.
I personally find soldering on this kind of PCBs a fun task, because of this pads soldering becomes very easy. The solder takes up the conical shape and get soldered from all the sides evenly. After soldering the PCB looks like this.
Step 2 – Ubidots Sign UpNext, Go to this link and create a free account in Ubidots education.
If you already have an account simply sign in with your credentials.
Step 3 – Setting Up DevicesNext we have to create a device. Since we are using Arduino for Safety moitoring, let us name the device “Home Safety Monitor”.
Here you can see I have already made this device.
Step 4 – Setting Up VariablesNow click on the device you just created. Now it will show you all the variables which are linked to that device.
In this project, we will need variables for storing and displaying the values for temperature, pressure, ambient light, LPG reading and Humidity.
Step 5 – Assigning Variables to WidgetNow from the dashboard, click on add new widget. There you will see several type of widgets that you can assign to your variables.
These widgets gives a visual representation of the data that we will be collecting.
Step 6 – Authentication TokenIn this project, we will be transmitting the data from our Arduino Home Safety Monitor to the Ubidots server using UDP Packets.
Every packets requires a TOKEN. The easiest way to get yours is clicking on “API Credentials” under your profile tab:
You’ll notice there are two types of keys in your Ubidots account:
- Tokens: Temporary and revocable keys that is to be embedded in all your API requests.
- API Key: This is your “Master Key”; a unique and immutable key that is used only to generate your account’s tokens.
Take a note of all the parameters – >Device Label, Device ID, Variable ID and Token. We will be using it in the code.
Step 7 – CodingNow you can upload the below code to your arduino. You will find the code in the description.
Before uploading, you will have to add a few things to the code
Get Complete Code and Instructions from Here – Arduino Home Safety Monitor Code
Now it’s time to upload the code
Code Explained
What this code does is,
- It will initialize Serial communication and BME module.
- It will connect to a wifi network and obtain an IP Address
- Once it gets an IP Address, it will start to read sensor values from analog pins and stores it into variables.
- Once we get the data, UDP packets are created in this form and are sent to Ubidots Server.
These packets will be received by the ubidots server which extract the values and will be stored in the respective variables.
These widget provides a wonderful graphical representation of the data and will be displayed on the dashboard.
Testing
Now power on the circuit and bring a light source or an LPG source close to the sensor board. You will find the graphs being changed in real time. You can access this dashboard and monitor your home from anywhere in the world.
Comments