Arduino Projects    |   Raspberry Pi  |     Electronic Circuits    |    AVR    |    PIC    |    8051    |    Electronic Projects   |   Free TI Design & Simulation Tools 

How to interface LDR with ADC0808 using interrupt clock from 8051 microcontroller (AT89C51)

Summary

Developed By: 
Himanshu Choudhary

This circuit demonstrates the principle and operation of interfacing an LDR with ADC0808 using the controller AT89C51. This is an 8 channel ADC i.e., it can take eight input signals. The output is displayed on the LCD.

 

Interfacing ADC0808 with LDR using 8051 Microcontroller Interrupt Clock

Description


 

ADC0808 is an 8-bit resolution IC with eight input pins. LDR is used to provide the analog input. The output of the LDR is displayed on a 16x2 LCD.  A clock of frequency 500 KHz is generated using Timer0 in the interrupt mode. To enable the interrupt, the value of the register IE is set to 0x82 (Refer interfacing ADC 0808 with interrupt clock).
 
The output pins of ADC are connected to the port P0 of the AT89C51. The pin10 of the ADC is connected to pin8 (P1.7) of the controller for clock input. ALE, pin22 of the ADC is connected to pin1 (P1.0) of controller. OE, pin9 of the ADC is connected to pin4 (P1.3) of controller. SC, pin6 of the ADC is connected to pin2 (P1.1) of the controller. EOC, pin number 7 is connected to pin 3 (P1.2) of controller. Selector pins A (25), B (24) and C (24) of ADC are connected to the pins 4, 5 and 6 of the controller respectively.
 
Port P2 (pins 21-28) of controller is used to send the data to the LCD (pins 7-14). RS (pin4) of LCD is connected to P3.0 (pin 10) of controller. R/W (pin5) of LCD is connected to P3.1 (pin11) of the controller. Enable pin, EN, pin6 of LCD will connect to P3.6 of controller (Refer LCD interfacing).
 
The controller continuously monitors the output of the ADC. The output of the LDR varies with the intensity of light. The value ADC output varies from 0 to 255. The output of ADC is converted to decimal form and then displayed on the LCD (Refer displaying number on LCD). If the output of any of the LDR varies, the corresponding change is reflected on LCD screen.

 

 

Circuit Diagram


Video

Code

This Code is only visible to Registered users. Please Login/Register

Code2

This Code is only visible to Registered users. Please Login/Register

Components

LDR | Light Dependent Resistor
LDR

An LDR (Light dependent resistor), as its name suggests, offers resistance in response to the ambient light. The resistance decreases as the intensity of incident light increases, and vice versa. In the absence of light, LDR exhibits a resistance of the order of mega-ohms which decreases to few hundred ohms in the presence of light. It can act as a sensor, since a varying voltage drop can be obtained...

Presets | Variable Resistors
Preset
 
A preset is a three legged electronic component which can be made to offer varying resistance in a circuit. The resistance is varied by adjusting the rotary control over it. The adjustment can be done by using a small screw driver or...
AT89C51 Microcontroller, Atmel 89C51 Controller Image
AT89C51 Microcontroller

AT89C51 is an 8-bit microcontroller and belongs to Atmel's 8051 family. ATMEL 89C51 has 4KB of Flash programmable and erasable read only memory (...

16 x 2 LCD | 16x2 Character LCD Module
LCD

 

LCD (Liquid Crystal Display) screen is an electronic display module and find a wide range of applications. A 16x2 LCD display is very basic module and is very commonly used in various devices and circuits. These modules are preferred over seven segments...

ADC0808 Image
IC ADC0808

ADC0808 is an 8 bit analog to digital converter with eight input analog channels, i.e., it can take eight different analog inputs. The input which is to be converted to digital form can be selected by using three address lines. The voltage reference can be set using the Vref+ and Vr...

Free Circuit Design & Simulation Tool by TI

WEBENCH Design Center

WEBENCH Design Environments are unique and powerful software tools that deliver customized power, lighting, filtering, clocking and sensing designs in seconds. These easy-to-use tools help you generate, optimize and simulate designs that conform to your unique specifications. They allow you to make value-based tradeoffs at a design, system and supply chain level before your design is committed to production.



Design & Simulation Tools

Power Design

 


Sensors, Filter, Clock and Amplifier Design


Download Tools, Models and Symbols


Resources

 

You are here