hi all, sorry i was suggested to start a new thread instead .

i was did what VVV told me, that to lower the resistance value. yes, it do good right now. when i come to make one for driving ticket dispenser today, i was stumped again that even the output signal has conditioned by using schmitt 74C14, i was able to produce more than one count when i bother the sensor with tickets, that should be count one. nah... i was seeing a part from this pic :



watch out the dotted line!
see, this part and before, is a debouncing circuit. the first 3 component was familiar to me (R8, R9, C5) :grin:

but... :rolleyes: theres R10 and a decoupling cap .1 before. i know its name , but i really dont know what it is used for. anyone know that? how it works?

thanks
Posted on 2003-06-25 07:31:29 by dion
Hi, dion,

The only way I can interpret that is that the designer wanted a pulse output with a certain duration, even if the switch is stuck closed (LOW).

Initially, the coupling cap is discharged (through R10, R9 and R8 in series) and the gate input is HIGH (pulled up by R10).
When the switch closes, the cap is still discharged and the input of the gate is pulled LOW, generating a HIGH output.
As the capacitor charges up (through the switch, R9 and R10 in series), the voltage at the input of the gate rises, until it reaches the threshold and it's output now goes back LOW. That was the fixed-duration pulse I rmentioned.
The charging time constant (that will dictate the duration of the pulse) is then given by R9, R10 and the value of the capacitor (actually it's a little more complicated that that , because of C5). Since R10 is so much larger, the time constant is approximately R10*C.

R10 has two roles: it gives the time constant by providing a charging and discharging path for the coupling cap, but it also keeps the input of the gate in a known state when the cap is fully charged or discharged.

Note that when the switch opens, the cap has to discharge through R8, R9 and R10 in series. Again, the time constant is approximately R10*C. That means that between the pulses you should have a "gap" of about 3*R10*C, to make sure you do not lose any pulses. Otherwise, the cap will not be fully discharged and the voltage seen by the gate may not be low enough.

Hope this helps.
Posted on 2003-06-25 11:41:23 by VVV
the cap has to discharge through R8, R9 and R10 in series


hmm.. can you explained why those 3R is in series? i dont see them as a series connection :(

hmm.. you mean, its behave like a "half monostable"? so, level change in input, will generate a pulse only? i think i am wrong here, because if it act like that, it'll mess up the system. i mean when the sw stuck low for a long time, it wont generate a same long pulse width?

will it make debouncing more reliable?

thanks
Posted on 2003-06-26 07:52:50 by dion
Hi, dion,

R8 has one end connected to Vcc. The other end goes to R9, which goes to the cap, which goes to R10, which in the end goes back to Vcc.
So all these parts are in series. If the cap is initially charged, it acts as a source and discharges through the 3 resistors.

Yes, the circuit acts like a monostable. It will output a pulse of a certain duration and that's it, even if the switch is still closed after that.
I would not say this circuit improves the debouncing. That is dealt with by the filter R9, C5. R10 and the coupling cap perform the one-shot function.
By the way, this kind of circuit with the cap in series, is called a differentiator.

A correction to what I said yesterday: the cap discharges through R8, R9, R10. Actuallt the input of the gate may have a diode to Vcc, which is effectively in parallel with R10, so the cap may discharge through R8, R9, diode. That will give a much shorter time constant.
You may add a diode yourself, in parallel with R10, cathode to Vcc. It will protect the input of the gate and help shorten the discharge time. So the next switch closure can be detected much faster (the "gap" can be shorter).
Posted on 2003-06-26 11:22:26 by VVV
since you said something about differentiator, is there someone has made a tut on it in theory section? hehe, looks like none. doh! actually i was ever learn about differentiator and integrator circuit, but i am forgotful person :(

VVV, could you remind us a bit about them?

thanks a lot
Posted on 2003-06-27 07:24:21 by dion
Sounds like your assuming the designer of the circuit created a perfect design. LOL! I have seen some rediculous garbage out there. Very simple. If the question is "debounce" than an "integrater" is all that is needed. Or is it a differentiator I can't remember. Anyway a series resistor followed by a capacitor to ground. T=5RC meaning 63 percent of the full supply voltage will be reach at RxC time constant. "A little theory. Basically just put a scope on it and raise the series resistance and the parallel capacitance until the bounce is gone. That's called application engineering. Sure the more theory you know the better you understand what your shooting for but the RESULT is what your after. Another key component that must be considered is "cost to build". Make it cheap as possible and try to keep the quality as high as possible. All engineering design is a compromise. The formulas you devise will be your trade mark. Don't over analyze one guys design but rather understand what he is trying to acheive and do some research if necessary and do it better and "Cheaper". FASTER SMALLER CHEAPER is the name of the game.
Posted on 2003-06-29 12:10:23 by mrgone
Hi, dion,

This is in reply to your request to post something about integrators/ differentiators. The theory behind these circuits is not really that complicated, but rigorous analysis requires some advanced math, namely the knowledge of the Laplace transform.
Anyway, I am attaching a picture which should help.The formulas in the picture use that transform, where "s" is the complex variable.

A simple integrator circuit can be built with an RC network, as shown in the first figure. Note that an ideal integrator would produce a straight ramp at the output for the square wave input. This circuit produces an exponential, which APPROXIMATES a straight line response for long time constants. The longer the time constant, the better, but also the smaller the amplitude of the output signal.

A simple differentiator can be built by reversing the R and C. Note that this circuit works best when the time constant is as short as possible. But that implies a small C be used. And so any parasitic capacitance (such as the input to the next stage) will influence the operation of the circuit (will make the amplitude smaller). The output is very different from that of an ideal differentiator.
In the schematic you presented R10 is tied to +5V instead of the ground, so the entire output waveform (the red one) is shifted up by 5V. Therefore, the negative-going pulse will actually start at 5V instead of 0V and instead of being negative, its bottom will be at 0V.

The performance of both circuits is improved by the use of opamps: the integrator amplitude can be large and it is much more linear. The differentiator benefits from the low output impedance of the opamp, which isolates the RC network from the next stage.
Note that the differentiator also uses two additional components (R1, C1). They help filter out the high frequency signals. (They actually make the circuit work like an INTEGRATOR AT HIGH FREQUENCY). That is necessary because the impedance of a cap (C in this case) decreases with increasing frequency and so the high frequency noises would be amplified dramatically. This circuit produces an output which more closely approximates an ideal differentiator.

(Note the heavy use of APPROXIMATE. That is generally the case in design. You are not after the PERFECT thing, just after the SATISFACTORY one, that will do the job reasonably. Complexity generally improves performance, but at additional cost).

This was supposed to shed some light. I hope it will not raise more questions than it answers.
Posted on 2003-06-29 22:31:07 by VVV
mrgone: looks like i've been caught in action :grin: but the problem is i dont expert in analyzing, and i was a type that feel have to be understand something very completely.

VVV: thanks for the quick review. i remember it when i saw the picture :) hope i wont asking any question anymore?
Posted on 2003-06-30 08:33:36 by dion