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

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

Touch Sensitive Switch

Post by JohnCrow »

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.
Circuit Diagram
Circuit Diagram
Touch-Circuit.gif (3 KiB) Viewed 11731 times
Breadboard Prototype
Breadboard Prototype
Breadboard.jpg (103.58 KiB) Viewed 11731 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
Touch Switch
Touch Switch.JPG (115.15 KiB) Viewed 11731 times
The sensors are actually held on the board by a blob of epoxy resin on the back.
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

Post by Spanish_dude »

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: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Touch Sensitive Switch

Post by Steve001 »

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: 263
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 116 times
Been thanked: 113 times
Contact:

Re: Touch Sensitive Switch

Post by STibor »


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

Re: Touch Sensitive Switch

Post by JohnCrow »

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: 263
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 116 times
Been thanked: 113 times
Contact:

Re: Touch Sensitive Switch

Post by STibor »

Simple programs and circuits.
Attachments
vizor1 2.fcf
(8 KiB) Downloaded 432 times
vizorpcb.PDF
(158.05 KiB) Downloaded 478 times
vizorsch.PDF
(16.97 KiB) Downloaded 613 times

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

Re: Touch Sensitive Switch

Post by JohnCrow »

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: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Touch Sensitive Switch

Post by jgu1 »

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

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

Re: Touch Sensitive Switch

Post by JohnCrow »

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.
E-Blocks Setup
E-Blocks Setup
DSC00720.JPG (133.29 KiB) Viewed 11621 times
Simple touch.fcf
(12.22 KiB) Downloaded 410 times
1 in 10 people understand binary, the other one doesn't !

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Touch Sensitive Switch

Post by jgu1 »

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: 364 times
Been thanked: 716 times
Contact:

Re: Touch Sensitive Switch

Post by JohnCrow »

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.
1 in 10 people understand binary, the other one doesn't !

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Touch Sensitive Switch

Post by jgu1 »

Thank´s John :D

Post Reply