Haptic Motor not working with QT Py ESP32-S2

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
jimk123
 
Posts: 708
Joined: Sun Dec 26, 2010 7:04 pm

Haptic Motor not working with QT Py ESP32-S2

Post by jimk123 »

I am trying to follow this tutorial https://learn.adafruit.com/cheekmate-wi ... munication which uses the Haptic Motor Controller https://www.adafruit.com/product/2305 with the Adafruit QT Py ESP32-S2 WiFi Dev Board https://www.adafruit.com/product/5325

The arduino code compiled and ran and when I enter text in the IO dashboard it blinks the LED but the buzzer is not working.

I took the Haptic Motor board and an UNO and ran the sample code below and that code works fine so I think the board/motor is ok.

Arduino\libraries\Adafruit_DRV2605_Library\examples\basic\basic.ino"

17:46:34.990 -> Adafruit DRV2605 Basic test
17:46:34.990 -> Scanning I2C devices...
17:46:34.990 -> I2C device found at address 0x5A
17:46:35.273 -> I2C devices found: 1

I don't fully understand this part of the cheekmate code I used from here: https://learn.adafruit.com/cheekmate-wi ... duino-code but it uses &wire1

I slightly changed the setup code add some error checking and it does not seem to find the motor control board

if (! drv.begin(&Wire1)) {
Serial.println("Could not find DRV2605");
while (1) delay(10);
}

17:56:44.082 -> Could not find DRV2605

thoughts ?
thanks

User avatar
dastels
 
Posts: 15817
Joined: Tue Oct 20, 2015 3:22 pm

Re: Haptic Motor not working with QT Py ESP32-S2

Post by dastels »

The use of Wire1 is explained in the comment just above the code you pasted:

Code: Select all

// Wire1 is the "extra" I2C interface on the QT Py ESP32-S2's
  // STEMMA connector. If adapting to a different board, you might
  // want &Wire for the sole or primary I2C interface.
Also, see the discussion of it in the QtPy ESP32-S2 guide: https://learn.adafruit.com/adafruit-qt- ... or-3107922

Are you using a STEMMA-QT cable & and connections as described in the project guide at https://learn.adafruit.com/cheekmate-wi ... it-3128188? If you are hardwireing it and using the SCL/SDA pins on the edge of the QtPy, you'll need to change Wire1 to Wire or remove it (Wire is used by default).

Dave

User avatar
jimk123
 
Posts: 708
Joined: Sun Dec 26, 2010 7:04 pm

Re: Haptic Motor not working with QT Py ESP32-S2

Post by jimk123 »

Hi Dave
I am using a stemma qwiic cable to attach the motor controller to the qt py esp32 s2.

I unplugged that cable from the esp32 qtpy and plugged it into a uno board and the motor controller worked ok so the hardware seems ok.

User avatar
jimk123
 
Posts: 708
Joined: Sun Dec 26, 2010 7:04 pm

Re: Haptic Motor not working with QT Py ESP32-S2

Post by jimk123 »

Is my slight change in the code to test for a valid device seem ok?

if (! drv.begin(&Wire1)) {
Serial.println("Could not find DRV2605");
while (1) delay(10);
}

Seems like a lot of code examples use this technique but i have never used an alternative wire interface.

Still confused why it worked on the uno but it cannot find in on the qt py esp32 s2

User avatar
dastels
 
Posts: 15817
Joined: Tue Oct 20, 2015 3:22 pm

Re: Haptic Motor not working with QT Py ESP32-S2

Post by dastels »

How did you connect it to the UNO? UNO doesn't have a STEMMA-QT connector.

What code did you run on the UNO?

Your change to check for a valid device looks fine. You don't need the delay in the infinite loop, Just

Code: Select all

while( (1);
will suffice.

Most boards just have a single exposed I2C bus, i.e. Wire. A secondary bus is Wire1. Some boards with a STEMMA-QT connector use Wire1 for the STEMMA connection and Wire for the I2C pins.

Dave

User avatar
dastels
 
Posts: 15817
Joined: Tue Oct 20, 2015 3:22 pm

Re: Haptic Motor not working with QT Py ESP32-S2

Post by dastels »

What do you get from an I2C scanner sketch on both Wire and Wire1 with the haptic board connected? See https://learn.adafruit.com/scanning-i2c ... es/arduino.

Dave

User avatar
jimk123
 
Posts: 708
Joined: Sun Dec 26, 2010 7:04 pm

Re: Haptic Motor not working with QT Py ESP32-S2

Post by jimk123 »

Hi Dave
I was using a sparkfun uno that has a qwiic connector https://www.sparkfun.com/products/15123 and i used the sample code in the DRV library

Arduino\libraries\Adafruit_DRV2605_Library\examples\basic\basic.ino

User avatar
jimk123
 
Posts: 708
Joined: Sun Dec 26, 2010 7:04 pm

Re: Haptic Motor not working with QT Py ESP32-S2

Post by jimk123 »

Dave
I created a new sketch called wiretest.ino and pasted in the code you referenced, selected a board type of adafruit qt py esp32-s2 (btw the green power led is 'on' on the motor controller board)

Code: Select all

// testing on adafruit qt py esp32-s2

#include <Wire.h>

// Set I2C bus to use: Wire, Wire1, etc.
//#define WIRE Wire
#define WIRE Wire1

void setup() {
  WIRE.begin();

  Serial.begin(115200);
 delay(5000);
  Serial.println("\nI2C Scanner 'wire1' test");
}


void loop() {
  byte error, address;
  int nDevices;

  Serial.println("Scanning...");

  nDevices = 0;
  for(address = 1; address < 127; address++ ) 
  {
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the address.
    WIRE.beginTransmission(address);
    error = WIRE.endTransmission();

    if (error == 0)
    {
      Serial.print("I2C device found at address 0x");
      if (address<16) 
        Serial.print("0");
      Serial.print(address,HEX);
      Serial.println("  !");

      nDevices++;
    }
    else if (error==4) 
    {
      Serial.print("Unknown error at address 0x");
      if (address<16) 
        Serial.print("0");
      Serial.println(address,HEX);
    }    
  }
  if (nDevices == 0)
    Serial.println("No I2C devices found\n");
  else
    Serial.println("done\n");

  delay(5000);           // wait 5 seconds for next scan
}
here are the results:
test 1
#define WIRE Wire

20:48:54.877 ->
20:48:54.877 -> I2C Scanner 'wire' test
20:48:54.877 -> Scanning...
20:48:55.020 -> No I2C devices found
20:48:55.020 ->

test 2
#define WIRE Wire1
20:50:41.063 ->
20:50:41.063 -> I2C Scanner 'wire1' test
20:50:41.063 -> Scanning...
20:50:41.063 -> No I2C devices found
20:50:41.063 ->

User avatar
jimk123
 
Posts: 708
Joined: Sun Dec 26, 2010 7:04 pm

Re: Haptic Motor not working with QT Py ESP32-S2

Post by jimk123 »

here's a pic
IMG-4197.jpg
IMG-4197.jpg (928.07 KiB) Viewed 117 times

User avatar
dastels
 
Posts: 15817
Joined: Tue Oct 20, 2015 3:22 pm

Re: Haptic Motor not working with QT Py ESP32-S2

Post by dastels »

Ah, ok. That's a RedBoard Qwiic, not really an "UNO". Hence my confusion.

You're right that the board and motor are fine since they work on the RedBoard.

The DRV2605 board is getting power fine since the LED is on.

Do you have any other STEMMA-QT boards to test the QtPy with?

A thought... have a close look into the QtPy's STEMMA-QT connector to check that none of the pins are bent. I've seen it be the cause of problems before. Since power is fine, pay attention to the pins for the yellow & blue wires.

To sum up: the haptic board and motor are good.
The cable is good.

It looks like a problem with the QtPy which otherwise seems to work. So my thought is the STEMMA-QT connector.

Dave

User avatar
jimk123
 
Posts: 708
Joined: Sun Dec 26, 2010 7:04 pm

Re: Haptic Motor not working with QT Py ESP32-S2

Post by jimk123 »

Thanks Dave
Let me find another stemma sensor and see if it discovers it and double check the pins on the qt py

I may have another qt py esp32 s2 also

User avatar
jimk123
 
Posts: 708
Joined: Sun Dec 26, 2010 7:04 pm

Re: Haptic Motor not working with QT Py ESP32-S2

Post by jimk123 »

Hi Dave
I had another qt py esp32-s2 and a adafruit AHT20 temp sensor, running the i2c scan for wire and wire1 still does not find anything

16:50:40.886 ->
16:50:40.886 -> I2C Scanner 'wire1' test
16:50:40.886 -> Scanning...
16:50:40.886 -> No I2C devices found
16:50:40.886 ->

16:51:43.277 -> I2C Scanner 'wire' test
16:51:43.277 -> Scanning...
16:51:43.420 -> No I2C devices found

User avatar
jimk123
 
Posts: 708
Joined: Sun Dec 26, 2010 7:04 pm

Re: Haptic Motor not working with QT Py ESP32-S2

Post by jimk123 »

saw this post but does not sound like my issue
https://learn.adafruit.com/adafruit-qt- ... imitations

User avatar
jimk123
 
Posts: 708
Joined: Sun Dec 26, 2010 7:04 pm

Re: Haptic Motor not working with QT Py ESP32-S2

Post by jimk123 »

I found another i2cscan routine that seems to work with the qt py
// https://learn.adafruit.com/adafruit-qt- ... -scan-test

17:02:03.392 -> Adafruit I2C Scanner
17:02:03.392 ->
17:02:03.392 ->
17:02:03.392 -> Default port (Wire) I2C scan:
17:02:03.534 -> Secondary port (Wire1) I2C scan: 0x38, (this is the aht20 sensor I was using as a test for now)

not sure why the cheekmate code does not find it, not sure what this new scan routine does the code sample for cheekmate is doing

User avatar
jimk123
 
Posts: 708
Joined: Sun Dec 26, 2010 7:04 pm

Re: Haptic Motor not working with QT Py ESP32-S2

Post by jimk123 »

switching back to the original qt py esp32 s2 board with the lipo charger bff soldered on it that newest i2cscan discovers the motor controller board. Still not sure why the cheekmate demo code does not.

17:26:16.457 -> Adafruit I2C Scanner
17:26:16.457 ->
17:26:16.457 ->
17:26:16.457 -> Default port (Wire) I2C scan:
17:26:16.551 -> Secondary port (Wire1) I2C scan: 0x5A,
1

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”