New User - Motors with Arduino

Hi
I'm pretty new to Arduino, and have been wondering how to use a motor with Arduino. I've seen Motor Shields and things like that, but I really don't understand whether I have to have one of those to use a motor(s). I'm not talking about servos, but a fully rotational motor. And I also don't really understand the programming for a motor.

Thanks!

Programming is just on an off like an LED. Also you can have another pin to give forward and reverse.
See:-
http://www.thebox.myzen.co.uk/Workshop/Motors_1.html

The Adafruit motor shield is very easy to use:

It's supplied as a kit, but it only takes 20 minutes or so to put it together.

I made a website for this just the other day. Idk why but lots of people are asking this. Go here: https://sites.google.com/site/arduinosoapy29/motor-speed-controller. I did it simple All you need a some parts from Radioshack. There like about $5. :smiley:

Looks good - but why the external power source? Why not the 5V supplied by the Arduino itself? That also looks like a good shield, but is it possible to do those things without the shield?

It's not a sheild. All I have is wires. The external batterys are for the amps the board doesn't have. You'll blow the pins. (I think, and I'm not going to try.)

Oh, ok, what voltage would you recommend? Sorry about the shield, I was replying to someone else.

It depends. What voltage motors do you have?

I have about 20 salvaged from things taken apart. Most are probably 5-9V.

If you don't know the voltage, try at 3V, then 4.5V, 6V and adding 1.5V each time. Before you do that, are there any tags or manafactures printed on the motors?

Yes, probably. They are mostly from CD players and the like. Would you have to change the code at all to accommodate different voltages?

Um. No. Since your using the pwm pins through a transister, all you have to do is to set the pins analogWrite.

Oh ok.

What about reversing direction or changing speed?

I haven't tried reversing yet, but I'll try it now. Changing the speed is easy. What board do you have?

Uno

Ok. Your going to want to have the middle pin of the transister in a pwn pin. Pwm pins are 3 5 6 9 10 and 11. Just programming one of those pins analog. I don't think you can do revirsing, but it may be posible with another resister. I'll try it. You might want to see my website if you didn't and read if in further detail. Look at the picture. :slight_smile:

Ok, I thought that PWM let you change speed or direction.

Pwm will control speed. I'm still not sure about direction, if you can set the value in the programming negative? idk, but this might be it: analogWrite(3, -255);

That is a possibility. I will try the suggestions over the weekend.