how to control dc motor

tomer1510: why would I need a diode? the motor is not a power source therefor will power back the arduino wouldnt a diode be useless in this scenario?

A motor has a large induction because of it's coil winding. The motor when running develops a large magnetic field and if you suddenly switch off the motor the magnetic field collapses, causing a transient voltage spike of opposite polarity to be imposed onto the attached wiring. This voltage can be up to 4X the originally applied voltage and can cause damage to other components in the circuit. The reversed biased diode across the motor winding allows the spike to be dissipated through the diode and the winding resistance, thus 'suppressing' and dissipating the voltage.

Lefty

ok so I have a transistor, a resistor a dc motor and arduino uno and nano what should I connect where to make it work(I want it to be controlled by pin 7)?

@tomer1510: You do realise that answers to virtually all your questions are to be found in the reference, tutorial and playground pages? A little effort on your part expended on reading and following these examples would save everyone an awful lot of time.

ok so I have a transistor, a resistor a dc motor and arduino uno and nano

Did you miss the bit about the diode?

I am a beginner and I dont fully understand the examples and all that and thats why im asking questions here you dont have to answer my questions but it would be great if you could and I also have diodes what should I do? I saw the driving scheme but didnt fully understand it

I saw the driving scheme but didnt fully understand it

What "driving scheme" and what didn't you understand?

what should I do?

You tell us what motor, what transistor, what diode and what resistors you have. We're not psychic.

my motor doesnt have an identifier so I dont know hat kind... a small dc motor that works on 3v-9v Please tell me what kind of diode and transistor I need to make it work and in one of the first replies to this topic there was a link that has a scheme that explains how to hook up a motor to electric circuits but I didnt understand it...

a small dc motor that works on 3v-9v

Yes, I think we've long established that, but how much current does it pull at stall?

Think about it for a moment; a slot car motor runs on 12V, but so does a diesel car's starter motor. The transistor that could drive the first would turn into a little puddle (or vapour cloud) with the second.

listen guys when I connect the motor to GND and 5v it starts(which is not good enough because I cant control it) but when I connect it to pin 7 and GND it doesnt start, why? GND is GND and pin 7 gives 5v as well(I checked!) what is wrong? should I use a command other than digitalWrite(7, HIGH); ?

Which part of "there is insufficient current from a digital I/O pin to drive a DC motor" are you having difficulty understanding?

The 5V pin comes straight off the regulator on the board, which is probably good for 500mA. Pin 7 comes via the microcontroller, and is good for 40mA maximum, and may already have been damaged by your experiment.

READ THE TUTORIALS.

This kind of thing doesnt just happen... if there current differs from pin 7 to the 5v pin then that means that the resistence is bigger in pin 7? and what should I do to connect my motor?

and what should I do to connect my motor?

Read Grumpy_Mike's tutorial, but don't use IE to view it, use FireFox, or Chrome or Safari.

ok I will and by the way I havnt damaged my arduino... it gives out 5v/75mA from pin 7 and GND can you tell me how much mA the avarege dc motor needs?

it gives out 5v/75mA from pin 7

anything over 40mA is enough to damage your arduino.

I don't know how many times you need telling, you need to drive the motor with a device you can't just connect it to a pin. you need to drive the motor with a device you can't just connect it to a pin. you need to drive the motor with a device you can't just connect it to a pin. you need to drive the motor with a device you can't just connect it to a pin. you need to drive the motor with a device you can't just connect it to a pin. you need to drive the motor with a device you can't just connect it to a pin. you need to drive the motor with a device you can't just connect it to a pin. you need to drive the motor with a device you can't just connect it to a pin.

what does this mean? please tell me what goes where here... and this would infact work for me right?

can you tell me how much mA the avarege dc motor needs?

If you can tell us what "average" is in this context.

Just because you still get an output from pin 7, don't imagine it isn't damaged. It may well fail in the future. You were warned not to do it.

what does this mean?

It is a schematic of what you need to connect and where you need to connect it to. Can you identify the parts? T1 is a transistor, it has three connections, emitter (the one with the arrow) collector (the one on the same side of the bar as the emitter) and the base the one on the side by itself. The diode has an anode and cathode, the cathode is the long bar, physical diodes have a line on them at the cathode end.

What else are you stuck on?

Try looking at this:- http://luckylarry.co.uk/arduino-projects/arduino-control-a-dc-motor-with-potentiometer-and-multiple-power-supplies/

T1 is a transistor

More specifically, it is an NPN transistor.

my arduino still works as before and gives the same current and voltage from every pin what would damaged mean here? would a si-diode work? and I dont see any difference between my transistors pins... how do I know where to connect which pin if I dont know what they are? lets say I am looking on a transistor what would the left middle and right pin would be by this order? what is the ve+? is the 0v the ground(GND)? whats the 3K3? whats the motor supply? is the motor supposed to get a supply from an external battery?

what would damaged mean here?

Think "stress-fracture" or "metal-fatigue".

The bridge won't fall down right now, but next time a heavy truck and broken shock absorbers goes over it.

You haven't told us what your transistor is, so we can't identify the pins.

looks like in the picture attached only with a different writing: H A 66T19 2DKAA the sixes might be G's