Arduino micro vibration motor | Arduino vibration motor code, interfacing

(Last Updated On: May 29, 2019)

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!!!!!



The components and tools used in this project can be purchased from Amazon, the components Purchase links are given below:

Arduino Uno: https://amzn.to/2tVz1vu
Mega 2560: https://amzn.to/2ze1kdu
Micro vibration Motor: https://amzn.to/2BS0QZA
Variable resistor: https://amzn.to/2XdNXSu
lm7805 Voltage Regulator: https://amzn.to/2IZEl5x
330 ohm resistors pack: https://amzn.to/2NtlAeh
5v 2A adaptor: https://amzn.to/2GsNfcw
2n2222 npn transistors: https://amzn.to/2EmXsIb
10k Resistor: https://amzn.to/2KTd6OW
lm7805 Voltage Regulator: https://amzn.to/2IZEl5x
330-ohm resistors pack: https://amzn.to/2NtlAeh
female DC power jack socket: https://amzn.to/2KEo1gt
470 uf capacitors: https://amzn.to/2xDCOzf
5×7 cm vero board: https://amzn.to/2OHGbvn
female headers: https://amzn.to/2zqmtiJ
connection wires: https://amzn.to/2DpBuW7
Super Starter kit for Beginners: https://amzn.to/2KJvmKG
Jumper Wires: https://amzn.to/2KMoVXs
Bread Board: https://amzn.to/2MS4q8X
12v Adaptor: https://amzn.to/2Ntr6h1
PCB plate: https://amzn.to/2IUwpCt
Variable Supply: https://amzn.to/2MT4Qfj
Digital Multimeter: https://amzn.to/2Nvft9i
Vero Board / strip board: https://amzn.to/2MTf9jD
Soldering iron kit: “best” You guys should definitely purchase this: https://amzn.to/2zfoNuJ
Solder wire: https://amzn.to/2ufUMWf
Wire Stripper: https://amzn.to/2KOqxfU
wire cutter: https://amzn.to/2ucIq14
PCB small portable drill machine: https://amzn.to/2Nu62XF

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 micro vibration motor is 2 to 5 volts.. The rated voltage is 3.7 volts and 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 Micro 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 micro 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.


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:

Recommended For You

About the Author: Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

Leave a Reply

Close