MotorShield with PWM
Moderators: adafruit_support_bill, adafruit

MotorShield with PWM

by longkmt on Mon Mar 11, 2013 11:18 pm

Hi,

I have the same motorshield from adafruit:
Image

For now the motor shield can control up to 4 DC motors, but I need to control two more DC motors. As I know the shield is using 4 PWM signals from 4 out of 6 PWM output pins from the Arduino Uno. Is there anyway we can use the other 2 remaining PWM to control 2 motors using an additional H-bridge circuit?
longkmt
 
Posts: 4
Joined: Mon Mar 11, 2013 11:06 pm

Re: MotorShield with PWM

by adafruit_support_bill on Tue Mar 12, 2013 6:24 am

There are a couple of approaches to this:

If you do not need direction control for some motors, those motors can be controlled with just a PWM pin and a transistor.
If you do need both direction and speed on all motors, you could hook up another H-bridge chip with some of the unused pins. Or you could look into some of the serial motor control modules from Pololu.
User avatar
adafruit_support_bill
 
Posts: 31866
Joined: Sat Feb 07, 2009 10:11 am

Re: MotorShield with PWM

by longkmt on Tue Mar 12, 2013 2:41 pm

Which PWM pins on the Arduino will connect to the Servo pins on the shield? Are they pin 9 and 10?
longkmt
 
Posts: 4
Joined: Mon Mar 11, 2013 11:06 pm

Re: MotorShield with PWM

by adafruit_support_bill on Tue Mar 12, 2013 3:00 pm

Yes. 9 & 10 are the servo pins.
User avatar
adafruit_support_bill
 
Posts: 31866
Joined: Sat Feb 07, 2009 10:11 am

Re: MotorShield with PWM

by longkmt on Tue Mar 12, 2013 5:40 pm

Great, I am using L293d H-Bridge. 2 PWM signals from the Servo will go to pin 1(EN) and Motor Logic 2A (pin 7), I still need one digital pin which will go to Motor Logic 1A (pin 2). I guess I can use pin 4,7,8 or 12 from the Arduino, but I don't know how they are connected to the shield. In other words, I want to know which pins on the shield are connected to pin 4,7,8,12 on the Arduino?!

Image

Thanks!
longkmt
 
Posts: 4
Joined: Mon Mar 11, 2013 11:06 pm

Re: MotorShield with PWM

by adafruit_support_bill on Tue Mar 12, 2013 6:27 pm

In other words, I want to know which pins on the shield are connected to pin 4,7,8,12 on the Arduino?!

It's in the FAQ: http://learn.adafruit.com/adafruit-motor-shield/faq
User avatar
adafruit_support_bill
 
Posts: 31866
Joined: Sat Feb 07, 2009 10:11 am

Re: MotorShield with PWM

by longkmt on Tue Mar 12, 2013 6:52 pm

Oh thanks a lot!
longkmt
 
Posts: 4
Joined: Mon Mar 11, 2013 11:06 pm

Re: MotorShield with PWM

by Zenock on Tue Mar 12, 2013 7:09 pm

Hi:

Would it be correct to assume that all motors, DC and Stepper, must use the save voltage? For instance I couldn't use a 24 V power supply and a 24 volt motor and a 6 volt motor?

Or is there a way one could do this?

Z
Zenock
 
Posts: 3
Joined: Tue Mar 12, 2013 7:06 pm

Re: MotorShield with PWM

by adafruit_support_bill on Tue Mar 12, 2013 7:21 pm

@Zenock: All would need to use the same voltage.
User avatar
adafruit_support_bill
 
Posts: 31866
Joined: Sat Feb 07, 2009 10:11 am

Re: MotorShield with PWM

by Zenock on Tue Mar 12, 2013 8:53 pm

Could I cut the lead to PIN 8 on one of the chips and wire in a voltage regulator?

Also, If I understand correctly, the servos runs off 5 V even if I'm running the motors off 24 volts? Is this correct?
Zenock
 
Posts: 3
Joined: Tue Mar 12, 2013 7:06 pm

Re: MotorShield with PWM

by adafruit_support_bill on Tue Mar 12, 2013 9:49 pm

Could I cut the lead to PIN 8 on one of the chips and wire in a voltage regulator?

Yes. That is possible.
Also, If I understand correctly, the servos runs off 5 V even if I'm running the motors off 24 volts? Is this correct?

Normally true. Although a separate supply for servos is possible as described in the FAQ: viewtopic.php?f=31&t=26873
User avatar
adafruit_support_bill
 
Posts: 31866
Joined: Sat Feb 07, 2009 10:11 am

Re: MotorShield with PWM

by Zenock on Tue Mar 12, 2013 10:06 pm

Thank you so much. You are AWESOME.
Zenock
 
Posts: 3
Joined: Tue Mar 12, 2013 7:06 pm