16F726 Capacitive sensing module


Closed Thread
Results 1 to 40 of 40

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

    Default Re: 16F726 Capacitive sensing module

    After some testing, it seems that with the modification Darrel suggested, it needs to touch very quickly to get a 'pressed=1' flag.

    If you approach relatively slow the touch pad it won't get triggered. I may have to play with the constants in the CSM and average too.

    But it made a very reliable system now.

    Thanks for the tips.

    PIC16f1827 with the internal CSM module makes it very easy to make a touch keyboard. Only a couple of registers to setup and you are ready.

    Ioannis

  2. #2
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: 16F726 Capacitive sensing module

    Yes the deviation from the 'normal' (no finger nearby) CSM output count, is related to how long the sample period is vs how long you actually touch the sensor for.....also the physical composition of the sensor itself, and how moist your finger is!

    So a quick touch might only see a 5% deviation from the normal count, whereas a long sensor press, will see the CSM output count plummet.
    Last edited by HankMcSpank; - 6th December 2011 at 16:18.

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: 16F726 Capacitive sensing module

    Quote Originally Posted by Ioannis View Post
    If you approach relatively slow the touch pad it won't get triggered.
    I think increasing the number of samples in the average will adjust that behavior.
    DT

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

    Default Re: 16F726 Capacitive sensing module

    OK, seems to work good now with these settings:

    PIC chip : 16F1827
    System clock : 32MHz
    Timer0 Int's : From system clock every 8ms
    Timer1 input : From CSM module
    CSM setup : CPSCON0 = %10001100
    CPSCON1 = %00000010
    T1CON setup : %11000001
    OPTION_REG : %10000111 Timer0 with /256 prescaller
    AvgCount CON 16 ' = Number of samples to average (max 32)
    FAspread CON 25

    Now you may wonder why the average constants are low valued. Because the system clock is high enough, clocking everything too fast. But with these settings looks OK for the touch pad I am testing.

    Ioannis

  5. #5
    Join Date
    Feb 2010
    Posts
    30


    Did you find this post helpful? Yes | No

    Default Re: 16F726 Capacitive sensing module

    Ioannis , geia !

    Is it possible to post the modified optimized code for the 16F1827?

    Thank you.
    Lakis.

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

    Default Re: 16F726 Capacitive sensing module

    Geia Laki.

    OK, it is over a year now. Hmm, where do I have this file?

    Let me search a bit, OK?

    Ioannis

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

    Default Re: 16F726 Capacitive sensing module

    OK, Here it is.

    It makes use of Darrels Averaging and Interrupt routines.

    Unfortunately I had not add comments and may be hard to follow this test code. Sorry about that.

    Ioannis
    Attached Files Attached Files

  8. #8
    Join Date
    Feb 2010
    Posts
    30


    Did you find this post helpful? Yes | No

    Default Re: 16F726 Capacitive sensing module

    OK !
    It is not so difficult to read.

    Thanks again!
    Lakis from Thessaloniki.

Similar Threads

  1. Version Control
    By btaylor in forum mel PIC BASIC Pro
    Replies: 33
    Last Post: - 16th October 2011, 17:12
  2. Relaxation oscillators (for capacititive touch sensing)
    By HankMcSpank in forum mel PIC BASIC Pro
    Replies: 24
    Last Post: - 6th December 2009, 22:03
  3. mTouch capacitive sensing
    By jrprogrammer in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 1st November 2008, 22:54
  4. Replies: 1
    Last Post: - 27th July 2008, 06:14
  5. Rf module
    By tangray in forum Adverts
    Replies: 0
    Last Post: - 7th August 2006, 07:14

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts