28-01-2013, 10:07 AM
Automatic Room Lighting Controller Using 89s52
1Automatic Room Lighting.doc (Size: 590.5 KB / Downloads: 41)
AIM OF THE PROJECT
The main objective of this project is to develop an Automatic Door opening system using IR sensors which will reduce the need of manual labor and to control the lighting in the room using LDR sensors.
METHODOLOGY
According to our project requirements, the following modules are
essential.
• Power supply
• Microcontroller
• DC Motor
• IR sensors
• LDR sensor
• LCD display
SIGNIFICANCE AND APPLICATIONS
Automatic door opening system and room illumination control using IR and LDR sensors plays a very important role in domestic applications. The elimination of manual supervision adds up as an additional advantage for its usage. Its significance can be proved by considering the following specialties of kit designed by us
• Reliability: Reliability is one such factor that every electrical system should have in order to render its services without malfunctioning over along period of time. We have designed our kit using AT8952 micro controller which is itself very reliable and also operates very efficiently under normal condition
• Cost: The design is implemented at an economical price.
• Simple Technology: This project uses a relatively simple technology, thus reducing the strain to a good extent.
ORGANIZATION OF THE REPORT
The report totally consists of seven chapters -Chapter 1 gives the introduction to the project, Chapter 2 provides the block diagram, Chapter 3 gives the introduction to embedded systems, Chapter 4 explains about the schematic of the project, Chapter 5 explains in detail about the components used in our project, chapter 6 provides a compact project description and the source code, chapter 7 gives the result of the project, chapter 8 gives the conclusion, chapter 9 gives the bibliography and chapter 10 gives the appendix.
DESCRIPTION
An Embedded system is a special-purpose computer system designed to perform one or a few dedicated functions, sometimes with real time computing constraints. It is usually embedded as a part of a complete device including hardware and mechanical parts. Some of the main devices used in embedded products are Microprocessors and Microcontrollers. Microprocessors are commonly referred to as general purpose processors as they simply accept the inputs, process it and give the output. In contrast, a microcontroller not only accepts the data as inputs but also manipulates it, interfaces the data with various devices, controls the data and thus finally gives the result. since the embedded system is dedicated to few specific tasks, design engineers can optimize it, reducing the size and the cost of the product or increasing the reliability and performance.
For example, handheld computers share some elements with embedded system such as the operating systems and microprocessors which power them but are not truly embedded system, because they allow different applications to be loaded and peripherals to be connected. The program is written to the system memory in this case rather than being loaded into the RAM, as programs on a personal computer are.
The main purpose of the microprocessors are simplify the system design and improve flexibility. In the embedded systems, the software is often stored in a read only memory (RAM) chip. Embedded systems provide several major functions including monitoring of the analog environment by reading data from sensors and controlling actuators
EXAMPLES OF EMBEDDED SYSTEMS
Embedded systems are found in wide range of application areas. Originally they were used only for expensive industrial control applications, but as technology brought down the cost of dedicated processors, they began to appear in moderately expensive applications such as automobiles, communication and office equipments and television Today's embedded systems are so inexpensive that they are used in almost every electronic product in our life. Embedded systems are often designed for mass production.
COMPONENTS USED IN THIS PROJECT AND THEIR DESCRIPTION
MICROCONTROLLERS
Microprocessors and microcontrollers are widely used in embedded systems products. Microcontroller is a programmable device. A microcontroller has a CPU in addition to a fixed amount of RAM, ROM, I/O ports and a timer embedded all on a single chip. The fixed amount of on-chip ROM, RAM and number of I/O ports in microcontrollers makes them ideal for many applications in which cost and space are critical.
The Intel 8051 is Harvard architecture, single chip microcontroller (µC) which was developed by Intel in 1980 for use in embedded systems. It was popular in the 1980s and early 1990s, but today it has largely been superseded by a vast range of enhanced devices with 8051-compatible processor cores that are manufactured by more than 20 independent manufacturers including Atmel, Infineon Technologies and Maxim Integrated Products.
8051 is an 8-bit processor, meaning that the CPU can work on only 8 bits of data at a time. Data larger than 8 bits has to be broken into 8-bit pieces to be processed by the CPU. 8051 is available in different memory types such as UV-EPROM, Flash and NV-RAM.
Machine cycle for the 8051:
The CPU takes a certain number of clock cycles to execute an instruction. In the 8051 family, these clock cycles are referred to as machine cycles. The length of the machine cycle depends on the frequency of the crystal oscillator. The crystal oscillator, along with on-chip circuitry, provides the clock source for the 8051 CPU.
The frequency can vary from 4 MHz to 30 MHz, depending upon the chip rating and manufacturer. But the exact frequency of 11.0592 MHz crystal oscillator is used to make the 8051 based system compatible with the serial port of the IBM PC.
In the original version of 8051, one machine cycle lasts 12 oscillator periods. Therefore, to calculate the machine cycle for the 8051, the calculation is made as 1/12 of the crystal frequency and its inverse is taken.
SOFTWARE COMPONENTS
KEIL COMPILER:
Keil compiler is software used where the machine language code is written and compiled. After compilation, the machine source code is converted into hex code which is to be dumped into the microcontroller for further processing. Keil compiler also supports C language code.
PROLOAD:
Proload is software which accepts only hex files. Once the machine code is converted into hex code, that hex code has to be dumped into the microcontroller and this is done by the Proload. Proload is a programmer which itself contains a microcontroller in it other than the one which is to be programmed. This microcontroller has a program in it written in such a way that it accepts the hex file from the keil compiler and dumps this hex file into the microcontroller which is to be programmed. As the proload programmer kit requires power supply to be operated, this power supply is given from the power supply circuit designed above. It should be noted that this programmer kit contains a power supply section in the board itself but in order to switch on that power supply, a source is required. Thus this is accomplished from the power supply board with an output of 12volts.
INFRARED IN ELECTRONICS:
Infra-Red is interesting, because it is easily generated and doesn't suffer electromagnetic interference, so it is nicely used to communication and control, but it is not perfect, some other light emissions could contains infrared as well, and that can interfere in this communication. The sun is an example, since it emits a wide spectrum or radiation.
IR SENSOR:
An infrared sensor is an electronic device that emits and/or detects infrared radiation in order to sense some aspect of its surroundings. Infrared sensors can measure the heat of an object, as well as detect motion. Many of these types of sensors only measure infrared radiation, rather than emitting it, and thus are known as passive infrared (PIR) sensors.
Working of IR sensor is very simple and working principle is totally based on change in resistance of IR receiver which is similar to LDR (light dependent resistor) and reflection of light.
LIGHT DEPENDENT RESISTOR (LDR)
LDRs or Light Dependent Resistors are very useful especially in light/dark sensor circuits. Normally the resistance of an LDR is very high, sometimes as high as 1,000,000 ohms, but when they are illuminated with light, the resistance drops dramatically.
Thus in this project, LDR plays an important role in controlling the electrical appliances based on the intensity of light i.e., if the intensity of light is more (during daytime) the loads will be in off condition. And if the intensity of light is less (during nights), the loads will be switched on.
ADC 0804
Analog to digital converters find huge application as an intermediate device to convert the signals from analog to digital form. These digital signals are used for further processing by the digital processors. Various sensors like temperature, pressure, force etc. convert the physical characteristics into electrical signals that are analog in nature.
ADC0804 is a very commonly used 8-bit analog to digital convertor. It is a single channel IC, i.e., it can take only one analog signal as input. The digital outputs vary from 0 to a maximum of 255. The step size can be adjusted by setting the reference voltage at pin9. When this pin is not connected, the default reference voltage is the operating voltage, i.e., Vcc. The step size at 5V is 19.53mV (5V/255), i.e., for every 19.53mV rise in the analog input, the output varies by 1 unit. To set a particular voltage level as the reference value, this pin is connected to half the voltage.
DC MOTOR
A DC motor is an electric motor that runs on direct current (DC) electricity. DC motors were used to run machinery, often eliminating the need for a local steam engine or internal combustion engine. DC motors can operate directly from rechargeable batteries, providing the motive power for the first electric vehicles. Today DC motors are still found in applications as small as toys and disk drives, or in large sizes to operate steel rolling mills and paper machines.
In this project DC motor is connected to open and close the door by rotating it in forward and in reverse direction. The program is designed in such a way initially when the power is on , input 1 (pin 2) and input 2(pin 7) of driver L293D will be low( logic 0) so that the motor will be in a stationary mode and also the door connected to it will also be in a stationary mode.(Generally the door will be closed initially).When a person is sensed by IR sensor IN 1 becomes high and IN 2 will be low and the motor rotates in forward direction so that the gets opened. Then automatically after some delay 1N 1 becomes low and IN2 will be high and the motor rotates in reverse direction so that the door will be closed.
WORKING PROCEDURE
This project is useful in all applications where controlling the entry and exit into a room is needed. In this project we also control the room light. Use of embedded technology makes this closed loop feedback control system efficient and reliable. Micro controller (AT89S52) allows dynamic and faster control. AT89S52 micro controller is the heart of the circuit as it controls all the functions.
Two IR TX – RX pairs are used in this project to identify the entry or exit of the person. These two IR TX – RX pairs are arranged each one on one side of the door i.e. one at the entry of the room and other inside the room. The TX and RX are arranged face to face across the door so that the RX should get IR signal continuously.
Initially the door is closed. Whenever any person comes in front of the door, the IR RX identifies it since the IR signal gets disturbed. Then the microcontroller opens the entry door by rotating the stepper motor. After some delay, the door will be closed.
After the person finishes his task and wants to leave the room, he stands near the door, the second IR pair placed on the other side of the door detects the person and then opens the door for the person to leave. The microcontroller closes the door only after the person exits out. And again the entry door sensor will be waiting for the person to enter.