Cellphone Vibration Motor + Arduino Uno

Hello Guys,

I'm into a project and I need an vibration feedback as my output for my system(for the blind).

I have the following materials on hand: - Arduino Uno - Old Cellphone Vibration Motor Note: I will connect the arduino to my C# application in the future.

I managed to control the vibration of the motor. Check this video: http://www.youtube.com/watch?v=mItr06wcVCk

Here is the code I used:

const int motorPin  = 3;  // vibration motor transistor is connected to pin 3

void setup()
{
  pinMode(motorPin, OUTPUT);
}

void loop()
{
  digitalWrite(motorPin,  HIGH);  // vibrate
  delay(1000); // delay one second
  digitalWrite(motorPin,  LOW);   // stop vibrating
  delay(500); // 
}

QUESTIONS: 1. how can I control the frequency of the motor? lets say from the serial monitor or from an C# application?

Voltage is what drives the motor so PWM will control its speed. However the resonant frequency of the motor will produce maximum vibration energy at one speed only so even though varying motor voltage will vary its speed (frequency) the perceived vibration energy will change dramatically.

jackrae: Voltage is what drives the motor so PWM will control its speed. However the resonant frequency of the motor will produce maximum vibration energy at one speed only so even though varying motor voltage will vary its speed (frequency) the perceived vibration energy will change dramatically.

Thank you for the idea sir.

Another question. I did not use any transistors and resistors with my circuit. Is it okay or it will harm my arduino board?

It probably will if you persist. You should also use a reverse biased diode across the motor to kill any spikes when the motor turns off.