Hi, I have been attempting to get a 3v DC motor to work with my ardiuno with no luck. Im pretty new to arduino so its probably something stupid simple im missing. I have tried other tutorials on the inter-webs to see if maybe the book i was using had something wrong in it.
http://exploringarduino.com/wp-content/uploads/2013/05/549360-c04f003callouts-copy-150x150.jpg
The link above is the diagram provided by the book.
http://exploringarduino.com/content/ch4/
This link is the online material of the book im using.
arduino 3v dc motor setup - Album on Imgur
This link is of what i have done.
code is below.
-----------------------------------------------------------
const int motor = 9;
void setup() {
pinMode(motor, OUTPUT);
}
void loop() {
for(int i = 0; i < 256; i++){
analogWrite(motor, i);
delay(10);
}
delay(2000);
for(int i = 255; i>=0; i--){
analogWrite(motor, i);
delay(10);
}
delay (2000);
}
---------------------------------------------------
Alright so everything i have tried so far is switching both the transistor (pn2222a) and the diode around in case i had them the wrong way and that is not the case.
I have measured the output of the transistor thinking that maybe it a was a faulty part and i get ~7 volts which i feel seems high. the transistor also gets really hot to the touch. If i put the multimeter up to any other part(diode, capacitor. motor) I get no volts. If I hook the motor directly to the ground then the motor will run at full speed.
Im pretty lost on what else to do any help will be greatly appreciated if you need better pictures or for me to test something just ask. Thank you in advance.