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).


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 - - -


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.


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.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…