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
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);
}
