MKR IoT Carrier button issues with case on

Hi,

I started to go through the tutorial material for the Opla Kit, which is a MKR Wifi 1010 and a MKR IoT Carrier, and came across the following issue:

When the case is on, the buttons does not work reliably at all. You can check it on the linked video: https://youtu.be/DvMQQ5jyZbc

Here is the relevant code snippet.

#include <Arduino_MKRIoTCarrier.h>
#include "arduino_secrets.h"
#include <WiFiNINA.h>
MKRIoTCarrier carrier;
bool CARRIER_CASE = true;

float temperature = 0;
float humidity = 0;
int r = 0;
char ssid[] = SECRET_SSID;
char pass[] = SECRET_PASS;
int status = WL_IDLE_STATUS;

void setup() {
  Serial.begin(9600);
  //Wait to open the Serial monitor to start the program and see details on errors
  while (!Serial);

  //Initialize the IoTSK carrier and output any errors in the serial monitor
  carrier.begin();
  carrier.display.setRotation(0);

  String fv = WiFi.firmwareVersion();
  Serial.print("Firmware verison: ");
  Serial.println(fv);

  while (status != WL_CONNECTED)
  {
    Serial.print("Attempting to connect to network: ");
    Serial.println(ssid);
    status = WiFi.begin(ssid, pass);
    delay(10000);
    Serial.println(status);
    printConnectionStatus();
  }
  


}

void printTemperature() {
  //configuring display, setting background color, text size and text color
  carrier.display.fillScreen(ST77XX_RED); //red background
  carrier.display.setTextColor(ST77XX_WHITE); //white text
  carrier.display.setTextSize(2); //medium sized text

  carrier.display.setCursor(30, 110); //sets position for printing (x and y)
  carrier.display.print("Temp: ");
  carrier.display.print(temperature);
  carrier.display.println(" C");
  carrier.display.print("R:");
  carrier.display.println(r);
}

void printHumidity() {
  //configuring display, setting background color, text size and text color
  carrier.display.fillScreen(ST77XX_BLUE); //red background
  carrier.display.setTextColor(ST77XX_WHITE); //white text
  carrier.display.setTextSize(2); //medium sized text

  carrier.display.setCursor(30, 110); //sets new position for printing (x and y)
  carrier.display.print("Humi: ");
  carrier.display.print(humidity);
  carrier.display.println(" %");
}

void printConnectionStatus() {
  //configuring display, setting background color, text size and text color
  carrier.display.fillScreen(ST77XX_PTLAR); //red background
  carrier.display.setTextColor(ST77XX_WHITE); //white text
  carrier.display.setTextSize(2); //medium sized text

  carrier.display.setCursor(30, 110); //sets new position for printing (x and y)
  carrier.display.print("Status: ");
  carrier.display.println("Connected");
  carrier.display.setCursor(30, 150);
  carrier.display.println(WiFi.localIP());

}


void loop() {
  // read the sensor values
  temperature = carrier.Env.readTemperature();
  humidity = carrier.Env.readHumidity();

  //Update touch buttons
  carrier.Buttons.update();

  // print each of the sensor values
  Serial.print("Temperature = ");
  Serial.print(temperature);
  Serial.println(" °C");

  Serial.print("Humidity = ");
  Serial.print(humidity);
  Serial.println(" %");

  //function to print out values
  if (carrier.Button1.onTouchDown()) {
    printTemperature();
    r++;
  }

  if (carrier.Button2.onTouchDown()) {
    printHumidity();
  }

  if (carrier.Button3.onTouchDown()) {
    printConnectionStatus();
  }
}

Is this a normal occurance, or my board is faulty? I bought it last week, delivered in the last two days.

Thanks for the help.

I’m encountering a similar problem with using the buttons with the case on. When I have the case off and set CARRIER_CASE = false, then the 5 buttons work as expected. When I have the case on and set CARRIER_CASE = true, then 3 buttons work as expected, 1 generates spurious touches, and 1 doesn’t respond to touches at all. I’ve tried using carrier.Buttons.updateConfig() to adjust the sensitivity, but there doesn’t seem to be a sensitivity level that allows all 5 buttons to work as expected with the case on. Did you end up finding a solution to this problem?

I just finished the Inventory Project and I'm having a similar issue.

To be specific:

  • CASE OFF: w/o case I'm able to get the board to start up and run the 'inventory project' code. However the buttons require double or triple touches in order for them to responnd.
  • CASE ON: w/ case on same touch-response issue persists and sometimes the project code won't run.

It seems a number of folks have had similar issues with the Opla kit not being that touch sensitive or perhaps I'm doing something wrong.

I will raise this issue to the correct people.
Monday will be the earliest response time.

Bob.

Hi,

Try to calibrate the sensitivity threshold with the built in example from the library:

Examples -> From Libraries, Arduino MKRIoTCarrier -> TouchPads -> Custom_Sensitivity

Start with 4, which is the default value for when the case is used, and increase or decrease to find a value that works for your setup.

If you need further troubleshooting, you're always welcome to contact us through our contact form: https://www.arduino.cc/en/contact-us/

/Therese

I have the same problem: I cannot find a threshold that makes all buttons work reliably. With my board, one button appears much more sensitive than the others. If I reduce the threshold to a level where the majority of the buttons on the board work, the one button that is more sensitive will register spurious touches (usually quite rapidly). This problem occurs whether the board is in the case or out of it (with different threshold levels obviously).

I assume there is some manufacturing variance that is causing this on some boards' buttons.

I have registered a support request at https://www.arduino.cc/en/contact-us/ some days ago but have yet to hear back but given this is a holiday period I guess I will have to be patient.

@machthree

Yes the European holidays tend to be a bit longer so please be patient for your support request.
I am sure there may also be a slight backlog to get through too when they come back.

Bob.

Same here, the buttons does not have a common sensitivity. With CARRIER_CASE = true, button0 and button1 require several attempts, button 3 spontaneous reacts without touching, button2 and button4 working as expected...

I see at Github Arduino_MKRIoTCarrier/src at master · arduino-libraries/Arduino_MKRIoTCarrier (github.com) that in the Arduino_MKRIoTCarrier_Qtouch.h there was an update "Added touch sensitivity for each button". I assume that this would make it possible to set individual sensitivity to the buttons, but I'm not skilled enough to understand from reading the code in the library how to use it... yet...

Maybe someone can give an example?

1 Like

Opla IOT carrier Buttons problem
I have the same problem: I cannot find a threshold that makes all the buttons work reliably. With my board, one button (4) appears much more sensitive than the others. Button 0 doesn't work at all with the case on.

Can Arduino provide a solution? There seem to be a lot users that have the same problem.
You can't do any serious project that uses the buttons if you use the case.

Please help. :o

Thanks in advance.

Hey you all!
I'm working with the Carrier's library, thanks for the feedback!

So as my colleague said in #4

Theresed:
Hi,

Try to calibrate the sensitivity threshold with the built in example from the library:

Examples -> From Libraries, Arduino MKRIoTCarrier -> TouchPads -> Custom_Sensitivity

Start with 4, which is the default value for when the case is used, and increase or decrease to find a value that works for your setup.

If you need further troubleshooting, you're always welcome to contact us through our contact form: https://www.arduino.cc/en/contact-us/

/Therese

You have the example that shows how to change the thresholds at
Arduino_MKRIoTCarrier/Custom_Sensitivity.ino at master

You will need to set the custom values before carrier.begin()
Remember that 3 is the maximum (Further) and the minimum 100(closer)

To apply a value you need to set it in the sketch, and upload it to the board to make the changes

If you have any issue, check if you have the lastest updates (today's versions):
Arduino_MKRIoTCarrier 0.9.9
Arduino_MCHPTouch 1.1.0

Let me know if it worked for you, have a nice one!

/Pablo

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.