The Adafruit DRV2605L Haptic Motor Driver is a versatile and efficient component designed to control haptic motors, enabling tactile feedback in electronic devices. It is based on the Texas Instruments DRV2605L chip and is capable of driving both Linear Resonant Actuators (LRAs) and Eccentric Rotating Mass (ERM) motors. This driver is ideal for applications requiring precise vibration control, such as wearable devices, gaming controllers, smartphones, and other interactive systems.
The DRV2605L features an integrated library of haptic effects, making it easy to implement a wide range of tactile sensations without requiring complex programming. Additionally, it supports I²C communication, allowing seamless integration with microcontrollers like the Arduino UNO.
The DRV2605L breakout board has the following pin layout:
Pin Name | Description |
---|---|
VIN | Power input (2.0V to 5.2V). Connect to the power supply. |
GND | Ground. Connect to the ground of the circuit. |
SDA | I²C data line. Connect to the SDA pin of the microcontroller. |
SCL | I²C clock line. Connect to the SCL pin of the microcontroller. |
IN | Optional analog or PWM input for motor control. |
EN | Enable pin. Pull high to enable the driver, or low to disable it. |
OUT+ | Positive output for the haptic motor. Connect to the motor's positive terminal. |
OUT- | Negative output for the haptic motor. Connect to the motor's negative terminal. |
To use the DRV2605L with an Arduino UNO, follow these steps:
The following example demonstrates how to use the DRV2605L with an Arduino UNO to play a haptic effect from the built-in library:
#include <Wire.h>
#include <Adafruit_DRV2605.h>
// Create an instance of the DRV2605L driver
Adafruit_DRV2605 drv;
void setup() {
Serial.begin(9600);
Serial.println("Initializing DRV2605L...");
// Initialize the DRV2605L
if (!drv.begin()) {
Serial.println("Failed to find DRV2605L chip. Check connections.");
while (1);
}
Serial.println("DRV2605L initialized!");
// Select the ERM motor mode (default)
drv.selectLibrary(1);
// Set the haptic effect to play (e.g., effect #1)
drv.setMode(DRV2605_MODE_INTTRIG); // Internal trigger mode
drv.setWaveform(0, 1); // Play effect #1
drv.setWaveform(1, 0); // End of sequence
}
void loop() {
Serial.println("Playing haptic effect...");
drv.go(); // Trigger the effect
delay(1000); // Wait for 1 second before repeating
}
The motor does not vibrate.
The Arduino cannot detect the DRV2605L.
The motor vibrates weakly or inconsistently.
By following this documentation, you can effectively integrate the Adafruit DRV2605L Haptic Motor Driver into your projects and create engaging tactile feedback experiences.