microcontroller based home automation with visitor counter

30
Microcontroller Based Home Automation ABSTRACT: Electricity is one of the most important resources in this century. We should conserve the electricity; otherwise next generations may have to live without Electricity. But many times we come outside the room/hall and forget to turn off the lights/fan, thus the electricity is wasted. Also in most cases switches of lights and fan are located inside the room and so we may have to search them in darkness and in case of guests, it becomes more difficult. To overcome these problems we have planned to implement a project called “microcontroller based room automation”. This project has 2 parts. First is “Person counter” and the other one is “Automatic room light and temperature controller with a temperature and light intensity display”. The first part is to count and display the number of persons entering in any room which can be used in large rooms like seminar halls, conference rooms, theatres etc to decide the no of seats remaining. When number of persons inside the room is zero, power supply inside the room can be cut using a TRIAC and when somebody enters the room, the system automatically measures the temperature and light intensity inside the room and accordingly controls the light and fan. During daytime lights will not be operated and during cold season fan may not be operated. This helps to save electricity and reduces our effort. LCD display placed outside the room displays number of person inside the room, temperature and light intensity.

Upload: tj-ideaforinnovation

Post on 20-Mar-2017

153 views

Category:

Engineering


1 download

TRANSCRIPT

Page 1: Microcontroller Based Home  Automation with visitor counter

Microcontroller Based Home AutomationABSTRACT: Electricity is one of the most important resources in this century. We should conserve the electricity; otherwise next generations may have to live without Electricity. But many times we come outside the room/hall and forget to turn off the lights/fan, thus the electricity is wasted. Also in most cases switches of lights and fan are located inside the room and so we may have to search them in darkness and in case of guests, it becomes more difficult. To overcome these problems we have planned to implement a project called “microcontroller based room automation”. This project has 2 parts. First is “Person counter” and the other one is “Automatic room light and temperature controller with a temperature and light intensity display”. The first part is to count and display the number of persons entering in any room which can be used in large rooms like seminar halls, conference rooms, theatres etc to decide the no of seats remaining. When number of persons inside the room is zero, power supply inside the room can be cut using a TRIAC and when somebody enters the room, the system automatically measures the temperature and light intensity inside the room and accordingly controls the light and fan. During daytime lights will not be operated and during cold season fan may not be operated. This helps to save electricity and reduces our effort. LCD display placed outside the room displays number of person inside the room, temperature and light intensity.

Page 2: Microcontroller Based Home  Automation with visitor counter

INTRODUCTIONEnergy crisis is the main problem that we are facing nowadays. So the conservation of energy is relevant in this occasion. The objective of this project is to overcome this problem. This project has 2 parts. First is “Person counter” and the other one is “Automatic room light and temperature controller with a temperature and light intensity display”. In today’s world, there is a continuous need for automatic ppliances. With the increase in standard of living, there is a sense of urgency for developing circuits that would ease the complexity of life. The temperature and light intensity in the room is sensed and with respective to that, light and fan in the room is switched ON/OFF when a person enters/leaves the room. The circuit consists of IR transmitter and receiver LEDs which are used to sense the entering or leaving of a person to or from the room. The temperature sensor measures the temperature inside the room and the analog signal from the sensor is processed by the microcontroller. Likewise the Light dependant resistor (LDR) generates the analog signal proportional to the available light inside the room. This signal is also processed by the microcontroller. The speed of the fan and brightness of the light is controlled accordingly. Whenever the person leaves the room, light and fan will be switched OFF. The circuit which we have designed is simple and compact. With the help of some software tools, we were able to develop the required coding and burn it to the Integrated circuit. This Project ―Microcontroller based room automation is a reliable circuit that takes over the task of controlling the room lights as well us counting number of persons/ visitors in the room very accurately. When somebody enters into the room then the counter is incremented by one and the light in the room will be switched ON and when any one leaves the room then the counter is decremented by one. The same is done with the fan also. The light will be only switched OFF until all the persons in the room go out. The total number of persons inside the room is also displayed on the seven segment displays. The microcontroller does the above job. It receives the signals from the sensors, and this signal is operated under the control of software which is stored in ROM. Microcontroller ATMEGA328 continuously monitor the Infrared Receivers, When any object pass through the IR Receiver's then the IR Rays falling on the receiver are obstructed , this Thus this project will provide more convenience and comfort for the user. More than that it saves a appreciable amount of energy. The only disadvantage is that the initial cost of establishment is high. This project can be implimentd in malls, offices, schools, etc.

Page 3: Microcontroller Based Home  Automation with visitor counter

Block diagram of this project is shown above. It consists of seven blocks .

1. Power Supply

2. Microcontroller

3. Person counter

4. Temperature sensor

5. Light intensity sensor

6. Light and fan control

7. Display

Page 4: Microcontroller Based Home  Automation with visitor counter

OVERVIEW ON AUTOMATIONHome/office automation is the control of any or all electrical devices in our home or office, whether we are there or away. Home/office automation is one of the most exciting developments in technology for the home that has come along in decades. There are hundreds of products available today that allow us control over the devices automatically, either by remote control; or even by voice command. A home automation system integrates electrical devices in a house with each other. The techniques employed in home automation include those in building automation as well as the control of domestic activities, such as home entertainment systems, houseplant and yard watering, pet feeding, changing the ambiance "scenes" for different events (such as dinners or parties), and the use of domestic robots. Devices may be connected through a computer network to allow control by a personal computer, and may allow remote access from the internet.

Power consumption comparison

CIRCUIT DIAGRAM AND EXPLANATION

Page 5: Microcontroller Based Home  Automation with visitor counter

Fig. 3 Schematic diagram

4.1 CIRCUIT DESCRIPTION

The main parts of our project are

™ 1.Transmission Circuit (Infrared LEDs)

™ 2. Receiver Circuit (Sensors)

™ 3. Light and temperature sensor

™ 4. Microcontroller

™ 5.power control unit

IR signal IR Transmission circuit is used to generate the IR waves.The circuit consists of two resistors of 220Ω and one resistor of 1kΩ. The D2 LED which is an IR LED will be continuously producing an IR wave which is received by theD3 LED. In this condition the transistor Q2 is off. Whenever the IR rays are cut, the transistor will be ON. This indicates the presence of a person in the room.

4.1.2 Light and temperature sensor

The light sensor used is LDR it provides analogue output proportional to the light intensity which is converted to digital by analogue to digital converter (ADC) available in the microcontroller. Similarly temperature sensor LM 35also gives analogue output that is converted to digital by ADC. The measured analogue value is compared to some Preset value in software. After analyzing the sensor readings signal is sent to the receiver for changing the power delivered to the loads.

Page 6: Microcontroller Based Home  Automation with visitor counter

Microcontroller

Microcontroller systemMicrocontroller essentially consists of Central Processing Unit (CPU), timers and counters, interrupts, memory, input/output ports, analog to digital converters (ADC) on a single chip . With this single chip integrated circuit design of the microcontroller the size of control board is reduced and power consumption is low. A temperature sensor has been used to measure the temperature of the room and the speed of the fan is varied according to the room temperature using PWM technique. The duty cycle is varied from 0 to 100 to control the fan speed depending upon the room temperature, which is displayed.

Page 7: Microcontroller Based Home  Automation with visitor counter

CIRCUIT DIAGRAM AND WORKING

Circuit Diagram

The person counter checks and counts the number of persons entering the room. This part of the circuit is implemented using two sets of IR transmitter and receiver. One set is placed at the outer side of the door and the other one is kept at the inner side of the door. When a person enters the room, he crosses the first IR firstly and second IR secondly. Reverse process occurs when anybody leaves the room. The microcontroller counts the number of persons inside the room, if it is not zero, the analog voltage output from temp sensor and LDR circuit are measured to find the temp & light. If these values are not in the required range, light intensity and fan speed are controlled accordingly using the TRIAC control circuit.

Page 8: Microcontroller Based Home  Automation with visitor counter

HARDWARE REQUIREMENTS1. ATMEGA16

2. Temperature sensor LM35

3. LDR

4. Resistors

5. Capacitors

6. Transistors

7. IR LEDs

8. LCD

9. Rectifier IC

MicroController

Features

• High-performance, Low-power Atmel® AVR® 8-bit Microcontroller

• Advanced RISC Architecture

– 131 Powerful Instructions

– Most Single-clock Cycle Execution

– 32 x 8 General Purpose Working Registers

– Fully Static Operation

– Up to 16 MIPS Throughput at 16 MHz

– On-chip 2-cycle Multiplier

• High Endurance Non-volatile Memory segments

– 16 Kbytes of In-System Self-programmable Flash program memory

– 512 Bytes EEPROM

– 1 Kbyte Internal SRAM

– Write/Erase Cycles: 10,000 Flash/100,000 EEPROM

– Data retention: 20 years at 85°C/100 years at 25°C(1)

– Optional Boot Code Section with Independent Lock Bits In-System Programming by On-chip Boot Program True Read-While-Write Operation

Page 9: Microcontroller Based Home  Automation with visitor counter

– Programming Lock for Software Security

• JTAG (IEEE std. 1149.1 Compliant) Interface

– Boundary-scan Capabilities According to the JTAG Standard

– Extensive On-chip Debug Support

– Programming of Flash, EEPROM, Fuses, and Lock Bits through the JTAG Interface

• Peripheral Features

– Two 8-bit Timer/Counters with Separate Prescalers and Compare Modes

– One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture Mode

– Real Time Counter with Separate Oscillator

– Four PWM Channels

– 8-channel, 10-bit ADC 8 Single-ended Channels 7 Differential Channels in TQFP Package Only 2 Differential Channels with Programmable Gain at 1x, 10x, or 200x

– Byte-oriented Two-wire Serial Interface

– Programmable Serial USART

– Master/Slave SPI Serial Interface

– Programmable Watchdog Timer with Separate On-chip Oscillator

– On-chip Analog Comparator

• Special Microcontroller Features

– Power-on Reset and Programmable Brown-out Detection

– Internal Calibrated RC Oscillator

– External and Internal Interrupt Sources

– Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, Standby and Extended Standby • I/O and Packages – 32 Programmable I/O Lines

– 40-pin PDIP, 44-lead TQFP, and 44-pad QFN/MLF

• Operating Voltages

– 2.7V - 5.5V for ATmega16L

– 4.5V - 5.5V

Page 10: Microcontroller Based Home  Automation with visitor counter

Light Emitting Diodes (LEDs)

A light-emitting diode (LED) is a two-lead semiconductor light source. It is a p–n junction diode, which emits light when activated.[4]When a suitable voltage is applied to the leads, electrons are able to recombine with electron holes within the device, releasing energy in the form of photons. This effect is called electroluminescence, and the color of the light (corresponding to the energy of the photon) is determined by the energy band gap of the semiconductor.

An LED is often small in area (less than 1 mm2) and integrated optical components may be used to shape its radiation pattern.[5]

Appearing as practical electronic components in 1962, [6] the earliest LEDs emitted low-intensity infrared light. Infrared LEDs are still frequently used as transmitting elements in remote-control circuits, such as those in remote controls for a wide variety of consumer electronics. The first visible-light LEDs were also of low intensity and limited to red. Modern LEDs are available across the visible, ultraviolet, and infrared wavelengths, with very high brightness.

MOTOR DRIVERS IC:

Page 11: Microcontroller Based Home  Automation with visitor counter

L298DFeatures

The L293D is a popular motor driver IC that is usable from 6 to12V, at up to 1A total

output current. By itself, the IC is somewhat difficult to wire and use, but the Compact L293D

Motor Driver makes it much more convenient to use.

Board Special Features 

Four motor direction indicator LEDS. Schottky EMF-protection diodes. Socket pin connectors for easy logic interfacing. Enable pins are user accessible.

Table 2.1 Controlling Of Motor Direction With Respect Input To Driver

Page 12: Microcontroller Based Home  Automation with visitor counter

Fig 2.15 Interfaceing Motor To Driver

LEFT M-

1LEFT M-2 RIGHT M-1 RIGHT M-2 Motion

1 0 1 0 Forward

0 1 0 1 Backward

0 1 1 0 Left

1 0 0 1Right

 

Table 2.2 Conditions Applied For Control the Direction Of Robotic Vehicle

Where, LEFT M-1 and LEFT M-2 are terminals of left motor and RIGHT M-1 & RIGHT

M-2 are terminals of right motor.

Page 13: Microcontroller Based Home  Automation with visitor counter

Fig 2.16 Interfacing of Motor to Motor Driver IC

Sensors:

• Temperature sensor• LDR light sensor• Metal detection sensors

LM35 Precision Centigrade Temperature Sensors

Page 14: Microcontroller Based Home  Automation with visitor counter

Fig 3.9 LM35 temperature sensor

F1eatures1• Calibrated Directly in Celsius (Centigrade)• Linear + 10-mV/°C Scale Factor • 0.5°C Ensured Accuracy (at 25°C) • Rated for Full −55°C to 150°C • Suitable for Remote Applications • Low-Cost Due to Wafer-Level • Operates from 4 V to 30 V • Less than 60-μA Current Drain • Low Self-Heating, 0.08°C in Still Air • Non-Linearity Only ±¼°C Typical • Low-Impedance Output, 0.1 Ωfor 1-mA Load

Applications

• Power Supplies • Battery Management • HVAC • Appliances

Description

The LM35 series are precision integrated-circuit temperature devices with an output voltage linearly- proportional to the Centigrade temperature. The LM35 device has an advantage over linear temperature sensors calibrated in Kelvin, as the use is not required to subtract a large constant voltage from the output to obtain convenient Centigrade scaling. The LM35 device does not require a external calibration or trimming to provide typical accuracies of ±¼°C at room temperature and ± over a full −55°C to 150°C temperature range. Lower cost is assured by trimming and calibration at the wafer level. The low-output impedance, linear output,and precise inherent calibration of the LM35 device makes interfacing to readout or control circuitry especially easy. The device is used with single power supplies, or with plus and minus supplies.

Page 15: Microcontroller Based Home  Automation with visitor counter

LIGHT DEPENDENT RESISTORS - LDR

Two cadmium sulphide(cds) photoconductive cells with spectral responsessimilar to that of the human eye. The cell resistance falls with increasing lightintensity. Applications include smoke detection, automatic lighting control,batch counting and burglar alarm systems.

Fig 3.10 LDR sensor

Page 16: Microcontroller Based Home  Automation with visitor counter

Applications

Photoconductive cells are used in many different types of circuits andapplications.Analog ApplicationsCamera Exposure ControlAuto Slide Focus - dual cellPhotocopy Machines - density of tonerColorimetric Test EquipmentDensitometerElectronic Scales - dual cellAutomatic Gain Control – modulated lightsourceAutomated Rear View Mirror

Sensitivity

The sensitivity of a photodetector is the relationship between the light falling on the device and the resulting output signal. In the case of a photocell, one is dealing with the relationship between the incident light and the corresponding resistance of the cell.

APPLICATIONS

When I leave home, It automatically  turn off all the lights .

Page 17: Microcontroller Based Home  Automation with visitor counter

When I get back at night, the path lights up to show me the way in the dark. Using Domintell’s home automation installation, I can set the atmosphere I prefer with one push of a button.

If the children forget to turn out the bathroom lights, the lights turn themselves off after a time I determine.

Lights come on automatically when I enter dark rooms – but only when the sun has gone down.

I can check my energy consumption on the screens, enabling me to create pro-active savings.

In some rooms, the light is on a timer so as not to waste light!

If outside lights are left on, the system sends me a message.

I can also block them from being turned on while there is daylight.

The automatic blinds mean I can benefit from the maximum of free energy from the sun.

When I leave home, it automatically goes into “eco” mode. So I don’t have to worry about forgetting to turn off lights or cut the heating.

This proto type can be applied for industrial automation.

Advantages of Home Automation

Page 18: Microcontroller Based Home  Automation with visitor counter

The inefficiency of operation of conventional wall switches can be overwhelmed using various home automation systems (without using conventional switching methods).

The loss of power can be reduced and manpower required for home automation is very less compared to conventional methods.

The IR, RF, android application, Arduino, Bluetooth, DTMF, etc., based home automation systems can be more efficient, provides ease of operation.

Provides safety from electrical power short circuits while using conventional wall switches to operate loads.

Home automation system with automated door locking and security cameras facilitates more security.

By using a home automation system, we can save a lot of time to operate home appliances from anywhere (without wasting time to move from office to home for just unlocking door for family members to enter the home).

Software Requirement

Software system

It is a remedies which plays a main role over the project integrating, actuating the hardware with automatic manner ,the software required for development are mentioned below.

.

3.1 Software details

Below specified software are used in developing printed circuit board and firmware to cruise the

vehicle.

Eagle cad

Avr Studio

Sina programmer

3.1.1 Eagle cad

Page 19: Microcontroller Based Home  Automation with visitor counter

Eagle stand for Easy Applicable Graphical Layout Editor is a successful PCB programming tool

which is intended to satisfy the requirements of the expert planners of the system. For more than

25 years, this software tool has been the PCB plot device of choice for an immense number of

electronic setup planners and designers around the globe. With a tremendous and element

building and reinforce bunch and an expansive domain, EAGLE offers significantly more than

faultless circuit plot.

Features:

1. Can be extended up to 999 sheets for building a schematic design

2. For all the sheets there are pre-viewing of the icon

3. Easy sorting of the designed sheets by just dragging and dropping the sheets.

4. reflexive prompting of contact cross references

5. Effective regeneration of parts by copying.

6. There is stability between both the schematic and the layout that is maintained.

7. The details or the comments on the schematic and the board can be given where needed.

Eagle-software can be divided into 3 parts: 1. Schematic-editor. 2. Layout-editor 3. Auto-router.

1. Schematic editor: Here it grants us to make typical representation of any of our own

outline. The significant point is to give great records of the whole outline and even it

grants different clients to see effortlessly.

Features:

Each and every line of schematic contains about 999 sheets per layout.

Individual sheets is associated with preview-icon

Page 20: Microcontroller Based Home  Automation with visitor counter

The supply or the power connections are generated automatically.

When a schematic is designed, the board is generated consequently.

The advantage of the hierarchical feature of schematic is that it will permit to divide the

schematic design for easy analysis

2. Layout editor: Here we can make our own particular format for our own schematic

configuration. Here we can effectively put the segments as indicated by our necessities

and copper-follows can be steered between those parts.

Features:

4X4m is the size of each board

Even we can place surface-device components

Rotation can be possible in 360-degree

Texts/words can be placed according to our convenient

DRC is used to check for the wrong connections

3. Auto router: This is a capable device so as to point the copper ways between the 2 parts.

It prompts in giving fruitful results in time without influencing the control components. It

keeps running on the various applications.

Features:

0.02mm is the dimension of single grid

Possible to generate is changed by adjusting the price issues.

Buried-paths are supported here.

Page 21: Microcontroller Based Home  Automation with visitor counter

16-layers can be supported at a time

3.1.2 Avr StudioAtmel® AVR Studio® 5 is the Integrated Development Environment (IDE) for creating and

troubleshooting implanted Atmel AVR® applications.

Fig 3.1 Shows Front View of AVR Studio Version 5

The AVR Studio 5 IDE gives you a consistent and simple to-use environment to compose,

construct, and troubleshoot your C/C++ and constructing agent code. Which is utilized to

Page 22: Microcontroller Based Home  Automation with visitor counter

produce a hex document which is to composed to microcontroller with an assistance of developer

and developer programming.

Steps involved to code and generate project hex file:

Step1:

Fig3.2Create a New Project

Step 2:

Fig 3.3 Select the Target Device for Which the Hex File is to be generated

Step3:

Page 23: Microcontroller Based Home  Automation with visitor counter

Fig 3.4 Write Code With C.

Step4: click on run compile, no errors result.

Step5: build target generate hex file.

3.1.3 Sina-ProgrammerSinaProg is burner programming with straightforward client likewise consolidates an AVR Fuse

mini-computer.

Page 24: Microcontroller Based Home  Automation with visitor counter

Fig 3.5 Shows Front View of Sina Programmer

It utilizes enhanced AVRDUDE 5.10 and underpins new ic and new records just the accessible

ports and baud rate choice is conceivable. It is a standalone basic programming and no

establishment is select the ic sort as ATmega16 and set the Programmer to USB asp and port to

USB (as seen at the base of window).Click on browse under Hex File and find the .Hex

document to click Program button under bits can also be programmed .

Future Developments and Improvements

There are a number of ways in which this device could be improved in any future development. In future we want to add humidity sensor to measure the humidity at room. Humidity sensor needed to control the humidity at room. Temperature sensor needed to control the temperature. More efficient software would also benefit the device and the means of upgrading the software on the MCU has been catered for our project. Using Triac instead relay that can be provided low power consume and given the more efficiency. Reducing the power losses in the system would increase the efficiency of the device .In future we use 4*3 keypad for password based door lock protection. One last major improvement would be to use as many surface mounted components as possible, particularly using a surface mounted MCU and resistors and as many other components that could be replaced with surface mounted equivalents. Future we will design a better & compact PCB and good quality circuit by using surface mounted component.

RESULT

Following are the results that we have got here. Whenever a person enters or leaves the room, IR sensor placed near the door senses and the count is incremented or decremented accordingly. Then the light and fan will be ON. By comparing the intensity of light and the room temperature with the set value, the brightness of light and the speed of the fan is controlled. 1 W incandescent lamp is used here as the light source and 1.5 A, 60 rpm sewing machine motor is used instead of fan.

CONCLUSION

Studies on energy consumption have shown that it is at a stage of retardation by the involvement of government and due to advance technological growth. Such a mechanism to improve not only energy consumption but also a comfortable living can be achieved by room automation technique. Since the technologies are growing day by day there will be more advanced automation techniques which can improve current life style and can save more energy will capture our market. by doing this project we came to the conclusion that even though we have developed a small part of automation in a single room, it can be extended using more components such that it could be installed in bigger rooms. By using the internet services more development can be done.

REFERENCES

[1] Ying-Wen Bai and Yi-Te Ku, “Automatic Room Light Intensity Detection and Control Using a Microprocessor and Light Sensors”,

IEEE Transactions on Consumer Electronics, Vol. 54, No. 3, AUGUST 2008

Page 25: Microcontroller Based Home  Automation with visitor counter

[2] Yong Tae Park, Pranesh Sthapit, Jae-Young Pyun, “Smart Digital Door Lock for the Home Automation”, SEPTEMBER 2009

[3] R.A.Ramlee, M.A.Othman, M.H. Leong , M.M.Ismail, S.S.S.Ranjit, “Smart Home System Using Android Application”, International

Conference of Information and Communication Technology, 2013

[4] Rozita Teymourzadeh, Salah Addin Ahmed, Kok Wai Chan, and Mok Vee Hoong, “Smart GSM Based Home Automation System”, 2013

IEEE Conference on Systems, Process & Control (ICSPC2013), Kuala Lumpur, Malaysia, 13 - 15 December 2013

[5] Jalpa Shah,Lokesh Pathrabe,Brijesh Patel, “Wireless Smart Power Saving System For Home Automation”, 2012 1st International

Conference on Emerging Technology Trends in Electronics, Communication and Networking, 2012

[6] John-Paul H. Knauss, Cheri Warren, Dave Kearns, “An Innovative Approach to Smart Automation Testing at National Grid”, IEEE, May,