• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Skip to footer
Circuits Gallery

Circuits Gallery

All about Electronics and Circuits

  • Home
  • Basics
    • Components
    • Oscillators
    • Waveform Generators
  • Project
    • Using 555 Timer
    • Using Op-Amp
  • MicroController
    • PIC
  • Arduino
  • Simulation
    • Matlab
    • Proteus
  • Digital
    • Counters
  • Communication
  • How To
  • About Us

Home Automation and Security System using Microcontroller ATMEGA8 with Arduino Programming

May 1, 2022 by Charles Clark Leave a Comment

Home automation and security systems have become very popular these days, today industrial automation techniques are widely adopted by luxurious homes and apartments. Here we’re going to give a worthy home automation security and monitoring project for engineering students. On the whole, this microcontroller-based home automation system with security performs the following series of processes, making it the best home automation system.

  • Sense the temperature level of the room and monitor it using LEDs.
  • Controls the temperature using an exhaust fan.
  • Automatically open and close the door to make fast temperature control.
  • Pump water if necessary, in case fire is detected.

I happened to develop this for a science fair exhibition in one of the schools. You can also make use of this kitchen automation as a major project for engineering or diploma final year.

Components required

  1. Arduino UNO
  2. IC 74138
  3. L293D
  4. Exhaust fan (12V)
  5. Vehicle glasswasher pump motor (12V)
  6. MQ6 GAS sensor
  7. Thermistor (High resistance type)
  8. Transistor (BC548x3)
  9. Buzzer 5V
  10. LEDs (Greenx3, Yellowx3, Redx2)
  11. POT (10Kx2)
  12. Resistor (1Kx3, 10k)
  13. Relay 12V
  14. DVD loader tray
  15. 12v Power supply
  16. USB cable

Setting up the project

Built around ATMEGA8 microcontroller, the main advantage of this system is that it uses Arduino programming which makes the easy embedding of the program and at the end of the day it leads to a drastic reduction of cost from about Rs.1500 to around Rs.80.

For demonstration purposes I have used a DVD loader assembly to open and close the door, it has an inbuilt open close sensor which I have used here. Moreover, the MQ6 GAS sensor for detecting the leakage of LPG is an added advantage of this project. When leakage is detected it should run an alarm and switch on the exhaust fan to reduce the density of GAS.

Circuit Diagram

Working of home automation and security system

Now let me get into the working of our home automation and security system section by section. The main sensors that I have used here are a thermistor to detect the temperature level and an MQ6 GAS sensor to detect the presence of LPG.

Thermistor Section

  • Firstly read the temperature value from the thermistor and monitor on LED with the help of 74328 IC which is a 3 to 8 decoder.
  • Two threshold values are used, first, one to enable the open/close of the door and the other one for the fire alarm.
  • The temperature level from the thermistor is checked. If the level is less than the first threshold then it does nothing. Else if it’s greater than the first threshold it opens the door with the help of the ‘ON-OFF touch switch’ (Eject button) in the DVD loader assembly, thereby switching on the exhaust fan.
  • If the temperature level is greater than the second threshold level (it means there will be a presence of fire) then the controller will switch on the water pump motor to extinguish the fire.

MQ6 GAS Sensor Section

  • Then the controller listens to the gas sensor output and compares it with a threshold value, when it’s greater than the threshold, the controller will switch the ON exhaust fan and make a buzzer ON and OFF to make a “beep” sound.
  • If the level comes down it switches off the fan and closes the door.

Programming Explanation

  1. Programming Steps
  2. Variable declaration
  3. Pin initialization
  4. User-defined sub-functions
  5. Infinite Loop

Variable Declaration

  • Declare four variables A,B,C,D.
  • A →Stores the value read from thermistor via analog pin ADC0.
  • B→Stores the mapped values of ‘A’.
  • As the Arduino has a 10bit ADC the value can vary from 0 to 1023. To monitor these analog temperature values using 8 LEDs we have to map 0→1023 to 0→8. These mapped values are stored on an integer variable ‘B’.
  • C →Store the analog value read from the MQ6GAS sensor through analog pin ADC1.
  • D →Stores mapped values of ‘C’.
  • Here mapping to 0-100 (Just to get a threshold for the program).

Pin Initialization

Next, initialize the input and output pins which include analog and digital pins. Here we are specifying whether the pin is input or output, pin Mode command is used for it.

User-Defined Sub Functions

Then create separate sub-functions for the open door, close door, buzzer, water pumping, fan ON, and fan OFF.

Infinite Loop

  • In the loop function, analog values are read from both thermistor and GAS sensor and then mapped to corresponding variables.
  • Then it checks the temperature value and then sets the corresponding pins as a binary value (pin 0, 1, 2 in Arduino), which is decoded by a 3 to 8 decoder IC 74138. It then drives corresponding LEDs.
  • It then checks the GAS sensor mapped value if it’s greater than 50 (threshold) then turns ON the fan and makes the buzzer ON for some time and then the fan is switched OFF.
  • Checks the temperature level and if the value is in between 3 (first threshold) and 6 (second threshold), then open the door and turn ON the fan.
  • If the value becomes less than 3 it switches OFF the fan and closes the door.
  • If the door is either fully opened or fully closed then the controller stops the current supply to the door motor, thereby saving current and ensuring the long life of the door motor. It is achieved via special arrangements in the DVD loader.

  • When the door fully opens, the middle pin of the DVD loader gets connected to +5V. Similarly, when it’s fully closed it gets connected to the ground supply, the middle pin is connected to the controller and it disconnects the motor supply according to the values of this input.
  • In case the temperature level exceeds the value 6 (indicates the presence of fire) then it switches ON the water pump and makes a buzzer ON sometimes.
  • When the temperature level decreases, turn OFF the water pump.

Conclusion

Arduino nowadays excessively used for home automation projects. By following the above article you can easily make yours for your home or project showcasing competitions.

Filed Under: Arduino, Project

Reader Interactions

Leave a Reply Cancel reply

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

Primary Sidebar

More To See

Capacitor vs Inductor

Capacitor vs Inductor | Passive Components Comparison

How to Determine Line and Load Wires

How to Determine Line and Load Wires?

How to Ground a Subpanel in a Detached Building

How to Ground a Subpanel in a Detached Building

electron_moving

What Happens When Electrons Move from One Object to Another by Direct Contact?

  • Arduino
  • Basics
  • Communication
  • Components
  • Counters
  • Digital
  • How To
  • Matlab
  • MicroController
  • Oscillators
  • PIC
  • Project
  • Proteus
  • Simulation
  • Using 555 Timer
  • Using Op-Amp
  • Waveform Generators

Footer

QUICK LINKS

  • About Us
  • Privacy Policy
  • Terms and Conditions
  • Contact
  • Arduino
  • Basics
  • Communication
  • Components
  • Counters
  • Digital
  • How To
  • Matlab
  • MicroController
  • Oscillators
  • PIC
  • Project
  • Proteus
  • Simulation
  • Using 555 Timer
  • Using Op-Amp
  • Waveform Generators

AFFILIATE DISCLOSER

Circuits Gallery is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for website owners to earn advertising fees by advertising and linking to amazon (.com, .co.uk, .ca etc) and any other website that may be affiliated with Amazon Service LLC Associates Program

© 2022 · Circuits Gallery | All Rights Reserved