微型振动模块

简介

你有没有好奇过手机是如何实现振动的?为什么有时候震感比较强,有时候震感又比较弱呢?Gravity系列最新振动模块,带你深入了解模块的振动原理,满足您的好奇之旅。 模块采用一个优质小型振动电机,整体只有硬币大小,边缘做了圆角处理,更小,更贴心。Gravity 3-Pin接口,即插即用,使用更加方便。让孩子们在探索发现的时候,更加专注知识本身,甩掉繁杂的接线。

产品参数

引脚说明

标号 名称 功能描述
1 Signal 控制信号输入端
2 VCC 电源+
3 GND 电源-

引脚

使用教程

  1. 介绍振动电机的工作原理。
  2. 通过简单的例程和图片来直观的说明微型振动模块的控制方式(高电平工作低电平停止)
  3. 通过PWM信号,控制模块振动强度

准备

工作原理

振动模块采用振动电机作为激振源,振动电机是在转子轴一端安装一组可调偏心块,利用轴及偏心块高速旋转产生的离心力得到激振力。

通过开关控制振动模块

按键控制接线图




    /***************************************************
    * Vibration
    * ****************************************************
    *  This example shows that the module will shake /vibrate 5S when we press the button


    * @author Dongzi(1185787528@qq.com)
    * @version  V1.0
    * @date  2016-5-26
    * All above must be included in any redistribution
    * ****************************************************/
    const int buttonPin = 8;     // the number of the pushbutton pin
    const int VibPin =  13;      // the number of the Vibration Module pin
    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 Module
                          delay(5000);   //Waits for 5 seconds
                        digitalWrite(VibPin,LOW);  //Turn off the  Vibration Module
                         }
                   else
                   digitalWrite(VibPin,LOW); //Turn off the  Vibration Module
      // put your main code here, to run repeatedly:

           }

结果:当8号脚的按键被按下 振动模块会工作5秒,停止,等待下一次按键

控制振动电机振动


    //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);   //PWM
      delay(1000);
      analogWrite(Vibration, 255);   //PWM
      delay(1000);
    }

结果:随着PWM数值的提升,振幅有所提升

Mind+图形化编程

1、下载及安装软件。下载地址:https://mindplus.cc 详细教程:安装教程
2、切换到“上传模式”。 详细教程:Mind+基础wiki教程-上传模式编程流程
3、“扩展”中选择“主控板”中的“Arduino Uno”。 详细教程:Mind+基础wiki教程-加载扩展库流程
4、进行编程,程序如下图:
5、菜单“连接设备”,“上传到设备”,即可看到振动和停止。

常见问题

还没有客户对此产品有任何问题,欢迎通过qq或者论坛联系我们!

更多问题及有趣的应用,可以 访问论坛 进行查阅或发帖!

更多

原理图 元件布局图

- DFshopping_car1.png DFRobot商城购买链接