Experimentalist
Well-known member
Hi, if I want to use the touchRead(pin) function with Teensy LC, 3.0, 3.1, 3.2 & 3.6 do I just connect a wire to a touch enabled pin or should I use a series resistor of some sort?
… The receive pin may be connected with a wire, but a 1K or higher resistor will help protect the Teensy's pin if a user directly touches the object and delivers an electro-static shock. The safest construction uses an insulating layer, such as the clear tape in the example above.
Multiple sensors can share a single send pin, but each must have its own receive pin.
Teensy's ground pin should be connected to earth ground for best results. Normally the USB cable connects to a PC, which connects to earth ground by its power code. But when using a laptop on battery power or running without a computer, you may need to make a dedicated connection to earth ground.
Teensy LC, 3.0, 3.1, 3.2 & 3.6 have superior hardware-based capacitive touch sensing circuitry on specific pins. They do not require this library. To read capacitance on those pins, simply use touchRead(pin). Hardware-based sensing offers much faster measurements with better stability over temperature variation.
This PJRC page: https://www.pjrc.com/teensy/td_libs_CapacitiveSensor.html
Has a sample assembly … and some details on usage:
As you can see in the reference manual
If you want to protect the pins, use diodes with small reverse junction capacitance as follows: GND -|>|- PIN -|>|- 3V3 . The reverse junction capacitance (i.e. 4pF for a 1N4148) will add an offset of about 200 to your touch readings, but that can easily be compensated in software.
The above is designed to use the CapacitiveSensor library not the native touch pins of the Teensy LC, 3.0, 3.1, 3.2 & 3.6, it is a completely different beast that is why I started this thread.
I'd not rely on the weak internal protection and add the diodes
A German word play says "Versuch macht kluch" (Experimenting will make you smarter)
in experiments here it was with and without resistor and both worked
No! As you can see in the reference manual, the Kinetis touch engine (TSI) works with switched constant current sources and charge/discharge thresholds for pure capacitive detection. Series resistors would create a constant voltage drop due to the constant current driving, so that the thresholds would never be reached
Interesting but seems to contradict this quote:
...
Sorry if this is a simple question but can you explain the theory behind the diodes. I guess if the input pin goes more negative than Gnd by approx 0.6V then it sinks to ground and vice versa if it goes more positive than around 3.9V it sinks to the 3.3V pin. I kind of get the Gnd side but not the 3.3V side, could you explain please?
...