Taking Care of your Family and Elders using Arduino based Real-Time Home Monitoring System

|

As I sat in the airport, waiting for my flight to board, I couldn’t help but think about all of the people back home. The elders in particular. In preparation for a long flight and remote work from now on, I had set up their house with COVID 19 filters that would last them about 6 months before needing to be replaced. All cameras are set up. It was important enough to me that they were comfortable and safe while being taken care of from a distance so it was worth every penny.

Why do we need a Home Monitoring System?

Taking care of elders from a distance comes with its own set of unique challenges. One thing we have to make sure is that the environment they live in is comfortable and safe, especially during this time, the age of COVID 19 where the quality of air plays a crucial part.

Home Safety Monitoring System in Action
Home Safety Monitoring System in Action

So, we thought of making something that could monitor the environmental conditions like room temperature, air quality, humidity, ambient light and alert us if something goes beyond normal. 

Real Time Home Monitoring System using Arduino

We made a portable real-time environmental monitoring system that will actively monitor all these environmental parameters and let you know if something goes wrong in an instant.

All this data will be updated in real-time on online dashboards which can be accessed from anywhere around the world anytime you want

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.

Real-Time Home Monitoring System Complete Video Tutorial

Components Needed

  • Arduino Nano 33 IoT
  • BME 280
  • 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 has an inbuilt wifi module that will come in handy.


Learn Arduino the Easy Way

Are 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, and a lot of DIY projects using Arduino. Check it Out!

arduino tutorial for beginners
Arduino Tutorial for Beginners

Lets start learning Arduino


Steps – How I made It

Step 1 – Designing the Circuit

Designing a PCB for your Project – The Easy Way

I use Altium Designer to draw the circuit and design the PCB. It is a powerful tool that can be used to design and create your own PCBs for your project as well as complex and multiplayer PCBs for industrial use. Here is the link to the Altium trial version. So make sure you check it out.

Smart Home Safety Monitoring Circuit
Smart Home Safety Monitoring Circuit

This is the circuit. Here we have Arduino Nano, a gas sensor, LDR, and a BME 280 sensor. This is the voltage input terminal, where we can connect a nine-volt battery or a 12-volt dc adapter. This 7805 voltage regulator will convert any voltage between 7 to 32 volt to a steady 5 volt supply. This 5v can be fed to Arduino and other components or if you are using  Arduino Nano you can connect this Vin directly to the Vin pin of Arduino. 

And then we have a gas sensor. There are different types of gas sensors depending on which gas you want to measure – there are methane sensors, carbon monoxide sensors, LPG sensors, you can choose the one depending on your needs. The output of the gas sensor is connected to pin a1 of Arduino. 

Then we have an LDR. A trimmer is connected at this point so that we can adjust the sensitivity of this LDR and the output of LDR is connected to pin a2 of Arduino. 

The BME 280 is the sensor that we will be used to sense the temperature, humidity as well as pressure. The Vcc pin of BME 280 is connected to 3.3 volts of Arduino, the ground is connected to the ground, and SDA and SCL are connected to SDA and SCL Arduino. Basically, this is our circuit.

Step 2 – The PCB Layout for Home Monitoring System

Once the circuit was finished and tested, I designed a compact PCB using Altium, where I can fix all the components neatly. Here you can see routing is on both sides of the board which means it is a dual-layer PCB.

Smart Home Safety Monitoring PCB Layout
Smart Home Safety Monitoring PCB Layout

Now all I have to do is export the Gerber file.

Step 3 – Getting the PCB Done

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?

I use Altium Designer to draw the circuit and design the PCB. It is a powerful tool that can be used to design and create your own PCBs for your project as well as complex and multiplayer PCBs for industrial use. Here is the link to the Altium trial version. So make sure you check it out.

I ordered PCB from PCBWay. PCBWay is a PCB manufacturer specializing in PCB prototyping, low-volume production, and neat and tidy PCB assembly.

Ordering PCBs from PCBWay
Ordering PCBs from PCBWay

To order your PCB from PCBWay, go to the PCBWay website and fill in the basic board details in the instant order form. From there you will be directed to a form where you can provide more elaborate board details. Update your board information in the PCB specification screen. On the next screen, you should be able to upload your Gerber file and submit it for review. Once the review is completed, all that is left is to add to the cart, make payment, and wait for your PCBs to arrive.

Once you get all the components and the PCB, 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. After soldering the PCB looks like this.

Step 4 – The Software Part – Arduino IoT Cloud

Here we are in the Arduino IoT cloud. Here you can see I have already created a device called a real-time room condition monitoring system. So if we go inside that you can see five variables named humidity, light, value, oxygen value, pressure, and temperature, and here you can see I have already linked this project to this Arduino board RP 2040 which is my Arduino Nano RP 2040 and below that under the network tab. 

Arduino IoT Cloud Project
Arduino IoT Cloud Project

I have entered my WIFI SSID and password which the board will be using to connect to the internet and send all the values to Arduino IoT Cloud. Here we have a dashboard that will help us to visualize all the parameters.

Dashboard
Dashboard

This is done by creating different panels for different variables and linking all the panels to the corresponding variables. If there is any change in temperature the value of the temperature changes and the gauge will change. The same goes for all the dashboards. 

Step 5 – Alright, Lets Start Coding

Now we will start coding. The advantage of using Arduino IoT Cloud is once you have set up your thing and all the variables it will automatically generate a skeleton code that will include all the variables and critical functions which is required to run the code. We just have to add the extra variables and the functions. 

#include "thingProperties.h"
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
#define SEALEVELPRESSURE_HPA (1013.25)

Adafruit_BME280 bme;

int ledPin = 13;

void setup() {
  Serial.begin(9600);
  delay(1500);
  initProperties();
  ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  setDebugMessageLevel(2);
  ArduinoCloud.printDebugInfo();

  bme.begin(0x76);
}

void loop() {
  ArduinoCloud.update();
  delay(1000);
  sensors();

}

void onHumidityChange() {
}

void onTempChange() {
}

void onAlertChange() {
}


void sensors() {
  lightValue = analogRead(A2);
  oxygenValue = analogRead(A1);
  pressure = bme.readPressure() / 100.0F;
  temp = bme.readTemperature();
  humidity = bme.readHumidity();


  Serial.print("Light = ");
  Serial.println(lightValue);
  Serial.print("Oxygen Level = ");
  Serial.println(oxygenValue);
  Serial.print("Temperature = ");
  Serial.println(temp);
  Serial.print("Humidity = ");
  Serial.println(humidity);
  Serial.print("Pressure = ");
  Serial.println(pressure);
  Serial.println("");

}

First, we’ll be adding all the libraries and declaring all the variables that we’ll be using in this project, which will help us to connect to Arduino IoT Cloud and communicate with BME280. Once it is done we will initialize the serial communication, communication with Arduino IoT Cloud, and then prepare the board to run the remaining code. 

In the loop function, we are simply calling two other functions. The first function is sensors. In the functions of the sensor, we’ll fetch all the data from the sensors and store it in different variables and print these values and the Arduino Cloud. The update function will update all these variables onto the Cloud. Now you can simply upload this code onto your board. That was easy right. Now I will do the demo. Watch the demo video below

Lets Turn It On!

Now, let’s do a demo. See what happens when I blow onto the board, cover it with my finger, increase the ambient light, etc.


Awesome Arduino Projects you DONT WANNA MISS!

Here is a list of the creative Arduino Projects implementing newer sensors and boards, which can be followed easily and are really interesting to implement. Even if you are a beginner and just started learning Arduino-based projects, following these tutorials will be easy. All of the below Arduino-based projects are well-explained step by step, with detailed tutorials on how to get started from scratch.

A Kid about to Program Digispark with DigiKeyboard Commands

DigiSpark as HID Keyboard – Complete DigiKeyboard Commands Explained

Digispark HID Keyboard functionality fully explained with step by step tutorial, examples and complete DigiKeyboard…
Read More
Building a Smart Home using Arduino UNO

Building a Home Automation using Arduino and Arduino IOT Cloud | Arduino IOT Projects

Build your very own home automation system using an Arduino Board, Arduino IoT Cloud, and…
Read More
Arduino UNO R4 Minina Specifications and Pin Mapping

We Have the New Arduino UNO R4 Minima | Everything You Need to Know

Everything you need to know about Arduino UNO R4 Minima – Specifications, Release Date, Projects…
Read More

Let’s Use Arduino To Take Charge Of The Bittle| Petoi Bittle The Arduino Programmable Robot

Hey, guys welcome back. How about making a DIY Arduino robot dog? What if the…

Read More

DIY Motion Triggered Halloween Prop using Arduino/Digispark | Halloween Project 2022

DIY Motion Sensor Trigger for your Halloween Prop – Complete Step by Step Instructions to…
Read More

Control your Home Devices using Arduino and your Favorite Personal Assistant!

Introduction In the previous video, we build an Alexa-controlled Door Locking System. So many people…

Read More

Give me more Awesome Projects!


Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *