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

Thread: many teensies for rapid parallel proximity sensing.. but which teensies?

  1. #1
    Junior Member
    Join Date
    Feb 2021

    many teensies for rapid parallel proximity sensing.. but which teensies?

    Hi Everyone.

    I'm working on a project that requires input from 5 cherry mx switches, 5 force sensors, 5 capacitive touch sensors, a photodiode and an EEG shield. I'm using a teensy 4.1 to poll all of these sensors and to function as the primary timekeeper for generating timestamps for every sensor reading. I need a 1+ kHz sampling rate. Polling has been rapid and I could easily achieve above 1kHz.... if it were not for the slothful capacitive sensors!

    The capacative sensor electrodes will be comprised of either tinfoil insulated by paper or will be made of a 3D-printed conductive resin. Either way, the sensor size will be about 14mm wide and 1mm thick. The sensors will be connected to a teensy via a standard hookup cable that has the nice convenient plug and play headers. The sensors must be sensitive enough to be able to rapidly detect the onset of movement of a finger from at most 1cm away through the insulator.

    So I've been testing with the tinfoil and a teensy 4.1 just to get the hang of things, and it is far, far too slow to be able to poll 5 capacitive sensors while maintaining a 1kHz sampling rate even if I didn't have to poll anything else. I've tried a few different capacitive sensing libraries and none suit my needs, so now my current plan is: get one teensy LC/3.2/3.6 per capacitive sensor. Use the touchRead function and then output the signal through the analog port to the main teensy 4.1 that is doing all the polling. So I'd have 5 teensies acting like subprocessors and plugged into the main teensy 4.1 via 5 analog pins (one for each capacitive sensor/subprocessor combo).

    I am unfamiliar with I2C, mostly think it sounds slow and digital, so I am trying not to use it, which means I need a teensy per capacitive sensor so that I have enough analog output ports. This is okay with me because this also means all the capacitive sensors will be polled in parallel.

    So my question is: Which teensy should I get to use as the subprocessors doing touchRead for these 5 sensors? Please keep in mind that I am a novice in all things teensy and sensors, so I'd like to use a teensy for which it is not that hard to change the parameters that alter sensitivity without drastically reducing speed (I saw the forum post about that difficulty changing sensor current with the teensy 3.6, but that was 2 years ago so not sure if things/code have changed). It is very important that the teensy is also fast enough to be able to read a sensor as described above and transmit the reading via analog to the main teensy 4.1 in <500us since we can assume I am not informed enough to have perfectly optimized code. Also, I don't know what the output of touchRead looks like, but if it is anything like the other capacitive sense libraries and goes on a scale far beyond 1023, I imagine it will need to be scaled down before sending to teensy 4.1, in which case the sensitivity probably needs to be able to account for that to maintain an adequate SNR.

    I am an exhausted senior grad student out of my domain here, so while teensy has been very fun to learn, at this point I'm really just hoping to keep this simple but fast. Thank you so much for any help/advice! I AM FOREVER IN YOUR DEBT!

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Buying a Teensy LC would have least cost - especially if you really use 5 of them. Not sure of any reason it wouldn't work as well as the others for this dedicated purpose?

    See this for PCB creation and DEMO:

    It links to REPO with DEMO vid that may give function details :

    Not sure about that read speed being fruitful or possible - above links my give some notes as used.

    Quick look at DEMO's show values over 2000 - with a single Teensy doing the reading it could shape/scale the output in any steps and analog values could be any desired 10, 11, 12 bits to the T_4.1.

    Since the T_LC has a brain - if you have spare digital pins on T_4.1 it could trigger for read on any change that is worth reading a new value for the T_4.1

Posting Permissions

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