Capacitive Sensoring right circuit?

Hey guys I am pretty new with arduino and building circuits and i wanted to try capacitive sensing with it. there is a tutorial for transmit/receive mode based on the Multi Touch Kit Multi-Touch Kit - Human Computer Interaction Lab, Saarland University and it works with every commodity microcontroller while they provide all the code, its basicely plug and play. In the tutorial they say to use this hardware:
Hardware Setup
– Arduino (Mega2560, Uno, LilyPad)
– Multiplexer (e.g., CD74HC40671)
– Resistors (100K Ohm
for this setup:

So what i have is an Arduino Uno and they show what to plugin where. I did it exactly like here but first i wanted to test one tx and one rx on the breadboard and i got this 100k resistor (i double checked the farbcodes from resistor); orange cable is conntected to A0, white to GND (ignore the upper multiplexer its from something else). one yellow goes to receivber which is connected to C0 from the Multiplexer CD74HC40671.

In their tutorial there should be a value of around 250 touching electrodes and around 30 at no-touch but i have like peak value of 1023 at no touch so i suppose smth is not well connected?

so it looks like this:

and the circuit is like this right now

the code is

/***************************************************
 This is a library for the Multi-Touch Kit
 Designed and tested to work with Arduino Uno, MEGA2560, LilyPad(ATmega 328P)
 Note: Please remind to disconnect AREF pin from AVCC on Lilypad
 
 For details on using this library see the tutorial at:
 ----> https://hci.cs.uni-saarland.de/multi-touch-kit/
 
 Written by Narjes Pourjafarian, Jan Dickmann, Juergen Steimle (Saarland University), 
            Anusha Withana (University of Sydney), Joe Paradiso (MIT)
 MIT license, all text above must be included in any redistribution
 ****************************************************/

 // This example shows how to use the Multi-Touch Kit library with an Arduino Uno/LilyPad and a 6x6 sensor
 // Connect pin 3 on the Uno and pin 9 on the Mega to the Signal pin of the multiplexer
 // Note: Please remind to disconnect AREF pin from AVCC on Lilypad

#include <MultiTouchKit.h>

//----- Multiplexer input pins (for UNO) -----
int s0 = 7;
int s1 = 8;
int s2 = 9;
int s3 = 10;

int muxPins[4] = {s3, s2, s1, s0};

//----- Number of receiver (RX) and transmitter (TX) lines -----
int RX_num = 6;
int TX_num = 6;

//----- Receive raw capacitance data or touch up/down states -----
boolean raw_data = true;  // true: receive raw capacitance data, false: receive touch up/down states
int threshold = 30;  // Threshold for detecting touch down state (only required if raw_data = false). 
                    // Change this variable based on your sensor. (for more info. check the tutorial)

MultiTouchKit mtk;

void setup() {
  //Serial connection, make sure to use the same baud rate in the processing sketch
  Serial.begin(115200);

  //setup the Sensor
  mtk.setup_sensor(RX_num,TX_num,muxPins,raw_data,threshold);
}

void loop() {
  //Continuously writes multi-touch data to Serial.
  //Each row represents all RX values read from one TX line seperated by "," (the first value is TX ID)
  mtk.read();
}

from Source:

Do you have the SIG pin connected to Uno pin 3?

yes i am using Multiplexer CD74HC40671 and its all connected as in the guide, sig to pin 3

The guide uses a sparkfun breakout board with a HC4067 but it looks like you are using the IC. The IC does not have sig or C0 so exactly how do you have the IC connected?

Do you have the EN grounded?

Hi, @gomugomu
Welcome to the forum

Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

Can you also post YOUR code?

Thanks.. Tom.... :smiley: :+1: :coffee: :australia:

Hello, I am using this 16 channel multiplexer and the EN ist not connected to anything (as in the guide from MultiTouchKit)

if there is confusion: On the breakboard there can be seen an another multiplexer but that was for something else and it not connected to the Multitouch Project :slight_smile:

if there is confusion
Well yes.
Since you are only showing bits and pieces at a time, it hard to tell if you have everything connected right.

However all those long wires will also act a capacitive sensors and also pick up stray noise.
Try making all connections as short as possible.

i understand! thank you! so i drew my circuit right now which looks like this

The MultiTouch Kit provides a finshed code which where you only type how many tx and rx you got. and in the background it uses some code for a transmit/receive mode solution

so this is my circuit right now

/***************************************************
 This is a library for the Multi-Touch Kit
 Designed and tested to work with Arduino Uno, MEGA2560, LilyPad(ATmega 328P)
 Note: Please remind to disconnect AREF pin from AVCC on Lilypad
 
 For details on using this library see the tutorial at:
 ----> https://hci.cs.uni-saarland.de/multi-touch-kit/
 
 Written by Narjes Pourjafarian, Jan Dickmann, Juergen Steimle (Saarland University), 
            Anusha Withana (University of Sydney), Joe Paradiso (MIT)
 MIT license, all text above must be included in any redistribution
 ****************************************************/

 // This example shows how to use the Multi-Touch Kit library with an Arduino Uno/LilyPad and a 6x6 sensor
 // Connect pin 3 on the Uno and pin 9 on the Mega to the Signal pin of the multiplexer
 // Note: Please remind to disconnect AREF pin from AVCC on Lilypad

#include <MultiTouchKit.h>

//----- Multiplexer input pins (for UNO) -----
int s0 = 7;
int s1 = 8;
int s2 = 9;
int s3 = 10;

int muxPins[4] = {s3, s2, s1, s0};

//----- Number of receiver (RX) and transmitter (TX) lines -----
int RX_num = 6;
int TX_num = 6;

//----- Receive raw capacitance data or touch up/down states -----
boolean raw_data = true;  // true: receive raw capacitance data, false: receive touch up/down states
int threshold = 30;  // Threshold for detecting touch down state (only required if raw_data = false). 
                    // Change this variable based on your sensor. (for more info. check the tutorial)

MultiTouchKit mtk;

void setup() {
  //Serial connection, make sure to use the same baud rate in the processing sketch
  Serial.begin(115200);

  //setup the Sensor
  mtk.setup_sensor(RX_num,TX_num,muxPins,raw_data,threshold);
}

void loop() {
  //Continuously writes multi-touch data to Serial.
  //Each row represents all RX values read from one TX line seperated by "," (the first value is TX ID)
  mtk.read();
}

from Source: GitHub - HCI-Lab-Saarland/MultiTouchKit

For debugging purposes, try this simple set-up with your code.
Make the wires as short as possible.

All the unused analog input should connect to ground

i will try this!

No hurry

You should be using the MTK_UNO.ino example code, not what you show in post #11
It's in the examples folder.

you're right! i changed it in my post

isn't the bus stripe for minus pole just one line? so when i connect the ground on top i get ground for the whole breadboard on the site?

  • We are guessing what wires are what.

  • If you want the Dupont White bus bar wire connected to the resistor lead connected to the Yellow bus bar jumper, it is not connected.

  • There is a break in the two bus bars at the point circled in yellow.