Howto change vibration intensity of Grove - Vibration Motor


a few days ago I bought some of the Grove - Vibration Motor and a Grove Base-Shield 1.3.
Now, after I put all together, I had to realize that by default it is not possible to control the intensity of the vibration motors.
After some research I saw that I have to use a transistor or a h-bridge to control the input voltage of the vibration motors.

Is there another way to control the intensity (voltage) of the motors by using only the Grove Shield or the Arduino??
If not, is there another Grove Shield that will enable me to control the speed of the vibration motors?

Please help me. :slight_smile: I need this motors for an university-project.

Thank you very much!

Thanks for buying Grove Vibration motor.

The Grove-Vibration motor already contains a transistor to control and has a back-emf protection diode. In the Wiki example motor is connected to pin 9 which a PWM capable output. Please use PWM ( analogwrite() ) to vary the speed of vibration.

Ex Code: Slowly vary motor speed from minimum to maximum

int MoPin = 9;    // vibrator Grove connected to digital pin 9
int val=0;
void setup()  { 
  pinMode( MoPin, OUTPUT );
void loop()
    analogWrite(MoPin, val);         

You could use this idea to develop code for your application.

Thank you very much for your answer!! Hurray, I bought the right thing. :slight_smile:

But I have another question.
I have the Grove Base Shield v1.3 with the following connectors:
7 Digital connectors (D2-D8)
4 Analog connectors (A0-A3)
4 I2C sockets

At the moment all my motors are connected to one of the D-ports.
In code I just simply use a pin-number between 2 and 8. (Because of D2 - D8)
When I read about pin 9 which of this connectors is meant?

It looks like not all of the Arduino pins are compatible with PMW.
So which connectors of the Grove Base Shield are compatible with PMW,or are all D-ports PMW compatible?

Thank you very much for your help!

In arduino the PWM capable pins are Digital pins 3,5,6,9,10,11. For more clarification see thewiki page which will clearly indicate the PWM pins.

The Grove base shield digital connectors D2-D8 are to digital pins 2-8 Please refer the base shield wiki page.

The pin 9 is connected to the D8 connector but the 3rd pin of your grove vibration motor is a NC pin So if you are using Grove Base
shield only D3,D5and D6 are PWM compatible

note: Change MoPin=3 or 5 or 6 in the code.