Grove - Haptic motor does not work properly controlled with M5Stack Core2

Hi, I have some problems when using the Grove - Haptic motor controlled with M5Stack Core2.
To be detailed, a single Grove - Haptic motor is plugged into the ’ Grove - 8 Channel I2C Multiplexer/I2C Hub (TCA9548A)’ and the hub is connected to the M5Stack Core2 controller.
The problem is that:
1, the 'Grove - Haptic motor ’ gets hot after 5 minutes of actuation. (the power source is 5V, which does not exceed)
2, the vibrator does not vibrate properly, it can only generate a week and short vibration.

the code is here

/*
*******************************************************************************
  Copyright (c) 2021 by M5Stack
  Equipped with M5Core2 sample source code
  Visit the website for more information:https://docs.m5stack.com/en/core/core2
  获取更多资料请访问:https://docs.m5stack.com/zh_CN/core/core2
  describe:I2C Scanner.  I2C探测
  date:2021/7/26
*******************************************************************************
*/
/*
  This program scans the addresses 1-127 continuosly and shows the devices found on the TFT.
*/
/* ref: https://wiki.seeedstudio.com/Grove-Haptic_Motor/ */
/* test with the grove hatpic motor
   issues:
   1, the operation on the haptic module make it get hot
   2, the vibrator gets hot and does not work properly with/without the hatic hub
   reasons?
   1, not because of the power
   2, probably because of the IIC communication from M5Stack
*/

#include <M5Core2.h>
//#include <Wire.h>
//#include <U8glib.h>
#include <drv2605.h>  // for vibration

#define MUX_Address 0x70 // TCA9548A Encoders address
#define DELYVIBRATOR  2000

DRV2605 haptic;

void setup()
{
  M5.begin(true, true, true, true); //Init M5Core2(Initialization of external I2C is also included).
  //Wire.begin(21, 22); //Detect internal I2C, if this sentence is not added, it will detect external I2C.

  /* init the 8 channel (0~7) on the TCA chip */
  for (int i = 0; i < 7; i++)
  {
    tcaselect(i);
    //if (haptic.init(false, true) != 0) Serial.println("init failed!");
    //if (haptic.drv2605_AutoCal() != 0) Serial.println("auto calibration failed!");
    // but there is still arror from the serial print,
    // error says 'init failed!' and 'auto calibration failed!'
    // reason: the errors come from the port 4~7, bcz il y a no device connected.
  }
  delay(1000);
}

int textColor = YELLOW;

void loop()
{
  // make the vibration
  tcaselect(1);
  for (int i = 0; i<123; i++)
  {
    setVibrator(1, i);
    }
  
  //haptic.drv2605_Play_Waveform(118);
  delay(1000);
}
void tcaselect(uint8_t i2c_bus)
{
  if (i2c_bus > 7) return;
  Wire.beginTransmission(MUX_Address);
  Wire.write(1 << i2c_bus);
  Wire.endTransmission();
}
/* actuate the vibrator on 'channelx' with 'effectnox' */
void setVibrator(int channel, int effect)
{
  /* channel: 0~7, effect:1~124 */
  tcaselect(channel);
  Serial.print("Effect No: ");
  Serial.println(effect);

  haptic.drv2605_Play_Waveform(effect);
  delay(DELYVIBRATOR);
}

the code is programme with Arduino IDE on Ubuntu20.4, the detail of the controller is here:’ M5Stack - Modular Rapid ESP32 IoT Development Board - ESP32 dev kits– m5stack-store

anyone has clue about this?

thank you in advance!

Do you have an Arduino uno on hand, I would like to know if it is a problem with the development board. Did you use the code snippet provided by our wiki?

Hi,

I tested the vibrator with ArduinoPromini, and it vibrates well with the code.

I am not sure about the ‘snippet’, what’s that about?

thank you.

Hi,

we are also thinking to buy more of these vibrator modules, is it available online shopping in Europe?

it might need more delivery time if we ordered it from the US (https://www.seeedstudio.com/Grove-Haptic-Motor-p-2546.html?queryID=cd3eb38e42e04fec8170f41a3f52b71c&objectID=599&indexName=bazaar_retailer_products)

Sorry, I don’t have permission to make inquiries for you regarding order issues, you may need to send an email to [email protected] to inquire.

Hi, thank you.
I fixed the problem with M5stack controller.

but I got another question regarding the Haptic vibrator - is there any documentation about the 123 kinds of vibration modes? the frequency, duration… ?

great, thank you.
that’s quite helpful.

Hi Citric,

is there any example code for using the DRV2605 in a ‘Real-Time Playback (RTP) mode’ instead of using the vibration effect liberation (1-123)?

Sorry our engineers have not done such a demo