Want to run a vibration motor

I added the 2N2222 transistor and I created the code to control the motor
I tried it on a Teensy 3 and an Arduino. The motor runs a little faster on the Arduino than the Teensy, but I am still not at full speed. I tried values of 250 and 1000 for analogWrite. I tried a 1.5k ohm resistor and a 470k. I am getting 3.3V through the motor if I have the transistor one way and 1.2V the other way.

Please have a look at what I am doing wrong. I know it is difficult to see from the photos
Imgur
Imgur
Imgur
Imgur
I have ground from the battery going to the breadboard and ground from the Arduino. I watched this video Tutorial 5 for Arduino: Motors and Transistors – JeremyBlum.com and thought I need to somehow get the ground from the battery and the Arduino onto the board. I am losing 3V somewhere. I don't feel anything heating up. I placed the multimeter black onto the battery ground and the red on the transistor's leg that supplies the voltage. I believe it is the emitter and I have voltage coming in on the collector

//const int motorPin =  14;
const int motorPin =  A0;

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

void loop()                     
{
  analogWrite(motorPin, 1000);
}

Sorted :slight_smile:

I need to learn to follow drawings. I had the transistor on the positive line before going into the motor not after the motor. Not sure why it makes a difference. I now have 6.6V going through. I will work on lower the voltage now

I created my first ever pcb design for this project

Imgur

retrolefty:
That's a pretty low current motor that will run off the arduino 5V voltage pin. So wire an output pin to a 1K ohm resistor, and the other end of the resistor wires to the base of a 2N2222 transistor. Wire the emitter of the transistor to a arduino ground pin, wire the collector lead to the motor and the other motor lead to the arduino 5V pin. Finally install a diode across the motor's two terminals with cathode end to the 5V side of the motor.
Here is a drawing to show the connections you need to make, but instead of the voltage coming from and external voltage source, it just wires to the arduino 5V pin. Make sense?

Good luck and good hunting.

Lefty

Hi, could you please upload again the drawing? thank you!

leech:
Hi, could you please upload again the drawing? thank you!