In this tutorial, we will learn to interface a vibration motor with Arduino.
Vibration motor is a DC motor in a compact size that is used to inform the users by vibrating on receiving signals. It has no sound.
Mainly they are used in mobile phones, joysticks, pager and so on.
- Vibration Motor.
- NPN Transistor.
Circuit Diagram for Vibration Motor with Arduino
The following sketch will turn on the vibration motor for one second each minute:
This sketch uses a motor designed to vibrate. If we have an old cell phone we no longer need, it may contain tiny vibration motors that would be suitable.
Vibration motors require more power than an Arduino pin can provide, so a transistor is used to switch the motor current on and off. Any NPN transistor can be used.
A 1 kilohm resistor connects the output pin to the transistor base; the value is not critical, and you can use values up to 4.7 kilohms or so (the resistor prevents too much current flowing through the output pin).
The diode absorbs voltages produced by the motor windings as it rotates. The capacitor absorbs voltage spikes produced when the brushes (contacts connecting electric current to the motor windings) open and close.
The 33-ohm resistor is needed to limit the amount of current flowing through the motor.
This sketch sets the output pin HIGH for one second (1000 milliseconds) and then waits for 50 seconds. The transistor will turn on (conduct) when the pin is HIGH, allowing current to flow through the motor.
Vibration Motor and LDR Sensor
Here is a vibration of this sketch that uses an LDR sensor to make the motor vibrate. With the addition of an LDR connected to analog pin 0.
Here the output pin is turned on when a light shines on the photocell. When the sketch starts, the background light level on the sensor is read and stored in the variable sensorAmbient.
Light levels read in the loop that is higher than this will turn on the vibration motor.