Good Vibrations
Haptic Interaction in Virtual Environments

For this tutorial, we will make a very simple circuit with one eccentric rotation mass motor and a resistor. That is just because we want to see it buzzing in a VR demo application.

When bulduing a product or an experimental setup, you should prepare a more robust circuit and make sure you have the proper control over the stimulus properties. For this, we give a very simple example of a display made with Linear Ressonant Actuators (LRA) that you can use to reproduce some of our previous experiments.

We will use the software provided by Arduino to code and control our prototypes. Install it in your computer according the SO specifications.

Download Arduino

The circuit was built on a breadboard to receive the Haptic Driver component which has the inputs VIN, GND, SCL, SDA, and IN. VIN and GND appear in red and black, while SCL and SDA are blue and orange.

Then, eight Haptic Drivers must be added to the board to control eight vibrating motors.

The VIN inputs on the haptic drivers are used to control the motor by PWM signal. They were connected to the Arduino board from the pins 2 to 9. Then, the SDA was connected to the pin 20 and the SCL to the pin 21 (those pins work for the Arduino Mega SDK, but differs for other boards). The GND was connected to the ground pin and the VIN pin was connected to the 3V pin.

Then, the eight motors were connected to the drivers with cables of 1 meter each. The final board was placed on a container with the space for the Arduino and open spaces for the cables.

The eight motors were simply attached to pieces of Velcro to be easily repositioned on a larger strap of Velcro. Motors in cardinal and collateral positions are placed 7.5 centimeters apart. Two other motors were placed 0.5 centimeters apart from the central one.

To set the headband it is necessary to load an Arduino piece of software.

Finally, create a new project in Arduino with the following code:

#include < Wire.h >
#include "Adafruit_DRV2605.h"
Adafruit_DRV2605 drv;
int digOut = 8; // Number of digital outputs
int PWM = 255; // 100% duty cicle
int PIN = 0;
void setup() {
drv.writeRegister8(0x01, 3);
drv.writeRegister8(0x03, 6);
drv.writeRegister8(0x20, 0);
drv.writeRegister8(0x1D, 0);
// OUTPUT: Motors
for (int i = 0; i < digOut; i++) {
pinMode(i+2, OUTPUT);
analogWrite(i+2, 0);
void activateMotor(){
analogWrite(PIN, PWM);
analogWrite(PIN, 0);
void loop () {
// Activate each motor on the order it was in the previous array
PIN = 2; activateMotor();
PIN = 7; activateMotor();
PIN = 8; activateMotor();
PIN = 5; activateMotor();
PIN = 3; activateMotor();
PIN = 6; activateMotor();
PIN = 9; activateMotor();
PIN = 4; activateMotor();
// Waits 5 sec before repeating the vibrations