Greetings, I am using this shield for the first time with an Arduino Uno. I need to add a push button to reverse the direction of a stepper.
I am unsure which pins are actively been used by the shield and which are free for me to add the push button as an input.
Would any one please let me know? I will appreciate any information I could receive.
Thanks in advance!
Motor Shield V2 - free pins?
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_bill
- Posts: 88154
- Joined: Sat Feb 07, 2009 10:11 am
Re: Motor Shield V2 - free pins?
You can use anything except SDA and SCL (A4 and A5 on an UNO).
https://learn.adafruit.com/adafruit-mot ... aq-2861883
https://learn.adafruit.com/adafruit-mot ... aq-2861883
- silvideo
- Posts: 10
- Joined: Tue Nov 23, 2021 7:09 pm
Re: Motor Shield V2 - free pins?
Thank you so much for the prompt response and for providing the link; I see a lot of useful information!
Follow up question: could I safely connect the shield to a Mega256? I did try it and it worked fine but on the link you sent there is a reference to pins 20 and 21, which the shield did not use.
I am not sure if I would create an unsafe situation if I were to keep the Mega, motor shield and stepper working for a long time.
Thanks again.
Follow up question: could I safely connect the shield to a Mega256? I did try it and it worked fine but on the link you sent there is a reference to pins 20 and 21, which the shield did not use.
I am not sure if I would create an unsafe situation if I were to keep the Mega, motor shield and stepper working for a long time.
Thanks again.
- adafruit_support_bill
- Posts: 88154
- Joined: Sat Feb 07, 2009 10:11 am
Re: Motor Shield V2 - free pins?
Yes, it will work with an R3 or later version of the Mega, since all R3 and later processors have SDA and SCL pins brought out on the headers next to the AREF pin.
- silvideo
- Posts: 10
- Joined: Tue Nov 23, 2021 7:09 pm
Re: Motor Shield V2 - free pins?
Great!
Thanks again for the reply.
Happy thanksgiving day!
Thanks again for the reply.
Happy thanksgiving day!
- silvideo
- Posts: 10
- Joined: Tue Nov 23, 2021 7:09 pm
Re: Motor Shield V2 - free pins?
Please, allow me to ask another question:
Since I am only driving one stepper with a very simple code, is there an alternative to control it besides the Motor Shield?
I am beginning to think that the Motor Shield is a bit of an overkill for this situation. Don't get me wrong: I really like it but is there a simpler controller you would recommend?
Thanks again for your time.
Since I am only driving one stepper with a very simple code, is there an alternative to control it besides the Motor Shield?
I am beginning to think that the Motor Shield is a bit of an overkill for this situation. Don't get me wrong: I really like it but is there a simpler controller you would recommend?
Thanks again for your time.
- adafruit_support_bill
- Posts: 88154
- Joined: Sat Feb 07, 2009 10:11 am
Re: Motor Shield V2 - free pins?
What stepper motor are you using?
We have the TB6612B board which is the same driver used on the shield in a simpler form: https://www.adafruit.com/product/2448
The DRV8833 is another option: https://www.adafruit.com/product/3297
We have the TB6612B board which is the same driver used on the shield in a simpler form: https://www.adafruit.com/product/2448
The DRV8833 is another option: https://www.adafruit.com/product/3297
- silvideo
- Posts: 10
- Joined: Tue Nov 23, 2021 7:09 pm
Re: Motor Shield V2 - free pins?
You guys are amazing!
Thanks for the reply and advice.
Thanks for the reply and advice.
- silvideo
- Posts: 10
- Joined: Tue Nov 23, 2021 7:09 pm
Re: Motor Shield V2 - free pins?
I am sorry, I neglected to tell you that I am using the NEMA 17 you sell with ID 324.
I got the TB6612 you suggested connected and working but noticed it is a bit jerky moving from step to step; that is as opposed to the Motor Shield which was very smooth at low rpm.
I am sure I am overseeing something and perhaps there is something I could add to the the code to make it work smoothly as it was with the Motor Shield.
If you do not mind, here is the simple code I am using:
Basically I am rotating an essential oil carrousel 1/3 or a rev forward, 1/4 back, then one full rev forward and one full rev backwards with a delay in between.
Is there anything you think is missing?
Thanks so much for any advice you cold provide to me.
I got the TB6612 you suggested connected and working but noticed it is a bit jerky moving from step to step; that is as opposed to the Motor Shield which was very smooth at low rpm.
I am sure I am overseeing something and perhaps there is something I could add to the the code to make it work smoothly as it was with the Motor Shield.
If you do not mind, here is the simple code I am using:
Code: Select all
#include <Stepper.h>
const int stepsPerRevolution = 200;
Stepper myStepper(stepsPerRevolution, 4, 5, 6, 7);
void setup() {
myStepper.setSpeed(6);
}
void loop() {
myStepper.step(stepsPerRevolution/3);
delay(2000);
myStepper.step(-stepsPerRevolution/4);
delay(2000);
myStepper.step(stepsPerRevolution);
delay(3000);
myStepper.step(-stepsPerRevolution);
delay(3000);
}
Is there anything you think is missing?
Thanks so much for any advice you cold provide to me.
Last edited by adafruit_support_bill on Wed Dec 01, 2021 5:41 pm, edited 1 time in total.
Reason: Please use [code] tags when posting code to the forums.
Reason: Please use [code] tags when posting code to the forums.
- adafruit_support_bill
- Posts: 88154
- Joined: Sat Feb 07, 2009 10:11 am
Re: Motor Shield V2 - free pins?
Not sure what stepper modes you were using with the shield, DOUBLE stepping mode generates the most torque - but is not so smooth. INTERLEAVE and MICROSTEP modes divide up the steps to create less vibration - albeit with less torque.
The Arduino stepper library has only one mode - equivalent to the DOUBLE mode of the shield library.
The Arduino stepper library has only one mode - equivalent to the DOUBLE mode of the shield library.
- silvideo
- Posts: 10
- Joined: Tue Nov 23, 2021 7:09 pm
Re: Motor Shield V2 - free pins?
Oh, that explains!
I was using MICROSTEP with the shield; it provided enough torque to move 30 5mm bottles of essential oils around the axis.
Is there another library I could include to set the steps to MICROSTEP?
You do not know how much I appreciate your help.
Thank you!
I was using MICROSTEP with the shield; it provided enough torque to move 30 5mm bottles of essential oils around the axis.
Is there another library I could include to set the steps to MICROSTEP?
You do not know how much I appreciate your help.
Thank you!
- adafruit_support_bill
- Posts: 88154
- Joined: Sat Feb 07, 2009 10:11 am
Re: Motor Shield V2 - free pins?
Microstepping with the Tb6612 would require PWM pin control for the AIN1 and BIN1 pins. I don't know of any libraries that support that. www.pololu.com has a number of stepper controllers that have native microstepping support. That would give you the best of both worlds: microstepping plus high-speed step & direction control.
- silvideo
- Posts: 10
- Joined: Tue Nov 23, 2021 7:09 pm
Re: Motor Shield V2 - free pins?
Thanks for the reply and explanation. I think I will research how to use PWM; it will be a good challenge for me.
I can always go back to the Motor Shield since I got very good results with it.
I appreciate you help and advice.
I can always go back to the Motor Shield since I got very good results with it.
I appreciate you help and advice.
- silvideo
- Posts: 10
- Joined: Tue Nov 23, 2021 7:09 pm
Re: Motor Shield V2 - free pins?
Greetings, please allow me to ask an unrelated question to this topic:
I got a few Perma-Proto half size breadboard today; I must say they are very cute.
However when I tried to add an Elegoo MB-V2, I noticed the pins do not match.
Do you guys have a similar power module that would fit the rails of the Perma?
Please let me know when you have a chance.
Thank you!
I got a few Perma-Proto half size breadboard today; I must say they are very cute.
However when I tried to add an Elegoo MB-V2, I noticed the pins do not match.
Do you guys have a similar power module that would fit the rails of the Perma?
Please let me know when you have a chance.
Thank you!
Please be positive and constructive with your questions and comments.