Easiest touch sensor/switch - Page 1
Forum section: electronics / beginners

author: facumedica
author_rank: Contributor
timestamp: April 19, 2014, 12:16:31 am
content: Hey guys! I'm making a power supply and I want to replace the common switches with a capacitive touch. It does not need to be latching or anything, just send a High or low to the microcontroller.I've seen a lot of circuits online but the problem is that you must TOUCH the sensor, but I want to put the electrode beneath the plastic cover which is 2-3mm thick.Is there a way of doing it without using specialized IC? I mean, doing it with Op-Amps or logic gates would be awesome ('cause where I live, Argentina, isdifficultimpossible to get components, so 80% of what I use is recycled).Thanks!

author: Jeroen3
author_rank: Super Contributor
timestamp: April 19, 2014, 09:57:39 pm
content: You can buy IC's to do this. There are complex ones with I2C or SPI.But also simple ones with 4 input and 4 output or even 1 input and 1 output.Take a look at Atmel, they have some of this stuff, they also have QTouch inside some microcontrollers.http://www.farnell.com/datasheets/731627.pdfBut any microcontroller can do it using pwm or adc, it's very simple. Just measure the capacitance.

author: facumedica
author_rank: Contributor
timestamp: April 20, 2014, 10:20:10 pm
content: As I said, is impossible to get components. To give you a reference: we recycle logic gates. Yes, the most common, cheapest ICs.Do you know where I can get more information?Thanks!

author: KerryW
author_rank: Regular Contributor
timestamp: April 20, 2014, 10:56:53 pm
content: I have done it 2 ways.1) Make an RC oscillator using using a voltage comparator, with adjacent pads as the capacitor. Use the uController to measure the frequency. You may need a small cap across the pads to get it to oscillate.2) Use the pads as a capacitor, with a pull up resistor. Pull the line low, then open it (tri-state or open collector/drain). Measure the time it takes to go high with a high impedance logic input or a voltage comparator. Depending on the resources available in your ucontroller, you could do it for 1 resistor per switch.

author: SeanB
author_rank: Super Contributor
timestamp: April 21, 2014, 08:47:06 am
content: Simplest is to make a high frequency clock ( around 50-100kHz) and feed it to the touch pads ( which are a square of metal about 2cm by 2cm on the back of an insulated front panel) via a high value resistor ( try between 100-330k, depending on how big the touch square is) with a simple 1 transistor buffer amplifier driving a simple diode peak detector. thus when you touch the panel ( or come close) the finger capacitance drops the signal level, and then the transistor amp lowers the level of the output into the detector diode, and you simply detect the lower voltage across the detector capacitor. Simple method of detecting is to use a CMOS inverter biased with a 1M resistor to operate linearly, feed with the plate signal, and on the output use a diode and capacitor to detect if there is oscillation or not.

author: djsb
author_rank: Super Contributor
timestamp: April 21, 2014, 10:22:53 am
content: Also a PIC16F1827 (et al) has a capacitive touch module built in. We use them in our embedded class.http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en538963David.

author: Richard Crowley
author_rank: Super Contributor
timestamp: April 21, 2014, 12:05:59 pm
content: Note that there are also methods which used ordinary LEDs to both generate, and then detect close reflections (fingertip). One could use the same LED to indicate the status of the switch, and to do the sensing of the actuation.

author: PA0PBZ
author_rank: Super Contributor
timestamp: April 21, 2014, 01:05:34 pm
content: Quote from: Richard Crowley on April 21, 2014, 12:05:59 pmHmm, "press" the button, the LED goes out, "press" the button again, the LED... oh, wait...

author: facumedica
author_rank: Contributor
timestamp: April 21, 2014, 03:06:15 pm
content: Thanks guys for your replies! Is just matter of time to get it working.I will need to do thousands of experimentsKeep the ideas coming!

author: Zero999
author_rank: Super Contributor
timestamp: April 21, 2014, 04:13:13 pm
content: Quote from: SeanB on April 21, 2014, 08:47:06 amThis will work using a single logic chip, such as the 74HC14. You'll need to experiment with the component values of course.

author: facumedica
author_rank: Contributor
timestamp: April 21, 2014, 09:59:03 pm
content: Quote from: Hero999 on April 21, 2014, 04:13:13 pmThanks! I've got a few of those, as soon as I can I will be testing it!