Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Light Sensing LDR Op Amp Circuit Simulation Help

Status
Not open for further replies.

tehipwn

New Member
I'm attempting to simulate the top part of the following circuit:

**broken link removed**

Here is my PSPICE circuit at 3 different LDR resistance values. Somehow I need to adjust the circuit to allow the output of the op amp to go high when the LDR resistance value is changed, such as when different amounts of light are shining on it.

**broken link removed**

**broken link removed**

**broken link removed**

No matter what I do the output remains 0 (approximately).

I'm sure my circuit layout isn't correct but if someone could offer any insight I would greatly appreciate it. Thanks!
 
You are using the opamp as a comparator; bad practice. However, beit an opamp or a comparctor, it switches when the two inputs are equal. You have 5V on the inverting input, while the non-inverting input always has a voltage smaller than 5V, so it will never switch. You must bias the inverting input by using a pot, so that the wiper can be set to any voltage between ~ 1V and 4V. You also need to provide some positive feedback to keep the comparator from oscillating back and forth as the two input come close to the same voltage.
 
Oh...I should use a comparator as a comparator.

I'm really wanting to design this to be a color sensor, as shown here:
**broken link removed**
with the output of the op amp to be input into a DS89C450 microcontroller.

Except instead of a line follower, I want to control a stepper motor based on the sensed color.

Any suggestions?
 
The circuit will work only if you keep the input voltages within the Allowed Input Common-mode Voltage Range (shown on its datasheet) which is from 0V to 1.5V less than its positive supply voltage.

You have one input at the same voltage as the positive supply so the input transistor is completely turned off and it does nothing.

EDIT:
In addition, the output will go high only when the input voltages are within the allowed common-mode range and the (+) input voltage is higher than the (-) input voltage. Your circuit never has this happen.

Your simulation program is sick. It is impossible for the output to be a negative voltage since there is no negative supply.
 
Last edited:
I'm attempting to simulate the top part of the following circuit:

Here is my PSPICE circuit at 3 different LDR resistance values. Somehow I need to adjust the circuit to allow the output of the op amp to go high when the LDR resistance value is changed, such as when different amounts of light are shining on it.

No matter what I do the output remains 0 (approximately).

I'm sure my circuit layout isn't correct but if someone could offer any insight I would greatly appreciate it. Thanks!

hi,
Use the Spice .STEP PARAM function to vary the value of the LDR's resistance.

Here is a simple example stepping Resistor value.
There are LDR examples and formula available if you really want to be precise, often a simple stepped resistor will give you an idea of whats happening within your circuit.
 

Attachments

  • LDR1.gif
    LDR1.gif
    20.9 KB · Views: 941
Last edited:
Thanks for the reply eric!

I'm looking at comparator ICs with internal voltage reference levels, and I'm not really sure how that works. The LTC1443 has a Vref of 1.182V ±1%.

**broken link removed**

Pin 8 is REF. Does that mean that pin 8 needs 1.182V connected to it, or is that voltage always on that pin no matter what the V+ (within operating range) on pin 3?

I'm thinking I can make my circuit by using this comparator IC since I need 3 light sensors for different colors.

If it's always at 1.182V on that pin, does that mean I connect pin 8 to InA-, InB-, and InC- for a set voltage reference. Then on pins InA+, InB+, and InC+ I set up three seperate LDR voltage divider circuits that will cause the comparator outputs OUTA, OUTB, and OUTC to go high when the proper amount of light strikes the LDR?

Any insight? Thanks.
 
Last edited:
Okay, thanks to the help I've received on these forums, I have attached a preliminary design. The first page can be skipped if you prefer. I know it only contains approximate idealizations, but it's the best I could do until I actually get a LDR and start shining Red, Green, or Blue LEDs on Red, Blue or Green objects and measuring the LDR Resistance level based on the reflected light.

Please look over the electronics part and tell me if my thought process is correct.

Thank you very much!
 

Attachments

  • color_sensor_design_proposal.pdf
    319.8 KB · Views: 492
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top