I have three stepper motors that I need to control independently. I would like to connect them to the ARDUINO MEGA direclty, is this possilble? to which pins?
is there a sample code i need to use? any libraries i need to download? want to simply make them sweep back and forth independently.
Steppers are not (rc-)servos. Stepper-motors do not sweep (on their own). Nor do servos make true steps. You would want to use a stepper motor driver (usually 1 for each), as the microcontroller pins cannot drive the stepper coils directly. Way too much current is required.
Please make sure you know what you are asking about, or show exactly what kind of motors you have.
But I am not connecting them directly to the Arduino, I am using an H-Bridge (SN754410) for each one!
On the other hand, I am using Sparkfun Steppers with 200 steps/rev. (product number 10848).
Would these help? I realize the three steppers will not work entirely by the Arduino, that is why I also got an external power supply outputting: 12 VCD, 3A.
I would appreciate your help. Am I connecting to wrong pins to Arduino? Am I drawing too much current?? As you can see both the “ON” green and “L” yellow LEDs are lighting!! why is that?
I’m sorry, but that is just too much of a bowl of spaghetti to make sense out of. Can you provide a drawing of which wire went into which pin-hole and for what function on the chips? It’s great that you did make the pictures though, unfortunately it’s to complicated to tell what goes on.
Also, does the Arduino work if you do not connect the motors to the drive chips? Or with just 1 connected? Have you tried to build it up in steps gradually? (testing in between) That may help identify the spot of a potentially improper connection. And reduce the amount of spaghetti. Once you get it to work, you can copy it for the other motors.
I would appreciate your help. Am I connecting to wrong pins to Arduino? Am I drawing too much current?? As you can see both the “ON” green and “L” yellow LEDs are lighting!! why is that?
I can make out that you connected a wire into pin 13. That is what the L-LED is connected to also. So if there is a high enough voltage on it then it will light up. The “ON” LED is ON when… well when the Mega is “on”! (to be more precise: when there is sufficient voltage on the 5v Vcc pin of it. which could be less than 5 volt and still light up)
As for drawing too much current, only a multimeter can tell you that. Make sure you have one among your tools, and start measuring.
Of course I have removed the 10k pot and i have added three steppers.
I am not sure what pins I am allowed to use then: you are correct, 13 is connected to the LED…where am i able to put the wires to then? which pins? for all three steppers? do I need to define pins for Arduino?
Yes I did this first for one motor, and it worked fine (of course with the pot) and then removed the pot and added the steppers.
I realize that drawing a picture of your own setup is a lot of work. But these images shown do not (likely) contain the problem. The problem is on your board. (breadboard most likely)
What if you build up the circuit surrounding the second driver chip and motor, but use the control wires (yellow in the last drawing) of the first motor section instead. As that pin -setup is known to work in your experience. Then you can isolate if the fault is in the 2nd driver circuitry/wires, or due to improper choice of the used pins or something else on the arduino side. I’m not familiar yet with the stepper library. So I can’t tell if it requires one of the pin to be able to do PWM. (then again, from the pcb silkscreen it looks like all pins can do PWM) But I doubt it, the circuit should do fine with normal digital level changes which are not automatic.
For what it’s worth. I bought a set of those kind of jumper wires recently. (not at SF though) And the first one I connected up happened to have had a broken wire out of the box. It was black, the custom color normaly chosen for ground, so my circuit wouldn’t work. Make sure you check for continuity on your wires with your multimeter.