Reverse LDR

Thread Starter

zorgloub

Joined Apr 19, 2016
18
Reverse LDR

In the diagram below the LED flashes according to the RC value.
I would like RC to increase (flash slowly) when the light increases.
In fact, the exact opposite of how an LDR works!
Any idea of such a scheme?
Thank you.LedFlash.jpg
 

MisterBill2

Joined Jan 23, 2018
27,501
Interesting, an LED relaxation oscillator. But now a question: As the voltage increases? What sort of range of voltage change? A 220 VAC means that any change of just a few volts is a small portion of the whole, and so it might not be a big amount of change, no matter what. And what flash rate at what range of voltages is wanted?
A decreasing flash rate as the input rises from 120 volts to 220 volts is possible but may not be what is wanted.
So a lot more detail is needed to allow useful suggestions, otherwise you get only guesses.
 

Ian0

Joined Aug 7, 2020
13,131
Connect the LDR across the capacitor. It will shunt the charging current away from the capacitor, so the capacitor will take longer to charge.
If it gets too bright it will stop altogether.
 

Thread Starter

zorgloub

Joined Apr 19, 2016
18
Hi MisterBill2,
In fact, there is no voltage change!
The circuit is permanently supplied with 220VAC.
The led flashes as soon as the diac becomes conductive at 32V, depending on the RC Time constant.
Let's say that during the night the flashes should be 3 to 4 seconds apart, and during the day a delay of 8 seconds would be desired.
 

Ian0

Joined Aug 7, 2020
13,131
The time constant is calculated as though the two resistors are in parallel, but that’s not the end of the story.
The source voltage, from which C is charged is now the potential divider made of R1 and R2, so the threshold which determines the frequency(the diac breakover voltage) is now a bigger, and variable proportion of the source, so the calculation is rather more difficult.

To Simplify - in complete darkness, the circuit will behave exactly as before as R2 is effectively open circuit.
As the light level increasesit will slow down until
Vbo = Vsupply.R2/(R1+R2)
and then it will stop.
 

MisterBill2

Joined Jan 23, 2018
27,501
OK, and certainly the scheme proposed by Ian is much simpler than what I was considering. Why did I think that the voltage was changing? That was incorrect.Bridging the cap with the LDR plus some additional series resistor should work. It will not be linear but it does not seem likelinearity is required.
 

Thread Starter

zorgloub

Joined Apr 19, 2016
18
Hi Ian0
I agree that R2 will influence the maximum voltage across the capacitor.
However, if we consider that R1 is in parallel with R2, the RC time constant will increase in the dark. (LDR increases in the dark).
However, it is the opposite case that should be obtained.
Are you sure that R1 should be considered in parallel with R2?


RCTIME2R_b.jpg
 

Ian0

Joined Aug 7, 2020
13,131
Untitled 1.png

R1=R3 and R2=R4
If V2=V1*R2/(R1+R2) then the two situations are equivalent.
The proof (there might be a better one) involves connecting V3 or V4 to a voltage and calculating the current.
\(
I=\frac{V1-V3}{R1}-\frac{V3}{R2}
\)
\(
I=\frac{V2-V3}{R1||R2}
\)
where "||" means "in parallel with"
\(
R1||R2 = \frac{R1 R2}{R1+R2}
\)
\(
I=(V2-V3)\frac{R1+R2}{R1 R2}
\)
\(
\frac{V1-V3}{R1}-\frac{V3}{R2}=(V2-V3)\frac{R1+R2}{R1 R2}
\)
\(
\frac{V1}{R1}-\frac{V3}{R1}-\frac{V3}{R2}=V2\frac{R1+R2}{R1 R2}-V3\frac{R1+R2}{R1 R2}
\)
\(
\frac{V1 R2}{R1 R2}-\frac{V3 R2}{R1 R2}-\frac{V3 R1}{ R1 R2}=V2\frac{R1+R2}{R1 R2}-V3\frac{R1+R2}{R1 R2}
\)
\(
V1 R2 - V3 R2 - V3 R1 = V2(R1+R2) - V3 (R1+R2)
\)
\(
V1 R2 - V3 R2 - V3 R1 = V2 R1 + V2 R2 - V3 R1 - V3 R2
\)
\(
V1 R2 = V2 R1 + V2 R2
\)
\(
V2 = V1\frac{R2}{R1+R2}
\)
That proves that the time constant is determined by the parallel combination of the two resistors. The time constant is not the same as the charge time which determines the oscillating frequency.
The capacitor charges as
\(
V=V_0 (1-e^{\frac{-t}{RC}})
\)
The time take to charge to the diac breakover voltage is.
\(
e^{\frac{-t}{RC}}=1-\frac{V}{V_0}
\)
\(
t=-RC \ln(1-\frac{V_{bo}}{V_0})
\)
Where V0 is the voltage at the junction of the two resistors, and Vbo is the breakover voltage of the diac.
You can see that as V0 gets closer to Vbo, \(1-\frac{V_{bo}}{V_0}\) heads towards zero the logarithm heads towards \(-\infty\), so the charge gets longer and longer, until it stops altogether when V0=Vbo, even thought the value of RC gets smaller.
 

Thread Starter

zorgloub

Joined Apr 19, 2016
18
Hello @Bordodynov
Thank you for your precious collaboration.
Would it be possible for you to make the LTspice files used available to us?
Also, I do not have the Diac DB3 component in my initial LTspice library. Is it possible to provide the necessary file(s)?
Thank you very much in advance.
 

Thread Starter

zorgloub

Joined Apr 19, 2016
18
Hi Bordodynov
I have to admit that I am testing this LTSpice for the first time and that it is not easy to get used to.
Here is what I get (from a file using DB3) and I wonder:
1. Why the diac only triggers once and not successively after each discharge of the capacitor.
2. How do you separate your two graphs from the results. In my case they overlap and it becomes unreadable.

This is why I wanted to try your '.asc' files.
Thank.
 

Attachments

Top