Most of this site’s sensor tutorials are about reading input — touch, motion, pressure. Haptic feedback is the other direction: giving a user something to feel back. Done well, it’s one of the highest-impact-per-effort additions to an interactive object or installation, and it’s considerably simpler to wire than it might look.
Two kinds of vibration motor
Before wiring anything, it’s worth knowing there are two common types, and they behave differently:
- ERM (Eccentric Rotating Mass): a tiny DC motor with an off-center weight attached to the shaft. Cheap, widely available, but has a noticeable spin-up and spin-down time — it can’t start and stop instantly, so sharp, crisp effects are harder to produce.
- LRA (Linear Resonant Actuator): a small magnetic mass driven back and forth along a single axis at its resonant frequency. Faster to start and stop than an ERM, generally feels crisper, and is what’s inside most modern phones — but it needs to be driven near its specific resonant frequency to work well, which a simple on/off signal can’t do accurately.
Why you need a dedicated driver chip
You can technically drive a small ERM motor directly from a transistor and a GPIO pin — on, off, done. That approach falls apart quickly for anything more expressive, and it doesn’t work at all for LRAs, which need frequency-tuned drive signals a microcontroller’s digital pins can’t produce directly. This is where a chip like the DRV2605 (sold as a breakout by both Adafruit and SparkFun) earns its place: it’s a purpose-built haptic driver that handles the actual waveform generation, supports both ERM and LRA motors, and talks to your microcontroller over a simple I2C connection.
The built-in effect library
The DRV2605’s standout feature for creative work: it ships with a library of over 100 pre-programmed haptic effects — built-in waveforms like sharp clicks, double pulses, ramping buzzes, and alert patterns — stored directly on the chip. Triggering one is as simple as selecting an effect number and sending a play command over I2C:
#include <Adafruit_DRV2605.h>
Adafruit_DRV2605 drv;
void setup() {
drv.begin();
drv.selectLibrary(1); // Choose an effect library
drv.setMode(DRV2605_MODE_INTERNALTRIG);
}
void playEffect(uint8_t effectId) {
drv.setWaveform(0, effectId); // Effect in slot 0
drv.setWaveform(1, 0); // End of sequence
drv.go(); // Play it
}
You never have to hand-design a waveform for a basic “give the user a click” or “give the user a buzz” interaction — the chip has already done that work, and you’re just selecting from the library.
A first project
Wire a DRV2605 breakout to your microcontroller over I2C, attach either an ERM or LRA motor to its screw terminals (check which mode you’ve configured the chip for — ERM and LRA use different internal drive algorithms), and trigger a short “click” effect every time a button is pressed. Once that’s working, try layering effects to a state machine — a soft pulse on hover, a sharper click on confirm, a distinct buzz on error — which is the same basic vocabulary product designers use to make touchscreens and physical buttons feel more responsive than the underlying switch actually is.
Related Reading
- Adafruit DRV2605L Haptic Controller Breakout — official guide
- SparkFun Haptic Motor Driver Hook-Up Guide
- MACH Devices MD-7: An Open-Source Haptic Synth — our coverage of a project built around this exact category of hardware
- Flex Sensor: Getting Started — our tutorial on a complementary input-side sensor, often paired with haptic output in wearables