Pages: [1] 2   Go Down
Author Topic: 3V motors with the Arduino Uno  (Read 1688 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi people! I'm really new to Arduino and so far i have just managed to make a couple if/else statements with a vibrating motor and LED's. I am now trying to make and obstacle avoiding robot. I have all the parts, but I was just wondering how to power two 3V motors with the Arduino without using a motor shield or an h-bridge. If I really do need and h-bridge, then where can I get one? There are none at Radioshack. I can buy resistors and transistors and all the other stuff, but I am trying to keep things simple. Just thought one of you experts out there could help me out. I don't want a code or anything, just some help as to what I could do. Oh yeah and I was wondering how to make those DC motors go backwards. Please help asap!!! Thanks!

P.S. I am powering the Arduino with a 9V battery.
« Last Edit: January 30, 2012, 07:20:42 pm by ebun91 » Logged

Canada
Offline Offline
Sr. Member
****
Karma: 0
Posts: 318
Sometimes teaching, always learning,
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can't run a motor directly from an Arduino; you need some kind of driver. If you want it to go forwards and backwards, you need an H-bridge. Why are you against using a h-bridge or motor shield?
Also, using a 9V battery will not last long... those things don't have the capacity to run motors for a long time.
Quote
I am trying to keep things simple.
If I were you, I'd get a motor driver shield. That would be the simplest.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok. i will use the h bridge. the only reason i was against is was that i couldn't find it in any store. smiley-razz
can you recommend a good place to buy an h bridge? and if i want to power the arduino without the motor shield, then is there any way i could do so? i am prepared to make a circuit using a breadboard. and if i have to get a motor shield, then where can i do that besides radioshack? i kind of have a budget, and it would go over if i used radioshack's shield. smiley-razz smiley-razz
thanks!

oh and what kind of battery should i use?
Logged

Louisiana, USA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 50
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I used this one, about nine dollars. 

 http://www.robotshop.com/productinfo.aspx?pc=RB-Pol-110&lang=en-US

There are others though.  That driver will power two 1A motors.  I use it to drive 2 3volt Tamiya 'toy' motors.

I use a 9 volt to power the Arduino, then a two AA battery pack to supply current for the motors.  The battery pack was about 1.50 and i found it in one of the bins in radio shack.

I'm sureyou could google how to make your own driver using transistors if you'd rather.  If you buy the components at radio shack it might be cheaper to buy a driver board mail order.

My blog link below has some info about putting together a bot, probably similar to what you are doing.

Good luck!
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks you very much! I will probably get the motor shield you have shown. just one more thing smiley
you said u used a 9v for the arduino, but AA pack for the motor. how do you do that? and how would i use the h bridge? you don't have to tell me everything, but maybe just the basics lol. smiley smiley-razz
i kind of get it, so thanks!

so how do i connect two different battery packs to the arduino, one for the power the other for the motors?
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 224
Posts: 6614
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

so how do i connect two different battery packs to the arduino, one for the power the other for the motors?

Most motor shields have 2 power inputs: one for the logic, and a separate one for the motors. You connect the logic supply pin to the +5v pin from the Arduino, and the motor supply pin to the positive side of your AA battery back.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Louisiana, USA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 50
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The motor driver I referenced is not a shield, but just a small carrier board for the driver chip.  It plugs in neatly into the mini breadboard on my protoshield.

Yes, there are a ton of connections to make.  If you reference the link I gave above, you would connect the positive from the external battery pack to VMOT, and then the ground from the battery pack connects right below it. 

There will be two leads to connect on each motor.  AO1 and AO2 connect to one motor, and BO1 and BO2 connect to the other. 

On the Arduino side, you will have 3 digital pins per motor.  PWMa, AIN1, and AIN2 for one motor and like wise for the other motor.  To go forward, you set AIN1 high, AIN2 low, BIN1 high, BIN2 low.  Obviously, you need to set a PWM value to control the speed.  Backwards would be low,high,low,high.  To turn the motors off, set all pins low.  To brake, all pins high.  Turn - set o.e motor forward and one backward, depending on which direction.  Or you can turn while going forward by making one motor go faster than the other.

The standby pin must be set high for the driver to function at all.  You can do this either by tying it to VCC, or by connecting it to a digital pin and controlling it in code.  I used a pin, and have plans of hooking a big button up to control a kill switch.

If you do get that driver, make sure to look at those posts I made, and feel free to use the code if you like too.  If you ha e trouble, email me: Lonnie.Honeycutt@gmail.com
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay thank you very much! I will try what you all have suggested and hope it will work. Yea and I will email you if I still can't get it to work. I might post a question again on the same post, because since this is my first actual robot, i am sure i will have many questions. Thanks!

oh and like dc42 said, does the driver you have the 2 power inputs? this is probably a stupid question, but yes....i am new and stupid. lol smiley-razz
« Last Edit: January 31, 2012, 07:04:04 pm by ebun91 » Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 224
Posts: 6614
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, that board has Vmot for the motor power supply and Vcc for the logic power supply.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh good thanks!
smiley-grin
Logged

Louisiana, USA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 50
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I think you'll be happy with the driver.  I know the L293 and L298 are also very popular drivers.  The TB6112 THY just happens to be the first and only one I've used so far.  If I get another one, Ill probably just buy the bare IF and put it on a breadboard myself instead of paying extra for a Breakout board. 

Just a heads-up- if you buy from the link I posted, you will have to solder the included header pins yourself.  That's probably the case with most of them though.  I am a novice solderer at best and it only took a few minutes.

Good luck and have fun!
Logged


United Kingdom
Offline Offline
Tesla Member
***
Karma: 224
Posts: 6614
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That motor driver board uses the TB6612FNG chip, which has some advantages over the L293D:

- double the output current rating (1.2A continuous vs. 0.6A)

- mosfet outputs, which means that its voltage drop is less (0.7V max @ 1A, vs. 3.6v max at 0.6A)

- built-in logic to prevent you from turning on both low and high side switches in the same half H-bridge

It makes me wonder why anyone uses the L293D.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks! And yea i just started soldering, but i kind of get it.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh and this probably isn't the right subject, but I really don't get how to use my Parallax Ping sensor. I know how to connect it to the arduino, but I don't know how to set it up in the code and how to set the values and stuff like that. Is there any example? I went to your blog, MeanPC, and it was pretty cool, but I still didn't get how to set the code. Lol. smiley-razz

One more thing. I tested my motors, and even though they say 1.5-3V on the packet, it doesn't run in my 3V pin on the Arduino. It works great in the 5V pin though. So what is going on here? Thanks.
« Last Edit: February 02, 2012, 12:01:27 am by ebun91 » Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 224
Posts: 6614
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The 3.3V pin can only supply about 50mA, not enough for a motor.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Pages: [1] 2   Go Up
Jump to: