Pages: [1] 2 3   Go Down
Author Topic: Capacitive Sensor No Output  (Read 2152 times)
0 Members and 1 Guest are viewing this topic.
Singapore
Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
« Last Edit: February 02, 2013, 02:29:33 pm by xaviergoh » Logged

Miami/Florida
Offline Offline
Sr. Member
****
Karma: 14
Posts: 345
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Broken link for me. Can't access.
Logged

Perseverance is 90% of the solution. The remaining 10% is more perseverance.

Queens, New York
Online Online
Faraday Member
**
Karma: 101
Posts: 3643
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: February 02, 2013, 02:47:26 pm by HazardsMind » Logged

Created Libraries:
TFT_Extension, OneWireKeypad, SerialServo, (UPD)WiiClassicController, VWID

Singapore
Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 73
Posts: 7198
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Does the serial output show the word START?
Logged


Queens, New York
Online Online
Faraday Member
**
Karma: 101
Posts: 3643
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Did you by any chance set the baud rate in the actual serial monitor screen? In the bottom right corner, the default is 9600.
Logged

Created Libraries:
TFT_Extension, OneWireKeypad, SerialServo, (UPD)WiiClassicController, VWID

Singapore
Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: February 03, 2013, 01:20:03 pm by xaviergoh » Logged

Queens, New York
Online Online
Faraday Member
**
Karma: 101
Posts: 3643
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Your baud rate in the serial monitor says 300 baud, that is wrong! It should be 19200, not 300.
« Last Edit: February 03, 2013, 01:56:59 pm by HazardsMind » Logged

Created Libraries:
TFT_Extension, OneWireKeypad, SerialServo, (UPD)WiiClassicController, VWID

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 73
Posts: 7198
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


Singapore
Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Logged

Queens, New York
Online Online
Faraday Member
**
Karma: 101
Posts: 3643
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, great, you got START. Now do a serial print of just "key" and see what values you get for each number pressed.
Logged

Created Libraries:
TFT_Extension, OneWireKeypad, SerialServo, (UPD)WiiClassicController, VWID

Singapore
Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Queens, New York
Online Online
Faraday Member
**
Karma: 101
Posts: 3643
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It should be outputting atleast "key" try just Serial.println(key); right after key=CapaTouch.keyPad();
Logged

Created Libraries:
TFT_Extension, OneWireKeypad, SerialServo, (UPD)WiiClassicController, VWID

Singapore
Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

« Last Edit: February 04, 2013, 01:31:08 pm by xaviergoh » Logged

Queens, New York
Online Online
Faraday Member
**
Karma: 101
Posts: 3643
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok then check your wiring. Your getting something now, but its not what you want, so check your wiring for errors.
Logged

Created Libraries:
TFT_Extension, OneWireKeypad, SerialServo, (UPD)WiiClassicController, VWID

Pages: [1] 2 3   Go Up
Jump to: