The datasheet mentions the possibility of latch-up when the supply lines are noisy (http://www.adafruit.com/datasheets/AT42QT1010.pdf
, page 13), and the NeoPixels will definitely create noise.
First thing to do: arrange your connections so VCC and GND enter the circuit between the NeoPixels and everything else. Imagine replacing every wire between two devices that connect to VCC or GND with a resistor. The arrangement you don't want is:
- Code: Select all
+- VCC --\/\/-- NeoPixelVCC --\/\/-- TrinketVCC --\/\/-- TouchSenorVCC -+
+- GND --\/\/-- NeoPixelGND --\/\/-- TrinketGND --\/\/-- TouchSenorGND -+
because any fluctuation in current through the NeoPixels will create voltage drops that get passed along to the Trinket and Touch Sensor.
The arrangement you do want puts all the devices in parallel:
- Code: Select all
+-\/\/-- NeoPixel -----\/\/-+
VCC --+-\/\/-- Trinket ------\/\/-+-- GND
+-\/\/-- TouchSensor --\/\/-+
The current loop for each device should touch the VCC and GND terminals before touching any other device.
Second thing to do: bypass. put a big cap between the main VCC and GND terminals to absorb noise before it can travel from one parallel device to another. Then bypass each of the device paths separately. Put another big cap at the point where VCC and GND enter the NeoPixels, and smaller caps between the VCC and GND pins of the Trinket and Touch Sensor.
Again, it helps to think of the wires as resistors. Noise generated by the NeoPixels runs straight into the the cap at the end of the strand, so that will absorb as much of the noise as it can. Any remaining noise has to travel through a resistor to get to the VCC/GND terminals, which have another capacitor. That resistor and capacitor form an RC low-pass filter, and that swallows more of the noise. Any noise that gets through there has to travel through another RC low-pass filter to get to the Trinket or Touch Sensor.
If you need even more noise control, put a literal resistor in the Touch Sensor's VCC path. The thing only uses a couple hundred microamps in Fast mode, so a 100 ohm resistor would only produce a voltage drop of about 20mV. The sensor works for supply voltages down to 1.8v, so a few millivolts of loss won't hurt anything. You could probably go up to 1k and accept a 200mV drop. Combining a 1uF cap with a 100 ohm resistor produces a low-pass filter with a cutoff frequency of about 1.6kHz. Using a 1k resistor would drop the cutoff frequency to 160Hz.
The last resort is to use a separate power supply for the NeoPixel ring. Connect the GND lines so everything has a common point of reference, but have separate VCC sources for the pixels and the other hardware. It's physically impossible for noise to propagate along a single wire with no return path. You have to have a loop to transmit signals.
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.