Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Capacitive touch switch using a comparator......questions

Status
Not open for further replies.

boylesg

Advanced Member level 4
Joined
Jul 15, 2012
Messages
1,023
Helped
5
Reputation
10
Reaction score
6
Trophy points
1,318
Location
Epping, Victoria, Australia
Activity points
11,697
I have implemented this circuit on my bread board, using a KA393 comparator, and found that it behaves as a rather effective capacitive touch switch with a piece of Al tape on the back of a laminated paper sheet and a wire connecting it to Vin below.

First of all I more or less have my head around what a basic comparator does.

But I have some some questions about this more complicated circuit.

1) I am assuming that R1 and R2 form the voltage divider network as in an ordinary comparator with no hysteresis. Is this correct?

2) Hysteresis is when you feed the output voltage back into one of the inputs. So I assume that this means that the voltage on the inputs must rise above that noise level before a voltage change will appear on the output. So if you have a peak noise voltage of 5mV then voltage at the input must rise above that level before any change will appear at the output. Essentially correct? So I assume the positive feedback is happening through the voltage divider formed by R3 and R4? What is the purpose of feeding the output back into the input through a voltage divider? Why not just a wire connection?

3) What is the purpose of R5?
 

If you start of with Vin = 0V, then as the + input has a positive voltage on it the output must be + 5V. This increases the voltage on the positive input, to about 2V. So the Vin must now go more positive then 2V for the output to go to 0V. When the output goes to 0V, the voltage on the + input changes to a bit less then .5V, so the Vin must go lower then this .5V for the output to change the output again.
Frank
 

Not exactly (there is no "noise level" as you call it-I don't know what that means).

The amount of hysteresis is a function of the ratio of R4/R3. If R4 was just a wire, it would never work, as the input voltage would have to go higher than 5V when the output is 5V, but you can't drive the input much higher than the supply without damaging the chip. Similarly, when the output is low, you'd have to drive your input below ground. Look at it this way (neglect the loading that R3,R4 have on the Vref divider):

V(non-inverting)=(Vout-Vref)*R3/(R3+R4)+Vref.

1) Vout high(5V)==> Vni=(5-.45)*.32+.45 = 1.9V (Vin> 1.9V to force output low)
2) Vout low(0v)==> Vni=(-.45)*.32+.45= .59V (Vin < .59V to force output high)
 

Not exactly (there is no "noise level" as you call it-I don't know what that means).

Figure 4 shows a comparator circuit. Note first that the circuit does not use feedback. The circuit amplifies the voltage difference between Vin and VREF, and outputs the result at Vout. If Vin is greater than VREF, then voltage at Vout will rise to its positive saturation level; that is, to the voltage at the positive side. If Vin is lower than VREF, then Vout, will fall to its negative saturation level, equal to the voltage at the negative side.
In practice, this circuit can be improved by incorporating a hysteresis voltage range to reduce its sensitivity to noise. The circuit shown in Fig. 5, for example, will provide stable operation even when the Vin signal is somewhat noisy

If I stick my finger over a piece of Al foil below the laminated sheet then I assume the input signal would be very 'noisy' as per the above.

- - - Updated - - -

Not exactly (there is no "noise level" as you call it-I don't know what that means).

The amount of hysteresis is a function of the ratio of R4/R3. If R4 was just a wire, it would never work, as the input voltage would have to go higher than 5V when the output is 5V,

Of course, I didn't think of that but it makes perfect sense to me. Similar sort of thing to transistor biasing where, I guess, if you make the base bias voltage too high then the signal strength would have to go to a rather high level before it got amplified, resulting in considerable distortion.

So presumably you have to determine the peak voltages of any noise in order to know how much hysteresis to apply and it was just a fluke in this instance that the amount of hysteresis in this circuit was just right for me to make a capacitive touch sensor.

but you can't drive the input much higher than the supply without damaging the chip. Similarly, when the output is low, you'd have to drive your input below ground. Look at it this way (neglect the loading that R3,R4 have on the Vref divider):

V(non-inverting)=(Vout-Vref)*R3/(R3+R4)+Vref.

1) Vout high(5V)==> Vni=(5-.45)*.32+.45 = 1.9V (Vin> 1.9V to force output low)
2) Vout low(0v)==> Vni=(-.45)*.32+.45= .59V (Vin < .59V to force output high)

So from this is appears as though my finger is acting as the positive plate of the capacitor. If the output is high (LED on) then the inverting input must be low which means my finger (the other side of the touch sensor capacitor) must be high.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top