Home automation using relay

April 4, 2021

Home automation using relay

April 4, 2021

Created By

Roshan Baig

My name is Roshan, I am 13 years old and I am in 7th standard. My hobbies are horse riding, robotics, and computer programming.

About This Project

Home automation using relay For my robotics class graduation, I got the idea to do this

Components Required

  • Arduino UNO
  • Power Relay, SPDT
  • PIR Motion Sensor (Genric)
  • Temperature Sensor
  • IR Receiver
  • 6 Pin Gas Sensor
  • LED Light Bulb, Frosted GLS
  • DC Motor
  • Buzzer, Piezo
  • Resistor 10k ohm
  • 9V battery
  • General Purpose Transistor NPN
  • 1N4007- High Voltage,High Current , Rated Diode
  • Resistor 1k ohm

Schematics

In this image all the components with the connections are given

Code Of Project

  // declare integer variables 
 int 
PIR = 
 0 
 ; 
 int 
temp = 
 0 
 ; 
 int 
IR = 
 0 
 ; 
 int 
gas = 
 0 
 ; 
 void 
 setup 
 ( 
 ) 
 { 
 // declare inputs 
 pinMode 
 ( 
 6 
 , 
INPUT ) 
 ; 
 pinMode 
 ( 
 7 
 , 
INPUT ) 
 ; 
 pinMode 
 ( 
 5 
 , 
INPUT ) 
 ; 
 pinMode 
 ( 
 4 
 , 
INPUT ) 
 ; 
 // declare outputs 
 pinMode 
 ( 
 13 
 , 
OUTPUT ) 
 ; 
 pinMode 
 ( 
 12 
 , 
OUTPUT ) 
 ; 
 pinMode 
 ( 
 11 
 , 
OUTPUT ) 
 ; 
 pinMode 
 ( 
 10 
 , 
OUTPUT ) 
 ; 
 // begin the serial port with a baud rate of 9600 
Serial . 
 begin 
 ( 
 9600 
 ) 
 ; 
 } 
 void 
 loop 
 ( 
 ) 
 { 
 // declare variables 
PIR = 
 digitalRead 
 ( 
 4 
 ) 
 ; 
temp = 
 analogRead 
 ( 
 5 
 ) 
 ; 
IR = 
 digitalRead 
 ( 
 7 
 ) 
 ; 
gas = 
 analogRead 
 ( 
 6 
 ) 
 ; 
 // if else statements 
 if 
 ( 
temp >= 
 500 
 ) 
 { 
 digitalWrite 
 ( 
 12 
 , 
HIGH ) 
 ; 
Serial . 
 println 
 ( 
 "fan on" 
 ) 
 ; 
 } 
 else 
 { 
 digitalWrite 
 ( 
 12 
 , 
LOW ) 
 ; 
Serial . 
 println 
 ( 
 "fan off" 
 ) 
 ; 
 } 
 if 
 ( 
PIR == 
 1 
 ) 
 { 
 digitalWrite 
 ( 
 13 
 , 
HIGH ) 
 ; 
Serial . 
 println 
 ( 
 "lights on" 
 ) 
 ; 
 } 
 else 
 { 
 digitalWrite 
 ( 
 13 
 , 
LOW ) 
 ; 
Serial . 
 println 
 ( 
 "lights off" 
 ) 
 ; 
 } 
 if 
 ( 
gas >= 
 200 
 ) 
 { 
 digitalWrite 
 ( 
 10 
 , 
HIGH ) 
 ; 
Serial . 
 println 
 ( 
 "gas leak" 
 ) 
 ; 
 } 
 else 
 { 
 digitalWrite 
 ( 
 10 
 , 
LOW ) 
 ; 
 } 
 if 
 ( 
IR == 
 1 
 ) 
 { 
 digitalWrite 
 ( 
 11 
 , 
HIGH ) 
 ; 
Serial . 
 print 
 ( 
 "signal received" 
 ) 
 ; 
 } 
 else 
 { 
 digitalWrite 
 ( 
 11 
 , 
LOW ) 
 ; 
 } 
 delay 
 ( 
 30 
 ) 
 ; 
 // delay 30 milliseconds to let things settle 
 } 
  
 
A person is using a laptop computer next to a robot.
By Siddhartha Kumar January 5, 2022
Robotics: Blessing and Curse? Robots have improved healthcare , surveillance, delivery of goods (drones), spacecraft, travel, logistics, etc.
A man is wearing a virtual reality headset and touching a screen.
By Tahreem Jamadar December 28, 2021
Is it time for 3D Printing to Adopt Blockchain Technology? Research has already shown 3D printing has a growing need for cybersecurity.
A group of children are sitting at a table making a robot.
By Dr. Heath Kirby-Miller December 25, 2021
Why STEM Education in Australia The Australian industries to be benefited from STEM include advanced information and communication technology
A red rc truck is sitting on top of a remote control.
December 12, 2021
Arduino IR remote controlled Car The project is arduino based project. the Links pf the projects are given below
A laptop computer is on a tripod on a table.
November 30, 2021
Animation Studios Mechatron Robotics project uses an Arduino uno R3 a LCD and push buttons. It is based on the concept of arduino and LCD
A young boy wearing headphones is using a laptop computer.
By Kiran Gupta November 30, 2021
Machine Learning for Disables can help those disabled people to improve their lives. With the marvel of machine learning doctors
A man wearing a virtual reality headset is working on a robotic arm.
By Kiran Gupta November 7, 2021
What are the Consequences of Not Embracing Robotics & AI? We won’t be able to go ahead as these are the next big things.
A person is holding a remote control in a living room.
November 4, 2021
Home Automation System is made because today's light bulbs tend to heat and this can cause blast in the house.
A close up of a bottle of vaccine with a virus in the background.
By Rajesh Sharma November 1, 2021
Robotics and the Pandemic 2020. This is where Robotics can come in, robots can help reduce the human contact.
A person is playing with a robotic head on a table.
By Siddhartha Kumar November 1, 2021
Key Elements Most of the Schools are Missing. Everyone has different criteria but one key element remains the same:” The quality of teaching
Show More
A person is using a laptop computer next to a robot.
By Siddhartha Kumar January 5, 2022
Robotics: Blessing and Curse? Robots have improved healthcare , surveillance, delivery of goods (drones), spacecraft, travel, logistics, etc.
A man is wearing a virtual reality headset and touching a screen.
By Tahreem Jamadar December 28, 2021
Is it time for 3D Printing to Adopt Blockchain Technology? Research has already shown 3D printing has a growing need for cybersecurity.
A group of children are sitting at a table making a robot.
By Dr. Heath Kirby-Miller December 25, 2021
Why STEM Education in Australia The Australian industries to be benefited from STEM include advanced information and communication technology
A red rc truck is sitting on top of a remote control.
December 12, 2021
Arduino IR remote controlled Car The project is arduino based project. the Links pf the projects are given below
A laptop computer is on a tripod on a table.
November 30, 2021
Animation Studios Mechatron Robotics project uses an Arduino uno R3 a LCD and push buttons. It is based on the concept of arduino and LCD
A young boy wearing headphones is using a laptop computer.
By Kiran Gupta November 30, 2021
Machine Learning for Disables can help those disabled people to improve their lives. With the marvel of machine learning doctors
A man wearing a virtual reality headset is working on a robotic arm.
By Kiran Gupta November 7, 2021
What are the Consequences of Not Embracing Robotics & AI? We won’t be able to go ahead as these are the next big things.
A person is holding a remote control in a living room.
November 4, 2021
Home Automation System is made because today's light bulbs tend to heat and this can cause blast in the house.
A close up of a bottle of vaccine with a virus in the background.
By Rajesh Sharma November 1, 2021
Robotics and the Pandemic 2020. This is where Robotics can come in, robots can help reduce the human contact.
Show More