Black Lives Matter - Action and Equality. ... Adafruit joins the Stop Hate for Profit campaign.
0

Alternative Approach to an RC Timer
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Alternative Approach to an RC Timer

by stinkbutt on Tue Nov 30, 2010 2:52 pm

OK, so I've got a transistor I want to turn on and off, and I want it delayed by a small amount, which is a natural place to use an RC circuit: You stick a capacitor & a resistor into the circuit, and when the input to the capacitor goes low (it's a PNP) the capacitor holds the base high a little longer while it discharges. The circuit looks something like this:

circuit.1.png
circuit.1.png (9.34 KiB) Viewed 2126 times


The diode's there because there are actually 6 input pins and the diodes block one input pin from pulling all the others low.

Here's my problem: The cap is not recharging fast enough. I'm not getting enough current to fill it up to the requisite 3.3V before the next signal (that needs to be delayed again) comes in. And I don't really have any good way I can think of to charge it faster. Here are the ideas I have discarded so far:

1. Shunt diode (pointing downward in that diagram) to bypass R1. I've already implemented that, actually, but since R1 << R2 it's only got a minimal effect.

2. Reducing the size of R2. That won't work. 20K is about as small as I can get R2 because it's not really connected to the rails, but the high side of another voltage divider. If I reduce it any further, then when the input pin goes low it pulls that signal line low as well, resulting in a spurious signal.

So my question is, can anyone think of any other way to source the cap more current? I mean, aside from finding the "canonical" Vcc line?
Red M&M, Blue M&M: They all wind up the same color

stinkbutt
 
Posts: 593
Joined: Wed Feb 17, 2010 2:40 am

Re: Alternative Approach to an RC Timer

by tinsmith on Tue Nov 30, 2010 3:52 pm

http://home.cogeco.ca/~rpaisley4/LM555.html#20

There's one way. The 555, what can't it do?
tinsmith
 
Posts: 62
Joined: Thu Nov 18, 2010 9:18 pm

Re: Alternative Approach to an RC Timer

by stinkbutt on Tue Nov 30, 2010 4:07 pm

Neither of those work, sadly. I can't count on the input signal being any particular length, (it's a button push, and the delay's super-short, at ~ 0.018 seconds) so I have to look for the rising edge (is that the right term, since it's going low? The FRONT) of the signal.

I read once in an electronics blog, this guy wrote: "One of the first things I do when I encounter a problem is I ask myself: 'Can I do this with a 555?'" I tried to follow that advice earlier but no joy.
Last edited by stinkbutt on Tue Nov 30, 2010 4:13 pm, edited 2 times in total.
Red M&M, Blue M&M: They all wind up the same color

stinkbutt
 
Posts: 593
Joined: Wed Feb 17, 2010 2:40 am

Re: Alternative Approach to an RC Timer

by stinkbutt on Tue Nov 30, 2010 4:12 pm

On the other hand...

Circuit number 1 works perfectly, only it triggers on the input going high instead of low.

Well hell, that's not too hard to invert, just a line pulled weakly low and a 3906 blocking high: Base of the 3906 goes low, line gets pulled high. Plus, a 555 has the advantage of nor requiring very much current, especially if I use a super-big resistor and a super-small capacitor. Sure, I'd have to make sure the tolerances were good enough to ensure the delay stayed where I wanted it, but 1% resistors don't cost that much.

I think you've got it tinsmith.
Red M&M, Blue M&M: They all wind up the same color

stinkbutt
 
Posts: 593
Joined: Wed Feb 17, 2010 2:40 am

Re: Alternative Approach to an RC Timer

by ImaginaryAxis on Wed Dec 01, 2010 12:04 am

Why not change the value of C1 to something small? <10nF? It does not change the DC operation of the circuit.

ImaginaryAxis
 
Posts: 267
Joined: Sat Nov 13, 2010 3:16 pm
Location: Phoenix, AZ

Re: Alternative Approach to an RC Timer

by stinkbutt on Wed Dec 01, 2010 12:52 am

L.A.W wrote:Why not change the value of C1 to something small? <10nF? It does not change the DC operation of the circuit.


That doesn't really buy me anything. As C1 goes down the requisite resistance of R1 goes up along with it. The time constant's going to remain R*C.
Red M&M, Blue M&M: They all wind up the same color

stinkbutt
 
Posts: 593
Joined: Wed Feb 17, 2010 2:40 am

Re: Alternative Approach to an RC Timer

by ImaginaryAxis on Wed Dec 01, 2010 1:11 am

stinkbutt wrote:
L.A.W wrote:Why not change the value of C1 to something small? <10nF? It does not change the DC operation of the circuit.


That doesn't really buy me anything. As C1 goes down the requisite resistance of R1 goes up along with it. The time constant's going to remain R*C.


For your purposes, why does R1 need to increase inversely proportional to the capacitor value?

ImaginaryAxis
 
Posts: 267
Joined: Sat Nov 13, 2010 3:16 pm
Location: Phoenix, AZ

Re: Alternative Approach to an RC Timer

by pstemari on Wed Dec 01, 2010 1:45 am

Because it's what sets the time constant for capacitor discharge.

Absent the 555, you could set up a second transistor to charge the cap when the input is high. NPN with the emitter connected to the cap, the collector to V+, and the base to your input.

That said, it's still going to drag down the voltage divider you have supplying the main rail unless you can bypass it.
--Paul

A wholly owned subsidiary of:
Persephone: DL R+W+B C 7 X L W C++ I++ T+ A E H++ S+ V-- F+ Q P B PA+ PL
Aldebaran: DM Rt H 5 Y L- W+ C+ I++ T++ A+++ E H++ S+ V+ F++ Q+ P B++ PA- PL--
User avatar
pstemari
 
Posts: 310
Joined: Sun Mar 21, 2010 6:10 pm
Location: Seattle, WA

Re: Alternative Approach to an RC Timer

by stinkbutt on Wed Dec 01, 2010 1:56 am

Yeah, tau = R * C. No easy way around that. Even bypassing R1 with a shunt (it'd be pointed DOWN in the diagram, allowing the shunt to charge the cap, but not discharge it,) I'm still staring at a pretty damn big resistor limiting my current, an issue not faced by the 555.

No, the 555 is the answer. It's like it's a swiss army chip.
Red M&M, Blue M&M: They all wind up the same color

stinkbutt
 
Posts: 593
Joined: Wed Feb 17, 2010 2:40 am

Re: Alternative Approach to an RC Timer

by ImaginaryAxis on Wed Dec 01, 2010 2:11 am

Well forgive me, because I am lost.

If the requirement is for a faster discharge, then lowering the value of C1 would do this. It also increases the charge rate if that poses a problem.

ImaginaryAxis
 
Posts: 267
Joined: Sat Nov 13, 2010 3:16 pm
Location: Phoenix, AZ

Re: Alternative Approach to an RC Timer

by stinkbutt on Wed Dec 01, 2010 2:40 am

The requirement is faster recharge, and doing it without pulling the positive voltage rail, (which is really just the high end of another switch-controlled voltage divider) low.

And it doesn't increase the charge rate if I'm forced to increase R1 to compensate, because the discharge rate needs to stay the same.
Red M&M, Blue M&M: They all wind up the same color

stinkbutt
 
Posts: 593
Joined: Wed Feb 17, 2010 2:40 am

Re: Alternative Approach to an RC Timer

by ImaginaryAxis on Wed Dec 01, 2010 3:57 am

Ah, yes...re-charge time. I didn't see the requirement that you needed an asymmetrical delay.
I say your are better off playing with the values of R1 and C1 rather than over complicating it with the 555. Your requirements -- specific time constants -- are not clear to me, but it's your call.
Have you run a Monte-Carlo simulation in PSpice?


Ghetto Edit:

Is the cathode of D1 a control voltage?

ImaginaryAxis
 
Posts: 267
Joined: Sat Nov 13, 2010 3:16 pm
Location: Phoenix, AZ

Re: Alternative Approach to an RC Timer

by stinkbutt on Wed Dec 01, 2010 11:45 am

Actually I think the 555 simplifies matters, by making the 2N3906 binary. Before, I had to worry about the discharge curve of C1 and figuring out at what voltage the 2N3906 started to conduct.

Now, I don't care. I know the 555 will trigger when the voltage across C1 is either 1/3 Vin or 2/3 Vin, and then the 555 output will go low. Otherwise, I'd have to much about with transistor gains, Vbe's, and Vo * e ^ (-t/RC) formulae. Icky.
Red M&M, Blue M&M: They all wind up the same color

stinkbutt
 
Posts: 593
Joined: Wed Feb 17, 2010 2:40 am

Please be positive and constructive with your questions and comments.