Diese Präsentation wurde erfolgreich gemeldet.
Die SlideShare-Präsentation wird heruntergeladen. ×

Microcontroller ppt

Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Nächste SlideShare
8051 MICROCONTROLLER
8051 MICROCONTROLLER
Wird geladen in …3
×

Hier ansehen

1 von 15 Anzeige

Weitere Verwandte Inhalte

Diashows für Sie (20)

Ähnlich wie Microcontroller ppt (20)

Anzeige

Aktuellste (20)

Microcontroller ppt

  1. 1. Use of microcontroller 8051 IN LIGHT SENSING AND CONTROLLING DEVICES
  2. 2. Table of contents ● MICROCONTROLLER 8051 ● BLOCK DIAGRAM OF 8051 ● APPLICATIONS OF 8051 ● APPLICATION OF 8051 IN LIGHT SENSING AND CONTROLLING DEVICES ● INTENSITY METER USING 8051
  3. 3. MICROCONTROLLER 8051 Microcontrollers: It is a programmable integrated circuit (IC) that consists of a small CPU, RAM and I/O pins. Microcontroller units (MCUs) are widely used in many devices The 8051 microcontroller was invented in 1980's by Intel. Its foundation is based on Harvard architecture and this microcontroller was developed principally for bringing it to be used in Embedded Systems. the 8051 microcontroller had a 16-bit address bus for data transfer accompanied by an 8-bit data bus for carrying data for particular applications.the main features of 8051 are: ● 8-bit CPU through two Registers A & B. ● 8K Bytes – Internal ROM and it is a flash memory that supports while programming the system. ● 256 Bytes – Internal RAM where the first RAM with 128 Bytes from 00H to 7FH is once more separated into four banks through 8 registers in every bank, addressable registers -16 bit & general-purpose registers – 80. ● The remaining 128 bytes of the RAM from 80H to FFH include Special Function Registers (SFRs). These registers control various peripherals such as Serial Port, Timers, all I/O Ports, etc. ● Interrupts like External-2 & Internal-3 ● Oscillator & CLK Circuit. ● Control Registers like PCON, SCON, TMOD, TCON, IE, and IP. ● 16-bit Timers or Counters -2 like T0 & T1. ● Program Counter – 16 bit & DPRT (Data Pointer). ● I/O Pins – 32 which are arranged like four ports such as P0, P1, P2 & P3. ● Stack Pointer (SP) – 8bit & PSW (Processor Status Word). ● Serial Data Tx & Rx for Full-Duplex Operation
  4. 4. LAYOUT OF 8051 P
  5. 5. Application of 8051 Light sensing & controlling devices 1 Fire detection & safety devices 4 Temperature sensing and controlling devices 2 Industrial instrumentation devices 3
  6. 6. APPLICATION OF 8051 IN LIGHT SENSING and conrolling Microcontroller 8051 has many application, one such application is in light detection and controlling of light. Light Sensing and detection involve variety of application and projects with microcontroller 8051 for example automatic street light system, obstacle detector ,line follower , light intensity detector. Often these projects involves various other devices and sensors .brief about the one which we are going to use tis given below:- ● LDR SENSOR:-A Light Dependent Resistor (LDR) is also called a photoresistor or a cadmium sulfide (CdS) cell. It is also called a photoconductor. It is basically a photocell that works on the principle of photoconductivity. The passive component is basically a resistor whose resistance value decreases when the intensity of light decreases. This optoelectronic device is mostly used in light varying sensor circuit, and light and dark activated switching circuits. Some of its applications include camera light meters, street lights, clock radios, light beam alarms, reflective smoke alarms, and outdoor clocks..
  7. 7. Intensity meter using 8051 WORKING Ldr works on the principle of photoconductivity. It’s made up of such material whose conductivity varies as per light falls on it. As more light falls on it, more number of photon strikes. The kinetic energy of photons is given to electrons – that makes more number of free electrons – that leads to increase in conductivity of the device. Thus as light intensity increases, the conductivity increases (resistance decreases) and vice versa. So the change is the resistance of LDR can be a measurement of the amount of falling light. LDR is used to measure light intensity inside the room. With a minor change in the circuit, it can be used to measure outdoor light intensity also. It uses microcontroller AT89C52 and LCD to display light intensity. It also indicates how much light inside room like “full light”, “good light”, dim light” etc. However, microcontroller cannot detect the change in resistance directly. LDR has to be given biasing voltage along with pull up or pull down resistance so that change in resistance is converted into change in voltage. The change in analog voltage is converted into digital equivalent using ADC and this digital value is read by microcontroller to vary the voltage as per the change in light intensity and the resistance of LDR, the LDR can be connected with fixed value biasing resistance in pull up configuration or pull down configuration. If it is connected in the pull down configuration the voltage increases as light intensity increases and if it is connected in the pull up configuration the reverse will happen.
  8. 8. CONNECTIONS ● · LDR is connected between Vcc supply and ground through a 10K resistor that gives it bias. The voltage across biasing resistance is given as analog input to ADC0801 ● · Digital outputs DB0 – DB7 are connected to port P1 of AT89C52 microcontroller ● · Control pins RD and WR of ADC are connected with port P3 pins P3.7 and P3.6 respectively ● · Interrupt output pin INTR from ADC is connected to external interrupt 1 pin INT1 ● · Chip select pin CS is connected to ground to make chip always enable ● · RC components are connected to CLK R and CLK IN pins that provides internal clock to ADC ● · VREF/2 pin is given voltage through potential divider of R3 and R4 ● · The LCD data pins D0-D7 are connected to port P2. Control pins RS and En are connected with port P3 pins P3.0 and P3.1 respectively. RW pin is connected to ground to enable LCD write always enable ● · 1K Pot (not shown in the circuit) is connected to VEE pin to vary brightness of LCD ● · A 12 MHz crystal is connected to crystal input pins XTAL1 and XTAL2 along with two capacitors (not shown in the figure). It generates required clock signal for the microcontroller.
  9. 9. APPLICATION OF 8051 IN DETETCING LIGHT INTENSITY
  10. 10. CIRCUIT OPERATION ● When light falls on LDR, its resistances varies. More the light falls on LDR decrease its resistances. As the LDR resistance decreases the analog input voltage to ADC increases. That means the input voltage to ADC is directly proportional to light intensity falling on LDR. So more light more voltage and less light less voltage. ● ADC converts this analog voltage into 8-bit digital value and gives it to the microcontroller. Microcontroller gets this binary input converts it into decimal and displays it on LCD as light intensity. As the voltage varies from 0 V to around 4.5 V the corresponding digital output varies from 0 to maximum 240 – 250. The maximum value is 255 because of its 8 bit ADC. ● The microcontroller compares this value with a different range of values and decides how much light intensity is. If light intensity value is less than 50 then its very low light so microcontroller displays message “dim light”. Likewise, as the value increases the microcontroller decides whether its medium light, good light or full light etc. Please refer the following table:
  11. 11. APPLICATION OF 8051 IN DETETCING LIGHT INTENSITY ● V = (R / R + LDR) × Vcc ● So as LDR resistance decreases – means light increases, the voltage increases, and vice versa ● In figure (b) the voltage equation changes to ● V = (LDR / R + LDR) × Vcc ● So in this connection as LDR resistance increases- means light decreases, the voltage increases, and vice versa. So we cannot use this second configuration because we want an increase in voltage with the increase in light intensity. In this project, LDR is used with pull down resistance configuration. Also, the value of fixed resistance R should be chosen after calculations such that as the LDR resistance varies from darkness to full light the voltage V should change from 0 to 5 V. It is very easy to find this value. Just measure the value of LDR resistance in darkness and full light and select the value of R as the mid value of this range. E.g. if LDR resistance varies from 1 K to 25 K (in full light to darkness) select R as 10 K.
  12. 12. Software program and logic: ● The program downloaded into internal FLASH of AT89C52 is the soul of the project. It performs following functions ● · Handles LCD ● · Handles ADC ● · Converts HEX value into decimal and then decimal into ASCII ● · Compares light intensity value and decides how much light
  13. 13. CODE
  14. 14. CODE
  15. 15. Thank you

×