Gravity: Vibration Module SKU: DFR0440
From Robot Wiki
The Micro Vibration Module
Contents
1 Introduction
2 Specification
3 Board Overview
4 Tutorial
o 4.1 Requirements
o 4.2 Working Principle
o 4.3 Control the Module by the Switch
o 4.4 Control the Module Amplitude
5 FAQ
Introduction
Have you ever wondered how to implement a vibration motor in your project, like you would
find in a mobile phone? The newest vibration module in the DFRobot "Gravity" series gives you
in-depth understanding of vibration motor principles. This module uses a high quality small
vibration motor that is the size of a coin. Using the Gravity 3 pin interface, you can plug and play
this module for your convenience.
Specification
Operating Voltage: 5v
Control mode: High‐Low level/PWM signal
Dimension: 30 x 22 mm/ 1.18 * 0.78 inches
Board Overview
Pinout
Num Label
Description
1
Signal
Control signal input
2
VCC
VCC
3
GND
GND
Pinout
Tutorial
1. Introduce working principles of the vibration module.
2. Introduce control mode of the micro vibration module by simple examples and pictures.(high
level work, low level stop).
3. Control the module vibration intensity by PWM.
Requirements
Hardware
o DFRduino UNO x1
o Vibration Module x1
o Dupont jumpers
o Digital Push Button DFR0029‐Y X1
Software
o Arduino IDE Click to download Arduino IDE
https://www.arduino.cc/en/Main/Software
Working Principle
The vibration module uses a vibration motor as its vibration source. Vibration is created by a set
of adjustable weighted blocks attached to the end of rotating shaft. The centrifugal force
generated by high speed rotation of the shaft and weighted blocks creates vibration.
Control the Module by the Switch
push button control diagram
/***************************************************
* Vibration
* ****************************************************
* This example shows that the module will vibrate for 5 seconds when we pres
s the button
* @author Dongzi(1185787528@qq.com)
* @version
* @date
V1.0
2016-5-26
* All above must be included in any redistribution
* ****************************************************/
const int buttonPin = 8;
// the number of the pushbutton pin
const int VibPin =
// the number of the Vibration Module pin
11;
int key=0;
void setup()
{
pinMode(VibPin,OUTPUT);
// Set the digital pin(11) as output
pinMode(buttonPin, INPUT); // Set the digital pin(8) as input
}
void loop()
{
key=digitalRead(buttonPin);
if(key==LOW)
{
digitalWrite(VibPin,HIGH);
//Turn on the
Vibration Mod
ule
delay(5000);
//Waits for 5 seconds
digitalWrite(VibPin,LOW);
//Turn off the
Vibration Modu
le
}
else
digitalWrite(VibPin,LOW); //Turn off the
Vibration Module
// put your main code here, to run repeatedly:
}
Results: when the button of pin 8 is pressed, the vibration module will be on for 5 seconds, then
stop and wait for the button to be pushed again
Control the Module Amplitude
//Arduino Sample Code for Vibration Module
//www.DFRobot.com
//Version 1.0
#define Vibration 3
//define driver pins
void setup()
{
pinMode(Vibration,OUTPUT);
Serial.begin(9600);
//Baudrate: 9600
}
void loop()
{
analogWrite(Vibration, 160);
//PWM
delay(1000);
analogWrite(Vibration, 200);
delay(1000);
analogWrite(Vibration, 255);
delay(1000);
//PWM
//PWM
}
Results: With the PWM value increases, amplitude increases
FAQ
For more questions or interesting projects, you can visit the forum!
Powered By DFRobot © 2008-2017
很抱歉,暂时无法提供与“DFR0440”相匹配的价格&库存,您可以联系我们找货
免费人工找货