how to control dc motor

2n3904 http://lmgtfy.com/?q=2n3904+transistor

I said mine says H A 66T19

I ignored what you said, and went by what was in the picture. I assumed it was relevant, and not just some random picture of a small signal transistor trawled from the Web.

This conversation is getting ever more bizarre. I'm out.

SO WHAT IF ITS FROM THE WEB?! that how mine looks like but only with one small difference which I wrote

I did the basic driving, it works but I have no control over it - I cant turn it off by command what should I do?

what should I do?

while ( ! workingAsExpected ) { if (wiring == DOUBLE_CHECKED && CORRECT) { buyNewTransistor (); } else { correctWiring (); } } stopBeingImpatientJerk ();

If you have no control over it then it didn't work. The motor might have turned but that is another matter. Transistors are diffrent inside. It is no use posting a picture of any old transistor we need to see yours. Google your part number and get the pinout for your transistor. The 3k3 is a resistor, you do have one don't you. You have damaged your arduino already. The fact that you can't tell is down to you not being able to measure many things about it. At best it's life is now less than it would have been before you abused it.

I did the basic driving, it works but I have no control over it - I cant turn it off by command what should I do?

You need to do some electronic learning concerning what you want to do. Use google to search for various component tetms like "transistor tutorial" and "resistor tutorial". without using the arduino, make your transistor circuit and mke your motor run by touching the 3k resistor connected to the transistor to the + of the motor battery. When you can start/stop the motor doing this, then connect to the arduino. Connect the 3k resistor to a digital pin on the arduino and connect the grounds together. Use the "blink" program to turn the motor on/off using the pin the 3k resistor is connected to.

is the 3k3 a 3k ohm transistor? and as I see it you are the impatient jerk and I think I might have the wrong kind of transistor so I'll buy one that I know would work and I havent damaged anything I messured everything about it... plus I have an arduino nano so I can double check with that

is the 3k3 a 3k ohm transistor?

Yes, that's right, a 3.3kohm resistor.

I havent damaged anything I messured everything about it...

I wonder how you did that. Took the top off the package and ran the die under your SEM? Ran a full suite of tests with your multi-million dollar ATE system?

Seriously mate, you've got to stop doing, and start [u]reading[/u] and [u]listening[/u] before you hurt yourself.

If one person tells you not to connect a DC motor to your AVR I/O pin, you might think s/he's a single voice, with no weight. When three or more people tell you not to do it, then maybe one or more of them has got a point. When Grumpy_Mike tells you not to do something, you'd really better not do it.

I'm guessing your age at only just into double-digits - take some time to learn, talk to your teachers, but make sure you ask sensible, founded questions that show you're interested in learning, not just rushing to your next "look-Mom-what-I-did-today-with-my-AVR" fix.

Edit: I assume you realise now, four pages and 49 replies in, that this isn't a "Programming Questions" sort of question?

OK thank you I got everything I wanted to know here and it was a programming question at first

would a 2N3904 NPN transistor work here?

What is the stall current of your motor? If it is more than 200mA, no.

I know im coming off here as a moron but I dont know... all I know is that it works with a minimum of 3 volts and can even work with 9 volts

Hold the shaft, and measure the current it draws at 5V.

connect it to 5v and ground and at the same time messure it?(I have a device that messures current and etc.)

tomer1510: connect it to 5v and ground and at the same time messure it?(I have a device that messures current and etc.)

That would measure minimum running unloaded current, rather then loaded or worst case locked rotor current, no?

Lefty

I think I covered that when I said

Hold the shaft,

whats a shaft?

The bit of the motor that turns