Arduino Projects

Arduino micro vibration motor | Arduino vibration motor code, interfacing

Micro Vibration Motor Description:

 

In this tutorial, you will learn how to use a micro vibration motor with Arduino. For the best understanding, a variable resistor will be used to control the vibration motor. by rotating the knob of the variable resistor the vibration can be increased and decreased. Without any further delay, let’s get started!!!!!


allpcb circuit

Amazon Links:

Arduino Nano USB-C Type (Recommended)

12v Adaptor:

Coin Vibration Motor:

Arduino Uno

*Disclosure: These are affiliate links. As an Amazon Associate I earn from qualifying purchases.

Micro Vibration Motor:

micro vibration motor

This is the micro vibration motor, as you can see it has two wires red and black. Red is the positive wire while black is the ground wire. The working voltage of the vibration motor is 2 to 5 volts.. The rated voltage is 3.7 volts and the current is .07 amps which is equal to 70milli amps. As you can see the vibration motor has small thin wires due to which it’s really hard to interface this with the Arduino, so I decided to fix the vibration motor on a small PCB board.


micro vibration motor

as you can see the two wires are soldered and now it can be easily interfaced with the Arduino. the red wire is the positive and the blue wire is the ground.

Interfacing of the Vibration Motor and Variable Resistor with Arduino:

Connect the middle leg of the variable resistor with analog pin A1 of the Arduino…

micro vibration motor

now connect the grey wire with the ground…

micro vibration motor

connect the red wire with the 5v…

micro vibration motor

connect the red wire of the vibration motor with pin number 5 which is the PWM pin of the Arduino…


micro vibration motor

connect the blue wire with the Arduino’s ground….

micro vibration motor

Now we will use this variable resistor to control the vibration of the micro vibration motor.

Micro Vibration Motor Arduino Programming:

The micro-vibration motor programming is really simple

the variable resistor is connected with the analog pin A1 of the Arduino.

As you know my friends every Arduino and Mega program has at least two functions, which are the void setup and void loop functions. Void means that these functions are not returning any values while the empty parenthesis means that these functions are not taking any arguments as the input.

  // put your setup code here, to run once:

pinMode is a builtin function and it takes two arguments as the input, the pin number or pin name and the status which can be input or output. as micro vibration motor is the output device so that’s why we set it to output. while the variable resistor is set to input

reads the variable resistor and store the value in variable data. Then using the map function we limit the maximum value to 255, and store the mapped value in data. Then using the analogwrite function we send the value stored in variable data to the pwm which is pin number 5 and its name is mvm.


Watch Video Tutorial:

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button