Introduction: Smart Homes (IOT Based With MQTT)

About: Hey people, I am elecronic enthusiastic person. Have great experience in embeded and great coder

Why This Home Automation?

What makes it different from other Home Automation Projects?

These are the main objectives of the project:

Energy conservation

• Security

• Safety(Accidental ALERTS)

• Sophistication

• Monitor & control your homes from any part of the world

Energy Conservation:

There are many Home Automation Devices available in the market. But they consume a lot of energy. The first objective of this project is to automate homes using minimal energy.

Security:

Another important objective is Security. We have many Burglar Alarms available. But does those products consume neither less energy nor less money? Or are those products versatile? The answer’s NO. Another main objective of this project is to make Automation Systems a versatile one.

Safety:

Don’t confuse security with safety. Here in my case safety means safety not you but to home you live. You would get alert in case of any fire in your home to your E-mail or phone and even alerts to your fire engine station. Another main objective of this project is to alert people with messages even any part of the world.

Step 1: Step 1:Components Used

1. Arduino Uno

2. Ethernet Shield

3. Motion Detector Sensor

4. Flame Sensor

5. LDR

6. Relay Module

7. Solenoid lock

8.BC139

9. Jumper Cables

Arduino Uno:

Arduino Uno is a microcontroller board based on the ATmega328P. It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header and a reset button. It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with an AC-to-DC adapter or battery to get started. Here the Arduino Uno is to interface with sensors and ATMEL microcontroller.

Ethernet Shield:

The Arduino Ethernet Shield connects your Arduino to the internet in mere minutes. Just plug this module onto your Arduino Board, connect it to your network with an RJ45 cable (not included) and follow a few simple steps to start controlling your world through the internet. Here the Ethernet Shield is uses to establish internet connection between our sensors and APP.

Motion Detector Sensor:

A motion detector is a device that detects moving objects, particularly people. Such a device is often integrated as a component of a system that automatically performs a task or alerts a user of motion in an area. Here also used to detect the motion of your movement and switches the light and fan ON. Also used for intruder alert, in case pets like cats and dogs that grows in your home it won’t detect them while the intruder alert is ON.

Flame Sensor:

A flame detector is a sensor designed to detect and respond to the presence of a flame or fire. Responses to a detected flame depend on the installation, but can include sounding an alarm, deactivating a fuel line (such as a propane or a natural gas line), and activating a fire suppression system. A flame detector can often respond faster and more accurately than a smoke or heat detector due to the mechanisms it uses to detect the flame. Here also used to detect the fire gives alert to your phone, E-mail and also the fire station.

LDR:

A LDR (or photoresistor) is a light-controlled variable resistor. The resistance of a photoresistor decreases with increasing incident light intensity; in other words, it exhibits photoconductivity. Here the fan and light depending on the intensity of the light inside the room.

Relay module:

A relay is an electrically operated switch. Many relays use an electromagnet to mechanically operate a switch, but other operating principles are also used, such as solid-state relays. Relays are used where it is necessary to control a circuit by a separate low-power signal, or where several circuits must be controlled by one signal. Here used as an electrically operated switch.

Solenoid lock:

Solenoids are basically electromagnets: they are made of a big coil of copper wire with an armature (a slug of metal) in the middle. When the coil is energized, the slug is pulled into the centre of the coil. This makes the solenoid able to pull from one end. Here the solenoid is used for lock and unlock door.

Step 2: Block Diagram

Step 3: Getting Started With Cayenne

I here used Cayenne to send and receive datas from sensors to server, from server to your microcontroller and also used to trigger to send E-mail and phone of yours. You can create an account from Mobile or online. Mobile is the easiest and fastest way. On the Sign Up page, enter your Name, Email and create a Password.

Choose Device:

Cayenne currently supports Raspberry Pi, Arduino and LoRa devices. Select the device you would like to get started with in your IoT project.


Getting started with Arduino:

From the video below you can easily get started with Arduino based development boards.

Step 4: Problem and Solution:

1) Energy conservation:

Problem:

In today’s world energy crisis is bigger problem. We often forget Turn OFF the lights and fans in your home or accidently Turn ON them.

Solution:

Considering a room, there would be motion sensor and photoresistor (LDR). The room’s light and Fan should Turn ON the basis of motion of person and the light intensity. By this way 25% of energy is conserved in a month.

2) Door unlock:

Problem:

What could you do if you lost your key? your roommate accidentally took your room key too. Misplacing keys. We have a lot of problems when it comes to keys, we also would have personally experienced.

Solution:

Changed key door lock into electronic mobile controlled door lock.

So you no need to worry about keys.

3) Intruder Alert:

Problem:

How can we get a thief red-handed when you are in any part of the world? If we people having pet it’s hard to differentiate the motion of your pet and burglar. These products are not new but cost reduction and energy consumption prioritize nowadays.

Solution:

Intruder alert is sent to your phone and E-mail which can also be sent to police with help of motion sensor and cayenne cloud. In case pets like cats and dogs that grows in your home it won’t detect them while the intruder alert is ON. A single motion sensor is used for multiple actions, so obviously cost is reduced. And it works on MQTT protocol.

4) FireAlert:

Problem:

We don’t know when the sensor malfunctions. The sensors like smoke sensors are used which won’t give a proper result.

Solution:

The flame sensor used give a better output than the smoke sensors. The alerts are given to your phone or E-mail even in any part of the world and also be given to the nearest fire station. This works on MQTT protocol and even the device gets malfunctions we could get alerts.

Step 5: Connections

1)Energy conservation:

  • The LDR is connected to the analog A0 pin.
  • The motion sensor is connected to the +5v, ground and GPIO 4 pins of Arduino.
  • Since it’s a prototype motor is used instead of fan and LED is used instead of light
  • The relay is connected to the external 12v supply, ground and channel one is connected to GPIO 6 which has motor (Fan).
  • The LED is triggered by a transistor BC139.The collector is given +5v, base to the GPIO 7 pin of Arduino.

2) Door unlock:

  • The Arduino is connected to the Ethernet shield.
  • The relay is connected to the external 12v supply, ground and channel one is connected to GPIO 8 which has solenoid lock.
  • The Ethernet is connected to the cayenne cloud.
  • The door can be locked and unlocked by the cayenne app.

3) Intruder Alert:

  • The motion sensor is connected to the GPIO pin 3 of the shield
  • The shield is connected to the cayenne cloud.
  • The cayenne has a trigger option.
  • So the trigger is added in the cayenne in order to give notification if there is any intruder when its turned ON.
  • This gives alert to your phone or E-mail and also give notification to the police stations.
  • Here I have given alerts to my phone and E-mail.

4) Fire alert:

  • The motion sensor is connected to the GPIO pin 3 of the shield
  • The shield is connected to the cayenne cloud.
  • The cayenne has a trigger option.
  • So the trigger is added in the cayenne in order to give notification if there is any fire when its turned ON.
  • This gives alert to your phone or E-mail and also give notification to the police stations

  • Here I have given alerts to my phone and E-mail.

Step 6: Controlling the Devices:

  • You can download cayenne app or log into the cayenne website and sign up.
  • We can control and monitor the devices either by the app or from the website.
  • The triggers are from the cloud which you would get it to your phone or E-mail.

Internet of Things Contest 2017

Participated in the
Internet of Things Contest 2017