Touch sensitive input

premier8

New Member
Can anyone give me an example (diagram/code) for a touch sensitive input that will generate an output when touched.
Thanks
 

Andrew Cowan

Senior Member
A switch, or when you touch two wires?

If you want to use the 'two wire' method, just do the normal switch circuit, but replace the pull up/down resistor with a 1M resistor, and the switch with two wires.

That should work.

A
 

premier8

New Member
Touch switch

Is it just a fingertip touching two contacts?

Here's a circuit, about 1/3 way down,
titled Darlington pair.

http://www.kpsec.freeuk.com/trancirc.htm

Could you explain a bit more
about what you need?

What's your project about?

e
Thanks. Idealy I would like a single pad as a touch sensitive area to generate a change of state when touched by a single finger, or a pair of touch pads in close proximity. Iam working on a couple of projects that could be enhanced by touch switching. Ive looked up a bit of research on the net, and capacitive touch switching would seem to be the way forward, but I haven't seen any examples of input interfacing to the Picaxe chips.
 

Dippy

Moderator
Sorry, I have no circuit diagram.

If you get onto Farnell website (for example) and search on "Qprox" you will get a pile of chips.

The only QProx I have used is the single channel type and the output is simple push-pull so connecting to a digital pin is a piece of cake. i.e. you connect it.
I used it in conjunction with a large-ish plate to detect footfall on a step - it worked well.

Have a look at this to see the principle:-
http://www.farnell.com/datasheets/82017.pdf
It doesn't get much easier, but need playing with to get the best out of them.
You can 'adjust' the range so that the sensors ('buttons') can be behind a sheet of plastic.
 

Rickharris

Senior Member
This sounds tackier than it can be if you take care and think about the final looks.

Glue a square of aluminium foil onto a slightly larger piece of card or plastic - do this twice. Attach a wire to each foil patch - At school we used to staple them on then solder onto the staple.

Take a 3 rd bit of card/plastic and cut a hol in the middle, bigger the hole less pressure needed.

Put it between the 2 bits with the foil and glue it all together.

When you press on the top the 2 pieces of foil touch making the contact.

Looks like a touch switch why go to the trouble of using a micro switch etc or complicated (slightly) electronics?


We used to print a switch cover onto Mylar drawing film and use that to top it off. Can be back lit if required with LED If more robust assembly required use thicker plastic - even 3 mm acrylic works if a large enough area to deform.
 

hippy

Technical Support
Staff member
Using two 1N4148 diodes gave pretty reliable, non-zero when touched, results on the desk when I tried it. I'm sure this could be improved upon ...

Code:
'  .---__---.
'  | 0V  +V |                   
'  | SI  O0 |                 |   O 
'  | X4  X1 |----|>|---|<|----| --|-'
'  | I3  X2 |                 |  / \
'  `--------'

#Picaxe 08m
#Terminal 9600

SetFreq M8
Do
  Count 1, 100, w0
  SerTxd( #w0, " " )
Loop
 

hippy

Technical Support
Staff member
Slight modification, and this seems rock solid on a LED for me. If the output is dropping out ( I suspect it is ), an R-C on output should hopefuly fix that, or use some more complicated programming.

Code:
'  .---__---.
'  | 0V  +V |                   
'  | SI  O0 |                   |   O 
'  | X4  X1 |---|>|---.---------| --|-'
'  | I3  X2 |        _|_        |  / \
'  `--------'        /_\
'                    _|_ 0V

#Picaxe 08m

SetFreq M8
Do
  Count 1, 100, w0
  if w0 > 1 Then
    High 0
  Else
    Low 0
  End If
Loop
 

Andrew Cowan

Senior Member
Obvious, really...

When my frequency counter isn't connected to anything except a bit of wire (eg an aerial), it always reads 50.000Hz from mains pickup.

A
 

BeanieBots

Moderator
So if you are stood in a field miles from any mains with this device it won't work?
Possibly, but I doubt there is anywhere in the UK which is far enough away from any UHV 50Hz mains transmissions not to pick up enough signal.

Connecting a long wire to a low frequency PWM pin should cure the problem of no local signal to pick up.
 

eclectic

Moderator
I tried Hippy's program and circuit from post #9.
LED/resistor connected to output 0.
Works fine, when touching the diode leg.

I then connected a short length of insulated single-core wire,
to the diodes' junction.
Again, it works fine.
And also works when touching the plastic insulation.

Thirdly.
Carried the breadboard to a 4-way “multiblock”

The indicator LED lit when the board was ~6” / 150mm from the block

Finally, it “works” near mains switches and “live” wires.

There's nothing new here, but, it's cheap and easy to play with.

Might be useful for a quick School project.
Or, I've seen several questions here, regarding
“mains – detectors”.

Possibly worth playing?

e
 

Andrew Cowan

Senior Member
Can you desensitise it by connecting a resistor (1M, say) between the 'touching part' and ground? It could be a good thing to find if a wire is live - just touch it on the insulation.

A
 

BeanieBots

Moderator
Yes you can, but 1M would probably be an order of magnitude (or two) too small.
You could experiment with caps as well.
PICAXE input Z ~100M. So 100M would ~halve sensitivity.

Not sure why you would want to desensitise it. If you get nuisance tripping, then it would be better to reduce the pickup by using co-ax between input and touch-pad.
 

eclectic

Moderator
From Andrew
"Can you desensitise it by connecting a resistor (1M, say) between the 'touching part' and ground? It could be a good thing to find if a wire is live - just touch it on the insulation."

I'd already read BB's post #4,
in this thread:
http://www.picaxeforum.co.uk/showthread.php?t=2047&highlight=qprox

So, in answer to your question,
Yes, a 1M&#937; will “desensitise”
(I tried it earlier, and my circuit didn't work.)

However, I deliberately left it out, for the
“mains detection” post above.

e
 

hippy

Technical Support
Staff member
I tried Hippy's program and circuit from post #9.
LED/resistor connected to output 0.
Works fine, when touching the diode leg.
Thanks for trying it which confirms I'm not in some strange magnetic field not affecting anyone else !

The circuit in post #8 didn't work so well with a LED, the LED sometimes latched into a toggling on and off mode. Post #9 works much better but I've no idea how or why the circuits works. The first surprised me as it's two diodes 'head on' which should block current flow either way. Probably something magical to do with AC and reactance, or flux capacitors.

The fun in all this is it's simple components and easy to play with. Franklin, if alive, would have probably hoisted it up on a kite.
 

BeanieBots

Moderator
The two diodes head to head will have leakage current.
Against the ~100M input impedance of a PICAXE IP, it looks like a simple potential divider. (there will also be capacitive coupling).

A good example which demonstrates that diodes (just like ALL components) are NOT perfect.
 
Top