Touch Sensitive Switch

Tips, Tricks and methods for programming, learn ways of making your programming life easier, and share your knowledge with others.

Moderators: Benj, Mods

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 381 times
Been thanked: 720 times
Contact:

Touch Sensitive Switch

Postby JohnCrow » Sun Sep 09, 2012 3:47 pm

Touch Sensitive Switch.

While browsing a component website I came across an IC shown as a 2 Channel touch switch.
It was under a couple o quid so I added a couple to the order to have a play with.

When it arrived it as an 8pin dip device with a small sticky label on the top. I immediately pealed this off to see what the device was.

It turned out to be a 12F683 PIC.
The code was protected (as expected) so I was not able to read it to see how the device was programmed :(

I wired it up on the bread board to test it out, and it works exactly as shown in the specs.

I built it up on a small PCB with a couple of chrome touch sensors.

The sensors are screw in covers to fit in a countersunk screw from the local diy shop.
Because they are chrome plated it was not possible to solder them and the thread is not long enough to use a nut and connector on the back.

The touch inputs are use a 1M-ohm pull up resistor to Vdd.

I made the connection by having a couple of bent over bits of wire under the dome, and connected these to the pcb.

The switches allow the sensors to be set to either latch or momentary.
Pins 4 & 5 on the chip are connected to the switch common termnals, with pins 1 & 2 on the switch to Vdd or Gnd


The screw terminals are left to right
Vdd, Gnd, Output1, Output2

The device will work on any voltage from 2.5V to 5V.
This makes it usable with PIC, AVR, ARM or Raspberry Pi without the need for an external voltage regulator.

Touch-Circuit.gif
Circuit Diagram
Touch-Circuit.gif (3 KiB) Viewed 7537 times


Breadboard.jpg
Breadboard Prototype
Breadboard.jpg (103.59 KiB) Viewed 7537 times


My breadboard has a PP3 battery and 7805 regulator underneth it.
The 4mm binding posts are connected to the regulator input and the spring termnals to the regulator output (5V).
The switch on the top of the case turns off the battery.

The blue & yellow wires at the bottom of the photo are the touch inputs.
It will actually switch by touching the insulation as well as the metal contacts.

Touch Switch.JPG
Touch Switch
Touch Switch.JPG (115.16 KiB) Viewed 7537 times

The sensors are actually held on the board by a blob of epoxy resin on the back.
These users thanked the author JohnCrow for the post (total 3):
Steve001 (Sun Sep 09, 2012 7:50 pm) • dazz (Mon Sep 10, 2012 8:10 pm) • jgu1 (Tue Sep 11, 2012 11:45 am)
Rating: 15%
 
1 in 10 people understand binary, the other one doesn't !

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times
Contact:

Re: Touch Sensitive Switch

Postby Spanish_dude » Sun Sep 09, 2012 7:47 pm

Probably some AD conversion using the PIC.
Have you tried probing the inputs ? See what the signal looks like.

If you know what happens when you touch the switches you could probably make your own program.

Nicolas

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1128
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 521 times
Contact:

Re: Touch Sensitive Switch

Postby Steve001 » Sun Sep 09, 2012 7:54 pm

sorry if this has posted twice .

Looks like a good project john

I was going to have a play with touch sensors but time evades me :(

Have a look here there is some code examples too

http://www.bytecraft.com/Touch_Sensitive_Switch

steve
Success always occurs in private and failure in full view.

User avatar
STibor
Posts: 262
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 115 times
Been thanked: 112 times
Contact:

Re: Touch Sensitive Switch

Postby STibor » Sun Sep 09, 2012 7:57 pm

These users thanked the author STibor for the post:
JohnCrow (Sun Sep 09, 2012 8:03 pm)
Rating: 5%
 

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 381 times
Been thanked: 720 times
Contact:

Re: Touch Sensitive Switch

Postby JohnCrow » Sun Sep 09, 2012 8:00 pm

I do intend having a look at trying to replicate it it flowcode sometime.
Dont think it will be too difficult, but like Steve its finding time for all these projects.
1 in 10 people understand binary, the other one doesn't !

User avatar
STibor
Posts: 262
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 115 times
Been thanked: 112 times
Contact:

Re: Touch Sensitive Switch

Postby STibor » Sun Sep 09, 2012 8:20 pm

Simple programs and circuits.
Attachments
vizor1 2.fcf
(8 KiB) Downloaded 253 times
vizorpcb.PDF
(158.06 KiB) Downloaded 307 times
vizorsch.PDF
(16.98 KiB) Downloaded 436 times
These users thanked the author STibor for the post (total 2):
dazz (Mon Sep 10, 2012 8:10 pm) • jgu1 (Tue Sep 11, 2012 11:44 am)
Rating: 10%
 

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 381 times
Been thanked: 720 times
Contact:

Re: Touch Sensitive Switch

Postby JohnCrow » Sun Sep 09, 2012 9:00 pm

Thanks STibor
That looks interesting.
I'll try your program out when I get chance.
1 in 10 people understand binary, the other one doesn't !

jgu1
Posts: 1176
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1102 times
Been thanked: 294 times
Contact:

Re: Touch Sensitive Switch

Postby jgu1 » Tue Sep 11, 2012 11:44 am

Hi all!

Here are some related projects:

http://www.pcbheaven.com/circuitpages/P ... ch_Button/
http://www.pcbheaven.com/circuitpages/P ... _Function/

Very interesting. It would be nice if someone could translate them into FC I have no experience with C or assambler.

Best regard

Jorgen
These users thanked the author jgu1 for the post:
Benj (Tue Sep 11, 2012 2:28 pm)
Rating: 5%
 

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 381 times
Been thanked: 720 times
Contact:

Re: Touch Sensitive Switch

Postby JohnCrow » Sun Sep 16, 2012 2:27 pm

This is a simple flowchart and circuit to use the touch switch board with an ECIO

With the slide switch to the left, the channel latchs
With the slide switch to the right the channel toggles.

For example if Sensor 1 is set to latch and Sensor 2 to toggle.
Touch Sensor 1. It will show Sensor 1 Touched. Then touch Sensor 2, it will show Both Sensors Touched.
To unlatch Sensor 1 touch it again.

DSC00720.JPG
E-Blocks Setup
DSC00720.JPG (133.29 KiB) Viewed 7427 times


Simple touch.fcf
(12.22 KiB) Downloaded 238 times
These users thanked the author JohnCrow for the post:
jgu1 (Mon Sep 17, 2012 11:16 am)
Rating: 5%
 
1 in 10 people understand binary, the other one doesn't !

jgu1
Posts: 1176
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1102 times
Been thanked: 294 times
Contact:

Re: Touch Sensitive Switch

Postby jgu1 » Mon Sep 17, 2012 11:29 am

Hi John! :D

Very interresting. I will test it this evening.

Maybe something I have misunderstood, but where can I find the input for the slideswitch in the program.


Do you have tied the input to ground with a resistor,if you have is 1M ok :?:

Best regard

Jorgen.

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 381 times
Been thanked: 720 times
Contact:

Re: Touch Sensitive Switch

Postby JohnCrow » Mon Sep 17, 2012 12:37 pm

Hi

The slide switch is not in the flowcode program.
They connect pins 4 & 5 on the 8pin device to either 5V or Gnd.(This sets it to latch or toggle)
The 8pin pic was bought as a touch switch device. See the first post in the thread.

The touch inputs have a 1M-ohm pull up to the +V line.
These users thanked the author JohnCrow for the post:
jgu1 (Mon Sep 17, 2012 12:54 pm)
Rating: 5%
 
1 in 10 people understand binary, the other one doesn't !

jgu1
Posts: 1176
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1102 times
Been thanked: 294 times
Contact:

Re: Touch Sensitive Switch

Postby jgu1 » Mon Sep 17, 2012 12:55 pm

Thank´s John :D