Help Debug Circuit

Status
Not open for further replies.

Go figure. Windows VS Lollipop
You can see that the windows version calculates correctly where the android does not.
 
Last edited:
C = 5 / Rt1e = 5 / 2850 = 1750 uF.
OK the math makes sense now.
I want to know why the actual answer of 0.00175 is changed to 1750. what is it converted to?
I think the RAW values ((c = 5 / 2.85)) may have made it easier to grasp the formulas.
I made a conversion list so i can solve for other conditions.

Vmid = (12 x 20.9 ) / (13.3 + 20.9 ) = 7.33 V.
This i understand. Thank you.

Im going to toy around with this. Condense the information and use it as a reference in future projects.
Thank you all very much for helping me with this.
 
Last edited:
Proposed values
start delay 1-5 seconds
stop delay 4-12 seconds
==UPDATE==
U10 IS 5K TRIMMER
 
Last edited:
C = 5 / 2.85 = 5 / 2850 = 1750
How did you get 1750 for C
time equals resistance times capacitance

t = R x C

rearranging:

C = t / R

C = 5 / 2850

C = .001754385 = rounded to 0.001750 F = 1750 uF

"I want to know why the actual answer of 0.00175 is changed to 1750. what is it converted to?"

The base equation uses all SI units: seconds, ohms, farads. But you don't buy most large capacitors in farads (F), you buy them in microfarads (uF). To convert, divide by one million, by moving the decimal point 6 places to the right.

ak
 
Last edited:
The base equation uses all SI units: seconds, ohms, farads. But you don't buy most large capacitors in farads (F), you buy them in microfarads (uF). To convert, divide by one million, by moving the decimal point 6 places to the right.
Thank you. I provided an updated schematic. How did I do with placing the resistors?
 
So the effective short and long timing resistances are
for the delay start i came up with
Resistors
(short delay)
Rte1 = 1k (20.9 || 1) =.95 (1k)
(long delay)
Rte2 = 6k (20.9 || 6) = 4.66 (5k var)

Cap
c = 1/.95 = 1/950 = 950uf OR 1000uf (0.001)

t2 = Rte2 x 1000 = (4660 x 0.001) = 4.66 s
t1 = Rte1 x 1000 = (950 x 0.001) = 0.95 s
 
Last edited:
The base equation uses all SI units: seconds, ohms, farads. But you don't buy most large capacitors in farads (F), you buy them in microfarads (uF). To convert, divide by one million, by moving the decimal point 6 places to the right.
Hi. Can you provide feedback on my resistor placement on post #104 and my formula usage on #107. Ty.
 
Note: the component values shown are very rough estimates; I just winged the arithmetic in my head.
If you want to play with this circuit, I can do a more rigorous job on the numbers.
ak
Just testing out what I have learned. If I got it wrong let me know.

On Delay is 33 seconds
Off delay is 133 seconds
C = 0.00010
Rt1 = 33,000
rt2 = 1,000,000

ts1 = C x (Rt1+0) = 33 seconds
ts2 = C x (Rt1 +Rt2) = 133 seconds
 
Just testing out what I have learned. If I got it wrong let me know.
This circuit is has one very large difference, and that changes things.

For the ULN2004 circuit, I pointed out that the calculations were based on an approximation, that the transition level of the gate was approximately equal to 0.63 x capacitor's maximum voltage when fully charged. this made the time period equal to approximately 1 time constant. That is not the case here.

For this circuit, the "transition level" of the 2N7000 transistor (the gate voltage at which the drain starts to go low) is the transistor's threshold voltage Vth. For this transistor it is approx. 2 V, while for the ULN2004 it is approx. 5 V.

The charging curve for an R-C circuit is exponential - the greater the charge, the more slowly it increases. In this circuit the max capacitor voltage is 12 V, but the Vth is only 2 V, so all of the action happens way down on the charging curve, where the graph is exponentially linear rather than exponential. This is good for me because I'm lazy.

Enter another approximation. As the voltage across the capacitor changes, so does the voltage across the resistor. As the cap voltage increases, the resistor voltage decreases. The two voltages are in series, so they always add up to Vcc; as one goes up, the other goes down. Because the voltage change across the cap is such a small percentage of Vcc, the voltage change across the resistor also changes very little. An almost constant voltage across a resistor produces an almost constant current. AND (the good part) the equation for a capacitor being charged by a constant current is *not* exponential; it is linear.

EC=it > E x C = i x t

E - voltage change across the capacitor
C - capacitor value in farads
i - charging current
t - time

In the region of interest, the voltage changes from 0 V to 2 V. The average is 1 V. This leaves 11 V (average) across the resistor. Using Ohm's Law, the current through a 330 K resistor is 33 uA. The max turn-on delay time is 5 seconds, so we have everything needed to calculate the capacitor value.

EC = it

C = ( i x t ) / E = ( 0.000033 x 5 ) / 1 = 0.0001667 F = 167 uF

The actual drain current needed for the SSR is around 5 mA, which acts to decrease the capacitor size need for the delay, so my first estimate was that 100 uF would be closer than 220 uF as a starting value.

The sensor switches the R1-R2 node directly to Vcc, so R2 has no effect on the ON delay time. For the off delay time, R1 and R2 are in series, discharging the capacitor from 12 V down to 2 V, at which point the transistor and the relay turn off. Now we are back to the exponential equation. We are discharging from 12 v to 2 V, or from 100% to 16.7% (2 / 12). this is a change of 83.3%. Now, the good news. If you crank that exponential equation, you'll find that while the voltage change across a cap is 63% in one time constant, it is 86% in two time constants. In ak land that is close enough for a first approximation.

R1 + R3 = 1.33 M = 1,330,000 ohms
C = 100 uF = 0.0001 F

2 x R x C = a huge mistake.

In post #45, I completely missed that the cap keeps charging up after the transistor has turned on, and that the discharge time is way longer than the charge time. Even if R2 were 0 ohms, meaning the sensor somehow connected the left side of R1 directly to GND for the turn-off timer, the turn off delay would be 1 minute.

oopsy

OK, I can fix this. The solution is to add a 5.1 V zener diode across the cap to keep it from charging all the way up to 12 V, and change both R1 and R2 to 47 K. I'll revise the schematic later today. Decent weather - leaves and lights.

ak
 
Last edited:
I can fix this. The solution is to add 1 zener diode across the cap, to keep it from charging all the way up to 12 V. More later.
I have to say. I'm glued. Im finally
B E G I N N I N G to understanding this. Thank you for everything. You are appreciated.
 
Here is the revised schematic. Everything about the turn-on delay is correct as above in post #110. The turn-off delay follows the same thinking with the constant-current approximation, not the exponential equation. I'll update this post later with the explanation.

ak
 
BTW the reason I'm so comfortable recommending that coarse approximations of the real equations and numbers are appropriate here is not actually laziness; it's efficiency. Long-period R-C timers are notoriously inaccurate. A relatively expensive electrolytic capacitor has a value tolerance of +/-10%, and that wanders around with temperature and age. Medium caps are +/-20%, and cheap caps are +100%/-20%. Yes, the initial value could be as much as twice what is printed on the part. This is compounded by the fact that neither the ULN2004 nor the 2N7000 are precision voltage comparators.

Given that reality, an adjustment is mandatory for even mediocre precision. And that adjustment can be modified to cover some arithmetic "efficiencies".

ak
 
i am using an Ohms Law calc to reproduce this result but i get something different.
One end of the resistor is tied to +12 V through the sensor contacts. The other end goes from 0 V to 2 V, when the transistor starts to change state. The cap keeps charging up, but we only care about how long it takes to get to the threshold voltage. thus, the voltage across the resistor starts and 12 V and decreases to 10 V, for an average of 11 V over the period we care about.

11 V / 330,000 = 0.000033333333333333 A, the *average* current over the period

or 3.333E-5 A

or 33 uA.

ak
 
It doesn't have its own name. It is a simple case of the capacitor equation.

This is the integral form of the capacitor equation. It includes a term for an initial voltage across the capacitor (V(t0)) before it starts charging or discharging.



Ignoring the V(t0) term at the end. the important part is that the voltage across a capacitor equals the integral of the charging/discharging current waveform. In a typical R-C circuit, the current is constantly changing as the voltage on the cap increases.

BUT - if the current is a constant, then (the integral of i dt) reduces to simply (i x t). Rewriting with that change:

V(t) = 1/C x i x t

Moving the capacitor term to the other side of the equation:

V(t) x C = i x t ..or.. EC=it, an easy form to remember.

ak
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…