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.

***LDR Switch Problems***

Status
Not open for further replies.

spacehonkey

New Member
I'm a complete NOOB at this stuff. This is my first attempt to put a circuit board together and it shows. I'm trying to build a light sensitive switch so whenever I cover the LDR it energizes the relay. I have everything setup on a breadboard just like it shows on this link **broken link removed** but it doesn't seem to work. I shot the components and they're all good. I did find out that even though the voltage from the LDR does decrease, from 10Vdc to 4.5Vdc, when I cover it it doesn't change the output voltage of the OpAmp. The output from the OpAmp will only adjust when I physical adjust the resistants on the trimmer pot. Also the relay clicks over the instant I power up the system. I think the transistor has something to do with that because I disconnected the OpAmp from the system and the relay was still energized. I then took out the transistor and the relay turned off. I'm probably way off on how a transistor works but I thought the collective wouldn't read the ground coming through the emitter until the base had voltage running though it. I'm not sure what I'm doing wrong.

Can anyone out there help me out?
 
Are you sure you've connected it up correctly?

Perhaps it needs some hysteresis, try connecting a 1M resistor between pin 6 and pin 3.
 
Yes, sounds like it's not connected correctly - it's a VERY simple basic circuit, and it WILL work. As already suggested adding a little hysteresis will improve it's performance a lot! - and I would also suggest adding a 100uF electrolytic across the power supply rails, it's something that should always be used, but often isn't shown in the diagram.
 
The 741 can't swing to ground and I suspect that the transistor is always on. The output of the op amp is probabaly around 2 V when it's supposed to be low. Either add 2 or 3 diodes is series with R4 or choose a single supply op amp.
 
eng1 said:
The 741 can't swing to ground and I suspect that the transistor is always on. The output of the op amp is probabaly around 2 V when it's supposed to be low. Either add 2 or 3 diodes is series with R4 or choose a single supply op amp.

You're not paying attention! - go to the back of the class :D

R4/R5 form a 10/1 potential divider, overcoming your concern.

If you have a large pointy hat with a 'D' on it, please wear it and face the wall! :p
 
spacehonkey said:
The output from the OpAmp will only adjust when I physical adjust the resistants on the trimmer pot.
Can anyone out there help me out?

The voltage at pin 3 of the 741 should be appox. 6 volts. Adjust the trimmer pot to give this voltage.

Then, check the voltage at pin 2 with the LDR covered. It should be less than 6 volts. If so, then the output at pin 6 should also be a positive voltage, somewhere around 10 volts.

From there, you can use Ohms Law to determine the base current and voltage to your transistor.
 
The opamp is wired as a comparator, the output will be either high or low, the 741 isn't rail to rail, but it will still be nowhere near 6V in either case.
 
spacehonkey said:
This is my first attempt to put a circuit board together and it shows.

so that i'll try to avoid tech-talk,

spacehonkey said:
The output from the OpAmp will only adjust when I physical adjust the resistants on the trimmer pot.

thats good, try to adjust the relay activation threshold by adjusting the POT (P1) until relay clicks, turn back until just relay deacivation. Then try to cover the LDR.

if this does not work we may go for simple tech-talk to make it work.
 
Nigel Goodwin said:
The opamp is wired as a comparator, the output will be either high or low, the 741 isn't rail to rail, but it will still be nowhere near 6V in either case.

Well,half of 12 used to be six. And a 741 will go within a couple of volts of its 12 volt rail.
 
AllVol said:
Well,half of 12 used to be six. And a 741 will go within a couple of volts of its 12 volt rail.

Half of 12 still is six, but what's that got to do with it? - the output will either be near the 12V rail, or near the 0V rail, never in the middle.
 
That's what I said in my post. The divider on the non-inverting input ought to be about 6 volts (1/2 of 12), and if the inverting input is of lower voltage, the output will swing towards the high side rail. Ergo, about 10 volts.
 
Hero999 said:
Are you sure you've connected it up correctly?

Perhaps it needs some hysteresis, try connecting a 1M resistor between pin 6 and pin 3.

I went ahead and started from scratch again I took my time setting it up right and I got the same results. I honestly think it has something to do with the transistor.

Could my transistor be jacked up?

How would I be able to tell if it was?


I don't have any 1M resistors on hand and wasn't able to get to the store today but I'll try later this week. Remember I'm a complete NOOB at this stuff and most if not all of what you guys are talking about it completely over my head. For instances
eng1 said:
The 741 can't swing to ground and I suspect that the transistor is always on. The output of the op amp is probabaly around 2 V when it's supposed to be low. Either add 2 or 3 diodes is series with R4 or choose a single supply op amp.

I have no idea what that means. I don't understand the next comment after eng1's either. I have no idea why there are all those resistors in the system and the use of the diode. I think the diode needs to be there to prevent reverse current flow and the resistors need to be there too, I just don't know why. I appreciate all the help you guys are giving me and I'm sorry if I'm to ignorant to understand half of what you are saying but with a little patiences from you guys and a lot of humility on my part I hope to get there. By the way I have no idea what HYSTERESIS means but I'll figure it out tomorrow when I do some web surfing.

aljamri said:
thats good, try to adjust the relay activation threshold by adjusting the POT (P1) until relay clicks, turn back until just relay deacivation. Then try to cover the LDR.

if this does not work we may go for simple tech-talk to make it work.

I did try to adjust the pot to see if that would deactivate the relay but it did nothing. For some reason the pot and the OpAmp are not affecting the relay from turning on or off. I took them completely out of the setup and the relay still clicks over. It's getting the ground from the transistor. I don't completely understand why though. I understand that I want the transistor to prove the ground for the relay but for it to be controlled by the output voltage of the OpAmp. Something like this: voltage comes out of OpAmp and going to the base of the transistor and thus allowing in some way the collective and emitter to talk with one another and allowing the ground on the emitter to pass through the collective and carry forward to the relay coil and then causing the relay to click over. At least I think it goes something like that.
 
AllVol said:
That's what I said in my post. The divider on the non-inverting input ought to be about 6 volts (1/2 of 12), and if the inverting input is of lower voltage, the output will swing towards the high side rail. Ergo, about 10 volts.

Sorry! - you meant the input, I though you meant the output! :D

The input absolute values don't really matter, it's just the values relative to each other that do.
 
basic Qs

As what i do always with my friends ( beggeners like you ) i'll ask basic questions.

Which transistor have you used ECG or NTE?
how do you know the transistor and IC pin numbers ?
What is written on the relay's package and (if any) on coil it self
do you have a multimeter ( to mesure volts and resistance )

Finaly, How have you connected the Diod D1 ( the white strip side has to be connected to +ve side of the supply)
 
Q 4 N.g.

Nigel Goodwin said:
I would also suggest adding a 100uF electrolytic across the power supply rails, it's something that should always be used, but often isn't shown in the diagram.

Thanks again and again Nigel for your tips, although I have got EXPERIENCED title but still I feel like a student when you talk.

What's the purpose for this capacitor and why and where it should always be used?

Thanks :)
 
spacehonkey said:

Could my transistor be jacked up?

How would I be able to tell if it was?

You can check the circuit after removing the transistor. Measure the voltage between the output of the 741 and ground, it should go low or high depending on the light. If that works, double-check the pin lay-out of the transistor in its datasheet.
 
aljamri said:
Thanks again and again Nigel for your tips, although I have got EXPERIENCED title but still I feel like a student when you talk.

What's the purpose for this capacitor and why and where it should always be used?

It connects the power rails together as far as AC is concerned, the way circuits work actually assume this, so if you don't do it then strange things can happen, and often do!.
 
eng1 said:
You can check the circuit after removing the transistor. Measure the voltage between the output of the 741 and ground, it should go low or high depending on the light. If that works, double-check the pin lay-out of the transistor in its datasheet.

I did this also and the output voltage from the 741 does change from about 9 volts to 1.5 volts only when I adjust the pot. The output voltage doesn't change at all when I turn on and off the light shining on the LDR.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top