Darkness Detector Help

Thread Starter

chefman2006

Joined Sep 18, 2023
5
Hey all,

Very sorry if this has been answered. Promise I’ve tried to search. I’ve watched what has to be a million videos and read an equal number of forums, but can’t seem to get this working.

I’m just trying to make a simple darkness detector circuit. I’m just a tinkerer so I don’t know a ton about the math behind all of this.

Using a generic LDR and an S8050. Picture included. I’ve tried changing resistance to the base both higher and lower and I still just get a light detector (brighter with light; dimmer with dark).

Any help would be greatly appreciated.

IMG_0305.jpeg
 

MisterBill2

Joined Jan 23, 2018
16,495
Welcome to AAC!
Two things usually help toward getting useful solutions to problems, the first one being to make a clear statement as to what the ultimate goal is, rather than just asking for an answer to whatever the question may be.
And the second thing that helps is an actual circuit schematic instead of a picture of an assembly. M
Certainly that is possible, but much simpler isany of the folks here always ask for a circuit drawing before they can even think about a solution.

I am going to guess that what you seek is a circuit that switches on an LED when darkness (the absence of light) is present. But the opposite is much simpler, which is switching off something, such as a light, when light is sensed.
 

MrChips

Joined Oct 2, 2009
29,809
We cannot help you without seeing the circuit schematic, part numbers, part values.

What is the part number of the transistor? Is it NPN or PNP or something else?
What are the resistance values?
What is the resistance of the LDR in light and dark?
Has the LED been tested and wired correctly?

As you can see, the devil is in the details.
 

Thread Starter

chefman2006

Joined Sep 18, 2023
5
We cannot help you without seeing the circuit schematic, part numbers, part values.

What is the part number of the transistor? Is it NPN or PNP or something else?
What are the resistance values?
What is the resistance of the LDR in light and dark?
Has the LED been tested and wired correctly?

As you can see, the devil is in the details.
IMG_0307.png

Apologies for the confusion, I thought the original picture would suffice. Here’s the circuit as I understand it. The primary difference being that the transistor I’m using is an S8050 (as mentioned in the original post). Does this provide the details you need?
 
Last edited by a moderator:

ericgibbs

Joined Jan 29, 2010
18,216
Hi chef,
With that simple circuit, you will not get the 'snap' action at the light/dark boundary, it will always be brighter/dimmer.
Do you have any amplifier or comparator IC's on the bench?
E
 

Thread Starter

chefman2006

Joined Sep 18, 2023
5
Hi chef,
With that simple circuit, you will not get the 'snap' action at the light/dark boundary, it will always be brighter/dimmer.
Do you have any amplifier or comparator IC's on the bench?
E
That’s a good point. I would like the snap eventually. The problem right now is that the circuit still acts like the LED is only connected to an LDR. Brighter environment makes the LED brighter and vice versa. I’m at a loss.
 

ericgibbs

Joined Jan 29, 2010
18,216
Hi,
This simulation shows how your circuit works, note the Xaxis range for the LDR is only 3k5 Dark, 4k8 Light, about a 1k change.

I am using a 9V battery, what voltage is yours?
E
EG57_ 1177.png
 

ericgibbs

Joined Jan 29, 2010
18,216
Hi chef,
This is the GM5539 datasheet clip.
Note the LDR resistance range.
E

Update:
Your simple circuit cannot work with that LDR type.

EG57_ 1178.png
 

MisterBill2

Joined Jan 23, 2018
16,495
From the description of the function, that the LED gets brighter with light on the photo-resistor getting brighter, the simple explanation would be that the transistor is a PNP with the emitter and collector reversed from what the drawing in post #4 shows. As the LDR resistance would drop, the base current would rise.
And given that the number for the transistor does not tell me anything, that might be the case.
 
Top