in this technological world, automatic systems are being preferred over manual system. In this series Home Automation plays an important role for humans. In this unit we talk about basic needs to understand the project well and also for its future advancements.
We are going to talk about different types of sensors (i.e. Temperature Sensor, LPG Gas Sensor, LDR) and input and output devices (i.e. 2×2 matrix Keypad, Buzzer, DC Motor, 16×2 Char LCD Display, Power Supply section etc.). Now we are going to Interface all those with the brain of the system ‘Microcontroller (i.e. ATmega16/16L)’ and let’s find out what the individual role of each component are and how they act as Smart Home System together.
AVR (ATmega16/16L- 8 bit) MICROCONTROLLER
It is the whole control of the project. It controls the DC Motor, Buzzer and when LPG leak occurs, Temperature increases etc. The input/ output ports of the microcontroller is used for this.
LDR is used to check Sun light intensity; so that we can know it is Day or Night.
LM35 Temp Sensor
It is used to measure room temperature and give it to microcontroller for desirable action.
16×2 Char LCD Display
It is used to display all sensors’ value and action taken by system on display.
2×2 Matrix Keypad
It is used for enter password to access the door.
It is used for opening and closing the door.
Working Principle and Circuit
In this project I used three analog sensors i.e. Temp, LPG Gas and LDR. These are given analog output. So as per interfacing required, I connected all the analog output of the sensors to in-build ADC to get digital values and keypad, DC Motor, LCD Display, buzzer, transistors and LED to i/o pins of the microcontroller. For connections, please refer schematic diagram as given below.
Now when power on, first Red LED indicates the power status of the system and if it is then all peripherals are initialized and their current value will be displayed on LCD after welcome message ‘WELCOME TO SMART HOME’. Now every sensor has their threshold value according to ADC conversion mentioned in C Source Code according to the requirements and all o/p device are controlled by microcontroller based on sensors output and act accordingly. We can change those threshold values according to our need by changing in C Source code any time.
For better understanding, let’s take the example of Temp sensor. After ADC process, in my project I assign 50*C as a threshold for temp sensor. So when the temp sensor’s ADC value rises more than its threshold value that point of time microcontroller gives signal to buzzer for beeping and LCD to display ‘Temp Increased’ and if value is under the threshold value, then everything is normal. So like this, every sensor has its threshold value and microcontroller always compare the current ADC value with threshold value and if it exceeded, desirable action takes place by the microcontroller.
This home automation project has three different LED with different colour. First is Red colour LED, which indicates about power supply in the system. Second is Blue colour, which indicates the LPG Gas leakage and third is White colour which indicates the ON/OFF state of transistors.
I have also interfaced a 2×2 Matrix keypad which is used to type password to open the door.
In my code, ‘123’ is the password to open the door. When you pressed ‘123’ by keypad shown in diagram and a ‘enter’ button is also there with ‘enter’ signed. When you pressed ‘enter’ button, your current password is compared with password written in C source code. If it is right, then DC motor rotates and door will be open, if wrong then a short beep by buzzer and a message ‘Wrong Pass’ will be displayed on LCD. Now you have to try again.
So in this way every component and circuit has its individual role which is continuous monitored by microcontroller.
MICROCONTROLLER CIRCUIT WITH PHERIPHERALS
Power supply for the complete unit can be derived from the mains using a step-down transformer of 230V AC primary to 0-12V, 500mA secondary. A full- wave rectifier followed by a capacitor filter is the output voltage and feeds it to the 5-volt regulator (LM7805) whose output is used to the power supply requirements of microcontroller circuit, other IC’s.
An automated home can be easily implemented with the grouping of simple controls or it can be more compelled if we are going to use electrical appliances or remote controlled electrical appliances. A compelled system cost more than this in different parameters.
Well more knowledge is gained and more experiences are faced. Lot of information’s are collected ultimately, I have concluded with a great pleasure for achieving our aim.
Read more: Smart Home Automation using AVR