loading

Smart Room project is aim to make a technology room for Parents,child's or for someone special. in this era we are able to watch every things in our room on internet by camera but still we are unable to feel the room status/condition like what's the temperature in our room or want to control the fan or heater according to room temperature. so this project aim is to make our traditional room into to smart room.

Smart Room project will use Genuino MKR1000 Wifi Enabled Board for controlling room hardware and we will use blynk app to control or view the room controls and thingspeak will store the room sensors & modules statics into cloud for future analysis.

Hardware List:

  • 1x Arduino MKR1000
  • 1x DHT22 Sensor For Temperature & Humidity
  • 1x LDR
  • 1x MQ2 Gas Sensor
  • 1x 10K Resistor
  • 1x 220 ohm Resistor
  • 1x 5V 4 Channel Relay Module
  • 1x Bread Board
  • 1x Male-Femalre Jumpier Cables Set
  • 1x Male-Male Jumpier Cables Set
  • 1x Fan
  • 1x Heater
  • 1x Power Bank for MKR1000 Power

Step 1: Start With LDR & MQ2

This step will demonstrate the use of LDR (Light dependent resistor) & MQ2 Gas Sensor. these both sensor are very important for our room. LDR will update us with Light Level and MQ2 indicate us if sensor sense the LPG Gas or any smoke in our room.

Please follow the fritizing digram and assemble the sensors on bread board according to diagram.

LDR Range >400 indicate the enough amount of light is available in room.

MQ2 Range <290 indicate the normal level of room if it exceeds the 400 then there is a problem in a room.

Code:

#define LDRPin A0
#define MQ2Pin A1

float GasValue;
float LDRValue;

void setup() {
  Serial.begin(9600);
}

void loop() {
  GasValue=analogRead(MQ2Pin);
  Serial.print("Gas Value:");
  Serial.print(GasValue);
  LDRValue=analogRead(LDRPin);
  Serial.print("\t Light%:");
  Serial.print(LDRValue);
  
  Serial.print("\r\n");
  delay(1000);

}

Step 2: Getting Room Temperature & Humidity With DHT22

This step will demonstrate a simple example of DHT22 and show you your room temperature & humidity on Serial Monitor. It's Humidity Range is 0-100% and Temperature range is -40 - 125°C that's why I prefer DHT22 as compared to DHT11.

Code:


#include <DHT.h>
//Constants
#define DHTPIN 7     // what pin we're connected to
#define DHTTYPE DHT22   // DHT 22  (AM2302)
DHT dht(DHTPIN, DHTTYPE); //// Initialize DHT sensor for normal 16mhz Arduino

//Variables
int chk;
float hum;  //Stores humidity value
float temp; //Stores temperature value

void setup()
{
  Serial.begin(9600);
  dht.begin();
}

void loop()
{
    delay(2000);
    //Read data and store it to variables hum and temp
    hum = dht.readHumidity();
    temp= dht.readTemperature();
    //Print temp and humidity values to serial monitor
    Serial.print("Humidity: ");
    Serial.print(hum);
    Serial.print(" %, Temp: ");
    Serial.print(temp);
    Serial.println(" Celsius");
    delay(10000); //Delay 2 sec.
}

Step 3: Blynk & Thingspeak

This step will demonstrate the basic understanding about Blynk App & Thingspeak.

Blynk App:

Blynk App is a drag-n-drop interface for IOT Devices. This is specially designed for those engineers who don't know who to code android app. just install this app and add the controls by drag-n-drop. please view the above video for basic demonstration of Blynk app utilization.

ThingSpeak:

Thingspeak is a cloud for IOT devices to send & receive message from and to devices.

For thingspeak just goto https://thingspeak.com/ and create an account and login to ThingSpeak and after that click on Channel Menu in the Top and Select My Channels and then Click on New Channel and
Enter the Details of Channels Like Name, Description, Fields Like Temperature,Humidity,Gas Level, Light Level and then Click on Save button. now take the Channel ID and put into Code. after that click on API Keys Tab and get the Write API Key and put into code. for particle demonstration of thing-speak please visit the Next Step.

Step 4: Finished Project

Assemble the sensors and Modules according to Diagram. Update the Pin Numbers in code according to your design.

Blynk App:

Download the Blynk app from play store or apple store and don't worry about design just scan the QR Code in blnk app and you will be done.

Note: Carefully handle the rely module as it's connected to 220V. try to enclose the Relay Module in Box as above visible in Pictures.

Code is available at Git Hub Click here

Now Setup has been Completed and now you are able to feel and control your room.

  • View the Temperature & Humidity of Room
  • Gas Level Indication
  • Light Level Indication
  • Control the Light, Heater, Fan, other electronics of room

For Live Demo watch this video https://youtu.be/-MwzvfsvGBE

I hope many of guys will implement this project in more easy & convenient way. best wishes for all of geeks.

I will be happy if any of you guys will ask questions.

Can i make the same project with an arduino uno and a wifi module?
<p>Yeah you can make the same project using arduino uno and esp8266 Module.</p>
<p>Thanks for sharing :)</p>
<p>You Welcome :)</p>

About This Instructable

547views

8favorites

License:

Bio: I have 6+ Years of experience in Web/Desktop Application Development and now a days i am working on IOT Projects.
More by afzal7:Smart Room Using MKR1000, Blynk App & ThingSpeak 
Add instructable to: