Fixing a dark sensing module, the transistor turns on by it self

Thread Starter

Yami

Joined Jan 18, 2016
354
Hi all, I am trying to fix a dark sensing module, here is what happens - once I turn on the power the relay turns on (after a little while) regardless of how much light is falling on the LDR. I have changed many components with the exact same values/model but no difference. Measured the voltage divider output from the LDR section it does work. I measured across the base and ground of the first transistor - the voltage slowly builds up till 0.7V turning the transistor on (regardless of how much light is on the LDR). and it doesn't change if I completely cover or expose light onto the LDR.
So I figured it might be something to do with capacitor C1. So I disconnected it and checked - but what happens is when I cover the LDR the realy keeps switching on and off very rapidly. I tried different values for C1 if I decrease not much improvement/ doesn't work as it should. I tried going up in values when I reached 470uF the relay turns on an off rapidly when I cover the LDR.
Here is the schematic diagram,some of the resistor values might not be correct as I didn't measure it and just checked the color codes. The circuit does have a power supply section with a bridge rectifier and smoothing filters I didn't include it the diagram. The transistors are C1815
Thanks for the help.
Darksensing.jpg
 

Marc Sugrue

Joined Jan 19, 2018
222
From the fact you say your fixing it i'm assuming it did work at some point, but its not a good circuit. The transistors Q1 and Q2 only need a few uA into the Base to be baised on so R2 would need to be a VERY high resistance not to switch on Q1 with the values shown. The C1815 shows a gain of approx 70 for the lowest gain parts and 700 for the highest gain devices so even with the lowest gain devices 14uA would give you about 1mA drive capability on Q1 emitter into Q2 base and with a 1mA base current on Q2 you'd have approx 70mA drive capability of to switch the relay on. Assuming the network R1 & R3 are correct you could try increasing R4 to reduce the base current. Changing C1 isn't doing much except adjusting the frequency susceptability of the circuit.
 

ebp

Joined Feb 8, 2018
2,332
What is D1?
Eric's suggestion will probably improve performance. The "knee" of the voltage-current curve for zener diodes is not very sharp, and they can begin conduction well below nominal voltage, especially if they are "true" zeners with reverse breakdown voltage in the range of about 5 volts or less. Q1 should not turn on until its base voltage is about 1.2 V (sum of Vbe for both transistors) plus the zener voltage above ground.

With an unregulated power supply the circuit is potentially an oscillator. It has no "hysteresis" so any change in the voltage on the 22 volt rail will influence it. When Q2 turns on, the relay coil current will pull down the +22 volt supply slightly. This will decrease the current through the LDR, decreasing the base drive for Q1 and Q2, which may be enough to cause Q2 to turn off. As soon as that happens, the supply voltage will rise, the LDR will conduct more current and the transistors may turn on again.

Something to think about: What could you do with a PNP transistor with its emitter to +22V and its base to the collector of Q1 through a resistor?
 

MisterBill2

Joined Jan 23, 2018
18,602
hi Yami,
One change I would make is to add a 47K resistor from Q2 Base to 0V, leakage current thru Q1 D1 could just be enough to turn On Q2
E
Eric made the same suggestion that I make: add a pull-down resistor from the base to emitter of Q2. AND, indeed, with a PNP transistor for Q1, collector and emitter reversed, then it would be a dark detector. The circuit as shown is a light detector. Also, monitor the +22 volts supply when the thing is switching on and off, because if the supply voltage changes you will certainly have an oscillator.
 

ebp

Joined Feb 8, 2018
2,332
Just to be clear, I wasn't suggesting a PNP as an alternative to an existing transistor, I was suggesting it as an addition to the circuit.
 

sghioto

Joined Dec 31, 2017
5,392
If it's supposed to be a "dark" detector you have the LDR located incorrectly. I breadboarded this modified circuit using a 8.2 volt zener and it works OK. The cap provides about a 4 second delay when the light source is suddenly removed.
SG
EEE Dark detector.png
 

Thread Starter

Yami

Joined Jan 18, 2016
354
hi Yami,
One change I would make is to add a 47K resistor from Q2 Base to 0V, leakage current thru Q1 D1 could just be enough to turn On Q2
E
Hi Eric, good idea. But Q1 turns on first as well.. I measure across it base- it doesn't turn on right away just slowly the voltage builds up. Can I ask why 47K?
 
Last edited:

Thread Starter

Yami

Joined Jan 18, 2016
354
Hello,

The circuit of your "powersupply" is not allowed over here.
This is given in the User Agreement

Please use a transformer for isolation.

Bertus
Hi Bertus, Sorry for that. Its not my design - would if be ok if I were to put a transformer of 1:1 in the schematic as that's what I'm doing during the test?
 

Thread Starter

Yami

Joined Jan 18, 2016
354
Powersupplyli.jpg
Hi all, here's the schematic diagram of the power supply. It looks kind of of peculiar what component/s here could be causing the erratic behavior of the rest of the circuit. Could someone help to identify C2. Thanks for the help.
 

ericgibbs

Joined Jan 29, 2010
18,874
hi Yami,
It would be possible to modify your lite/dark circuit to work on 12Vdc, you could then use a regular 12Vdc wall wart PSU.
12V relays are readily available.
With regard to the 1:1 transformer, it is still possible to get an electric shock if you accidentally touch both ends of the secondary.!

The Xc[ capacitive reactance] of C2 = 1/(2pi * f *c)
Its value is chosen to give the required current for your lite.dark circuit.
Amps= 230/Xc

eg:
So a 0.47uF Capacitor , 50Hz
Xc=6773 Ohms
230Vac/6773 = ~35mA

OK.
E
BTW: The capacitor MUST be rated for AC mains operation.
 

Thread Starter

Yami

Joined Jan 18, 2016
354
hi Yami,
It would be possible to modify your lite/dark circuit to work on 12Vdc, you could then use a regular 12Vdc wall wart PSU.
12V relays are readily available.
With regard to the 1:1 transformer, it is still possible to get an electric shock if you accidentally touch both ends of the secondary.!

The Xc[ capacitive reactance] of C2 = 1/(2pi * f *c)
Its value is chosen to give the required current for your lite.dark circuit.
Amps= 230/Xc

eg:
So a 0.47uF Capacitor , 50Hz
Xc=6773 Ohms
230Vac/6773 = ~35mA

OK.
E
BTW: The capacitor MUST be rated for AC mains operation.
Hi Eric, what would be the capacitance of C2 - I couldn't figure that out from whats written on it.
 

ericgibbs

Joined Jan 29, 2010
18,874
hi Yami,
I would say the code of 334J means a 0.33uF.
Calculate the Xc value, then the current at 230Vac.
What is the current rating of the relay coil.?
E
 

MisterBill2

Joined Jan 23, 2018
18,602
The regulation of that supply will not be very good, and the stress on that series capacitor is fairly high. I second the suggestion to use a transformer type of wall wart supply, because of safety, stability, and much better resistance to line noise. I can guess that the original unpublished circuit was created with minimum cost as the prime objective. And really, is there any chance, since you say that parts have been replaced, that the Q1 device was originally a PNP device connected as I described earlier?
 

Tonyr1084

Joined Sep 24, 2015
7,905
Your dark sensor is still not working properly. That is to say - I'm still in the dark as to what is your voltage source.
The circuit of your "powersupply" is not allowed over here.
How do we know he's using a high voltage source? Or mains? I haven't read anything about what his source of power is. Did I miss something? Was 22 volts a misprint? Should it have said 220 volts?

I'd still like some clarification. That way I wouldn't be in the dark (as I usually am).
 

Thread Starter

Yami

Joined Jan 18, 2016
354
Hi guys just reiterate, this is not my design. I'm just trying to fix a module which was already broken. There is another unit exactly the same which works. Just to give you an update of the measurements I just took
When it is powered up the relay is off
Voltage across the voltage divider R3 is 6.4V when its light, when its dark it only goes to 5.6V
When the relay turns on regardless of the amount of light
Voltage across the voltage divider R3 is 5.9V when its light, when its dark it only goes to 4.8V
For those who a wondering : The lamp is connected to the normally closed contact of the relay so when there is light Q1 should turn on to turn off the lamp.

Voltage at the base of Q1 is 0.03V and it starts rising upto 1.3V and the realy is energised. NO matter how much light/darkness is on the LDR this value does not change
ps I measured the output voltage of the supply to begin with when the relay is off its around 23V. When the coil energies the voltage goes down to 22V
 
Last edited:
Top