How to connect the LDR sensors to the port?

Status
Not open for further replies.

jith

Newbie level 5
Joined
Feb 17, 2005
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,381
i need to connect the LDR Sensors just to detect human presence and to enable a port where it is connected!

i just want to know whether we can directly connect the LDR to the Port(eg. P0.0) or do we need to connect some more resistor- capacitor combination circuits?
 

create ldr sensors

If your microcontroller has A/D converter you can connect LDR directly to the ADC input and GND, and add anoter resistor between Vcc and this pin to create a voltage devider.
If your microcontroller doesn't have A/D converter you will have to use a comparator with adjustable level and then connect the output ftom comparator to pin, say, P0.0 (or any other) ..
 

    jith

    Points: 2
    Helpful Answer Positive Rating
ldr connection with microcontroller

Thanks for the reply.......but just one more question! 'I dont have any A/d converters....so shud i buy them or can i connect the LDR Sensors to my uC pins using comparator? if i have to connect them thru comparator...then can u pls give me the CKT diagram for thy connection?

The sensor has to give the pin a 5V Signal when its active and 0v when its inactive! thats all!
 

ldr sensor connection

Here is a simple light switch build on 2 transistors. For direct connection with the microcontroller input change pnp transistors no npn (polarity of power = 0V to emiters) and connect collector of the second transistor to microcontroller pin..

**broken link removed**
 

    jith

    Points: 2
    Helpful Answer Positive Rating
can i connect ldr to vcc?

you can use microcontroller ATMEL AT89C2051, 20 pin uC 8051 family. this uC have comparator internal. it is port 1.0 for + comparator and port 1.1 - comparator.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…