Go Down

Topic: Capacitive Sensor No Output (Read 2514 times) previous topic - next topic

xaviergoh

Feb 02, 2013, 08:15 pm Last Edit: Feb 02, 2013, 08:29 pm by xaviergoh Reason: 1
Recently I purchased a set of capacitive sensors for my project, received them today and ran their sample code provided, but am not getting any output at the 'serial window' when the sensors are been toggled by my fingers. Sensors and program are in the following link and please advice if anything is wrong with the code or possible reason that could have caused no output from breakout board (MPR121) to Arduino Uno.

http://www.dfrobot.com/wiki/index.php?title=Capacitive_Touch_Kit_For_Arduino(SKU:DFR0129)

arduinoadrian

Broken link for me. Can't access.
Perseverance is 90% of the solution. The remaining 10% is more perseverance.

HazardsMind

#2
Feb 02, 2013, 08:45 pm Last Edit: Feb 02, 2013, 08:47 pm by HazardsMind Reason: 1
His link, http://www.dfrobot.com/wiki/index.php?title=Capacitive_Touch_Kit_For_Arduino(SKU:DFR0129)

Which one are you doing? No code, no help, otherwise were just guessing.
My GitHub:
https://github.com/AndrewMascolo?tab=repositories

xaviergoh

Hi HazardsMind,

Thanks for replying to my post, I tried the code that they suggest at the webpage for the keypad.

/*
TouchWheel.pde
MPR121 WhellPad Example Code
 
by:Waiman Zhao
Mail:Binpower@foxmail.com
created on: 11/2/14
license: CC-SA 3.0
 
Hardware: 3.3V Arduino Pro Mini
           SDA -> A4
           SCL -> A5
           IRQ -> D2
*/


#include <Wire.h>
#include <mpr121.h>

int key = 0;


// =========  setup  =========
void setup()
{
    //  initialize function
  Serial.begin(19200);
  Wire.begin();
  CapaTouch.begin();

  delay(500);
  Serial.println("START");
}


// =========  loop  =========
void loop()
{
  key=CapaTouch.keyPad();

  if (key==11)
  { Serial.print("key:");
  Serial.println("*");
  }
  else if(key==12)
  {
    Serial.print("key:");
  Serial.println("#");
  }
  else if(key>0){
    Serial.print("key:");
    Serial.println(key);
  }
    delay(200);
}

It doesnt have any output at the serial window after I added the library and flashed the Uno. I am a novice in Arduino, I am not sure whether do I need any additional code for it to have an output at the serial window. Please advice

liudr

Does the serial output show the word START?

HazardsMind

Did you by any chance set the baud rate in the actual serial monitor screen? In the bottom right corner, the default is 9600.
My GitHub:
https://github.com/AndrewMascolo?tab=repositories

xaviergoh

#6
Feb 03, 2013, 07:16 pm Last Edit: Feb 03, 2013, 07:20 pm by xaviergoh Reason: 1
http://postimage.org/image/6bygyc3zz/ <-- my output. only one logo after initialised, and nothing i do will add anything else to the output.

Anything I need to do other than the codes above? basically I connected the boards up as shown in the seller's page and uses their code to flash. Not sure whether i missed out anything. 

Greatly appreciate the help given.

HazardsMind

#7
Feb 03, 2013, 07:20 pm Last Edit: Feb 03, 2013, 07:56 pm by HazardsMind Reason: 1
Your baud rate in the serial monitor says 300 baud, that is wrong! It should be 19200, not 300.
My GitHub:
https://github.com/AndrewMascolo?tab=repositories

liudr

Quote


Anything I need to do other than the codes above? basically I connected the boards up as shown in the seller's page and uses their code to flash. Not sure whether i missed out anything. 

Greatly appreciate the help given.


Follow HazardsMind's reply and set correct baud rate.

xaviergoh

Hi guys, I tried different baud rate, it shows "START", but still doesnt get any output from the sensors.



HazardsMind

Ok, great, you got START. Now do a serial print of just "key" and see what values you get for each number pressed.
My GitHub:
https://github.com/AndrewMascolo?tab=repositories

xaviergoh

Hi,

Thanks for suggestion. I tried the following, not sure if it's what u meant. None of the keys give an output to the serial window still.

HazardsMind

It should be outputting atleast "key" try just Serial.println(key); right after key=CapaTouch.keyPad();
My GitHub:
https://github.com/AndrewMascolo?tab=repositories

xaviergoh

#13
Feb 04, 2013, 07:28 pm Last Edit: Feb 04, 2013, 07:31 pm by xaviergoh Reason: 1
with Serial.println(key), I get endless "-1"....

with Serial.println("key"), I get endless "key"...


HazardsMind

Ok then check your wiring. Your getting something now, but its not what you want, so check your wiring for errors.
My GitHub:
https://github.com/AndrewMascolo?tab=repositories

Go Up