News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

Using RCin as touch button

Started by Yves, Aug 20, 2021, 01:03 PM

Previous topic - Next topic

Yves

Hello everyone,

I had an idea to test the RCin command to see if I could use it as touch button. I use the circuit B on page 178 of the positron8 manual where one pole of the capacitor is connected to the +5V. For the capacitor I stick an aluminum foil of about 2.5 by 2.5 cm on one side of a plastic instrument  casing and same size of foil on the other side covered with scotch so the touch side was galvanically insulated . my multimeter could not read the capacitance as it is below 10nF. I used 330K for the resistor which was giving me the highest count difference. I use a 18F25k22 at 64Mz for the test but I'm sure any 16F or 18F pic will do. I sent the value to the serial port and set a threshold to light a LED on or off. The value varying from 18-19 counts when not touched and when touched I got 35-to 42 counts depending to the finger pressure. It worked pretty well. I'm planning to get my next instrument using this technic, where the top thin copper foil will be covered by a thin sticky printed plastic foil face. I found the that simple circuit was pretty stable and not influence by statics.
My question is: Is it the best way to do a touch button and his anyone has a better idea to do it without using the special Pics which have a touch function? I would be grateful the read your experiences on that matter.

Cheers,

Yves     
Yves

normnet

I utilized a touch sensor switch with excellent results however it would be a bit of a power draw for a battery operated device as it frequently required multiple AD samples to monitor the switch sensor.  See Microchip AN1298 Capacitive Touch Using Only an ADC.

Yves

Is the RCin works the same way as Pot commands?

Cheers,

Yves
Yves

Yves

Hello All,
I have been testing my idea using RCin as touch button command in many condition to see how it can be affected in various conditions. For example dry fingers, wet fingers also using thin rubber gloves which are often use in laboratories. I have even spilled water over the thin plastic insulator which then gave me a false positive press signal but soon I wiped off the water everything worked as intended. I have also tested the circuit using only battery to power the circuit and not connected to anything else as I thought there were stray capacitance when the circuit is connected via RS232 to the PC and it worked just fine. I never experienced any false glitch even after monitoring for 24 hours. For the anode and cathode I will be using copper laminated foil that are used for shielding electric guitar which is self-adhesive.   After all these test I will use this system as control buttons to all my instrumentation.  I have enclosed the exploded diagram of the touch button concept and an excel chart of the RCin signal capture and also the code I used.
Not a valid attachment ID.Two buttons chart.zip
Yves