QTouchADC Library for Arduino

= QTouchADC on GitHub =

https://github.com/dusjagr/QTouchADCTiny/

https://github.com/dusjagr/QTouchADC

= QTouchADC finally getting it to work on the Attiny85 =

Documentation will follow veeeeery soon...

= QTouchADC for the CocoMake7 based on Attiny84 =



=QTouch for Water Level Sensing=



= QTouchADC Library for Arduino =

forked from jgeisler0303 on Github
dusjagr converted the code from jgeisler0303 into a library "QTouchADCduino" and tested it again and again.

download here: https://github.com/dusjagr/QTouchADCArduino

It's the first time I tried to write a library, so please don't be too hard on me :-)



Overview and functionalities

 * up to 5 touch sensors can be attached to the AnalogIn pins, one is reserved as referencePin
 * allows averaging over many measurements
 * reading is very fast, ca 150µs for 1 reading. Averaging will increase to measurement time
 * baseline is stable, especially if it runs alone and on battery.
 * when the arduino is plugged into a laptop that is on the mains power, noise increases a lot and the measurement is very succeptible to how your body is connected to the room.

Compare to CapSense

 * no need of that huge resistor
 * fixed measurement time below 1ms
 * less (but still) troubles with grounding

http://playground.arduino.cc/Main/CapacitiveSensor

Still needs to be checked / optimized

 * playing around with the CHARGE_DELAY and TRANSFER_DELAY (in the library) impacts the noise. needs optimization
 * do the reference measurement in the .init? how to use that result in the other part of the library?
 * make all measurements for the ref in the .init. but how to save it into a variable that can be used later again and is mapped to the right analog in?
 * define the reference pin in the QTouchADCduino.int(refPin) function, so the rest of the .sense is simpler?
 * add extra class for just "touch" reading, with a threshold calue. QTouchADCduino.touch(pin, threshold) that gives back a 1 or 0.


 * the range of urban's code is higher, but measurement slower... and still getting some massive outliers. could be optimized, fixing the variable definitions? maybe completely change to that one?

Usage
QTouchADCduino.init;

// initializez the analog registers. put it in the void setup of your code.

QTouchADCduino.sense("sensePin", "refPin", "samples");

//this will give you back the result comparing the ADC measurements from the reference pin and the sensepin, and it will take a number "samples" of measurement and averages them. The resulting difference might go from a negative number to positive, up to values of 600-700 when touched.

A single and averaged reference measurement during the void setup can be later substracted from the measured values to create positive values only.

Code Example
find more examples on github

= Links =

More on QTouchADC
Urban's original code on SGMK wiki

discussion on mikrocontroller.net

QTouchADC application note

Atmel QTouch reference

How to make Buttons, Sliders and Wheels

Nice description and implementation on ATMega32u4

https://www.youtube.com/watch?v=Ncu2GZJbluI

QTouch on Attiny and Arduino
Very smoothly working implementation for Arduino ->> can someone translate it to the attiny register-ports? (dusjagr tried and failed...) or even make it into a library?


 * https://github.com/jgeisler0303/QTouchADCArduino

Library for Arduino for ADC Touch, noisy...


 * http://playground.arduino.cc/Code/ADCTouch



TinyTouch library for attiny (I can't get this to run from the arduino IDE), looks very nice!!!


 * https://github.com/cpldcpu/TinyTouchLib

CapSensing touch library from Dave Mellis


 * http://www.kobakant.at/DIY/?p=4384

Programming the attiny85 with arduino IDE
Hardware Cores to program various Attiny 85/84 and others via arduino 1.0 & 1.6 and older, MIT High-Low tech

Hardware Cores to program various ATtiny84 (84/44/24), ATtiny85 (85/45/25), and ATtiny2313 (4313) and others via arduino