Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Teensy 3.0 capactive touch noise induced by computer

  1. #1
    Junior Member
    Join Date
    Jun 2016
    Posts
    4

    Teensy 3.0 capactive touch noise induced by computer

    Hi there,

    Just wanted to share that I've encountered a singular problem. I am building a capacitive keyboard using the teensy touch pins, and I'm connecting some sort of touch plates (pcb made) to those pins. Leds turn on corresponding to the key pressed. Here's the problem : If I am sitting in front of my computer, it's going to behave erracticaly. I have simplified the code to the point where it's only reading the values and serialprinting them. Problem is still here. If i get up of my chair, and stand far from my computer (like, not standing in front of it) and press the keys, it behaves perfectly. A friend of mine was here, played on it while I was in front of the computer, no problem. He sits in front of my computer, plays, it behave like a christmas tree. If I unplug the touch plates/keyboard from the teensy the problem almost vanishes, because I guess it becomes less sensitive to this kind of perturbation.

    My computer is a lenovo T400.

    I would be curious to hear some thoughts about this,

    Cheers.

    Edit :

    If I bring my hands close to the plastic casing of the computer it gets really intense with the leds.
    But if I do the same with my friend's macbook, nothing.
    I mostly want to bring the attention that if you gets weird readings with the touch pins, try to stand away from you computer it could be the problem.
    Last edited by siri; 08-14-2016 at 10:35 PM.

  2. #2
    Senior Member pictographer's Avatar
    Join Date
    May 2013
    Location
    San Jose, CA
    Posts
    664
    Without seeing your code, I don't know if you're doing anything to calibrate the sensors. If you're not doing anything to calibrate, you need to.

    Think of it this way: you're going to weigh something, but the scale already has a few items on it. First you have to figure out what value of touchRead() corresponds to zero.

    Next you need to figure out a method for deciding whether a value of touchRead() greater than your starting offset is an actual press or just noise. Not unlike debouncing a switch, you might need to make a rule for how many readings that exceed a threshold during a given amount of time should be interpreted as a key press.

    As you've discovered, if you change the environment, the readings change, so you may need to recalibrate.

  3. #3
    Senior Member Constantin's Avatar
    Join Date
    Nov 2012
    Location
    In the yard with a 17' Dia. Ferris Wheel
    Posts
    1,408
    Agree violently with pictographer (as usual). Another issue is simply grounding. I found that grounding issues made it really difficult to make a cap-touch based water level sensor work consistently - basically, the computer power supply could add a lot of noise, shift the output of the cap-touch sensor and so on. Going to a grounded power supply helped (but the presence of three prongs is NOT a guarantee that the designer grounded the earth to the PS output GND)

    Similarly, a calibration routine helps too at startup. I.e. the device has to learn what 'normal' is then adjust the program as 'non-normal' things are encountered. Debouncing switches is a very good idea no matter what kind of input you're using (i.e. mechanical or cap touch). I never got it to work right (the water level sensor) so I went to a very reliable optical water level switch instead.

    However, there are many successful projects out there that use cap-touch switches for inputs. So it definitely can be done.

  4. #4
    Junior Member
    Join Date
    Jun 2016
    Posts
    4
    Hi Pictographer and Constantin,

    Thanks for you inputs.

    I did calibrate and set up a threshold. I also reset it when I change the environnement. Itīs working well only if I don't sit in front of my computer. Letīs put it another way. I turn it on, play with it with my left hand while not being in front of my computer, it works nicely. And while my left hand is playing, I slowly bring my right hand in front of my computer : it start behaving like a christmas tree. My computer is not earth grounded though, compared to my friendīs macbook which is (and doesn't influence the reading).

    Edit: his macbook has three prongs, but as constantin said it doesn't mean it's geound to earth. I'll check next time.

    I will double check next time i'll work on it but I think the teensy was grounded to earth (but not 100% sure).
    Last edited by siri; 08-15-2016 at 02:56 PM.

Posting Permissions

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