Eureka! I was able to get my mini steppers working (as described here), and boy was it easy! Here’s the arduino code I used. Hopefully I’ll soon figure out how I can drive five of these at once using only one arduino. I’ve got some ideas; we’ll see how that goes.
/*
* Blink
*
* The basic Arduino example. Turns on an LED on for one second,
* then off for one second, and so on... We use pin 13 because,
* depending on your Arduino board, it has either a built-in LED
* or a built-in resistor so that you need only an LED.
*
* http://www.arduino.cc/en/Tutorial/Blink
*/
int blue = 0; // blue wire on pin 0
int black = 1;
int red = 2;
int yellow = 3;
void setup() // run once, when the sketch starts
{
pinMode(blue, OUTPUT); // sets the digital pin as output
pinMode(black, OUTPUT);
pinMode(red, OUTPUT);
pinMode(yellow, OUTPUT);
}
void loop() // run over and over again
{
digitalWrite(blue, HIGH); // sets the blue wire on
delay(5); // waits for a 1/100 of a second
digitalWrite(blue, LOW); // sets the blue wire off
digitalWrite(black, HIGH); // sets the black wire on
delay(5); // waits for a second
digitalWrite(black, LOW); // sets the blue wire off
digitalWrite(red, HIGH); // sets the black wire on
delay(5); // waits for a second
digitalWrite(red, LOW); // sets the blue wire off
digitalWrite(yellow, HIGH); // sets the black wire on
delay(5); // waits for a second
digitalWrite(yellow, LOW); // sets the blue wire off
}
The last release of this app was a huge step over the first, but this one is by far the best yet. As I get more advanced with Processing and Arduino (mostly the former), this thing’s gonna rock the house!
New in version 007:
Download the code:
I’ve got lots more ideas up my sleeve, but the wife is telling me that I have to actually do something productive with the rest of my day :( Laaaaaame.
Cheers!
Adam
03/10/2010So you’ve decided you want to create digital 3D models.
You might be an aspiring movie special effects guru, industrial designer, architect, or mechanical engineer. Maybe you’re wanting to create photo-realistic images of product design ideas, or maybe you want to use 3D Computer Aided Design (CAD) to control a Computer Numeric Controlled (CNC) milling machine to bring your ideas into physical reality. You might be hoping to play with rapid prototyping, mechanical simulation, or 3D animation for art, illustration, or demonstration.
Knowing the right 3D software package(s) will not make you a good designer, a competent engineer, or a film effects creative genius. It will simply be a tool in your belt, there when you need it, making it possible for you to communicate three-dimensional ideas quickly and accurately for virtually any purpose you can imagine.
But when you look for a specific program into which you’ll invest lots of time and money, the number of options can be daunting. How do you decide which 3D program is right for you?
There is no magic bullet in the 3D software world; every piece of software that exists on the market has a niche for a specific type of user with a specific combination of needs. In this set of posts, I’ll try to make the pros and cons of all sorts of common 3D applications easily understandable for the newbie, and hopefully even clear up a few things for the seasoned professional.
In this, the first post in our series, we’ll be looking at the broader landscape of 3D applications, and discussing the basic categories of 3D applications. more »
03/08/2010This is the second part in a series building up a Morris Minor in modo. To start at the beginning, start here. more »
03/07/2010
May 5th, 2009 at 3:44 pm
Hello,
As far as I can tell you are not using the white wire. So however the white wire is connected you are running the motor as a bipolar. Your code indicates that you are using wave drive. If in fact the motor is a unipolar (which I suspect) with the white wire being a common tap (and it may not be so), then you are not getting the most from the motor. In any case you are probably better off using full step. This will give you better torque. See code “Bipolar full step” below.
Usually microcontrollers have better drain capability than source capability. If your motor is a unipolar then you should run it as a unipolar using the forte of your microcontroller. Try connecting the white wire to positive power supply and then pull the other four wires low in sequence (for wave drive). See also code “Unipolar full step” below.
As to the question of whether or not your motor is a hybrid – in the ordinary sense of the word when describing stepper motors – it does not really matter to how the windings should be hooked up or what drive mode to use.
Cheers.
// Bipolar full step
void loop()
{
// Forward polarize winding A
digitalWrite(blue, HIGH);
digitalWrite(red, LOW);
delay(5);
// Forward polarize winding B
digitalWrite(black, HIGH);
digitalWrite(yellow, LOW);
delay(5);
// Reverse polarize winding A
digitalWrite(blue, LOW);
digitalWrite(red, HIGH);
delay(5);
// Reverse polarize winding B
digitalWrite(black, LOW);
digitalWrite(yellow, HIGH);
delay(5);
}
// Unipolar full step.
void loop()
{
digitalWrite(blue, LOW);
digitalWrite(red, HIGH);
delay(5);
digitalWrite(black, LOW);
digitalWrite(yellow, HIGH);
delay(5);
digitalWrite(red, LOW);
digitalWrite(blue, HIGH);
delay(5);
digitalWrite(yellow, LOW);
digitalWrite(black, HIGH);
delay(5);
}
May 5th, 2009 at 5:49 pm
Thanks for the great response Aksel!! I really wish I understood this stuff better. I’ll dive in deeper based on your comment and and post what comes of it. Thanks again!
August 22nd, 2009 at 2:35 pm
How are you getting on with your split-flap display, I have had a fair bit of interest in mine and have even been in touch with the manufacturer and have had some limited access to see how the old ones worked more closly, I am preparing to go to the laser cutter again to make my next prototype, I am just trying to choose a stepper with the accuracy I need to make this possible.
Interested to hear your progress, email me or reply here/with a new post!
August 22nd, 2009 at 4:13 pm
Thanks for checking in, Tom! I’ve been in the process of moving, and we won’t be finally settled in our new place until September 4th or so.
I’ve just been totally swamped with other work lately, but I really want to make this happen! Let me know what you learn, and I’ll definitely let you know when I get back to it!
October 27th, 2009 at 11:58 am
several months ago, i bought a ton of those little stepper motors and i was left in complete frustration when i wasn’t able to find anything online about connecting them to the arduino. like you, i had a very hard time reading the schematic. so i am very pleased to have found this blog because i’m finally able to get started with a project that i orginally intended on creating. i am a recent art school grad and i am trying to create a tiny mechanical butterfly with these motors, using the arduino. i have used servo motors in the past and i was unhappy with how loud they were and their overall function. although, if that is the only option i have, i guess i’ll have to deal with it. i want to use these steppers because they are so quiet and smooth. so i noticed that when i uploaded the code, the motor only seems to move in one direction, it’s not stepping back and forth. is this even a possiblity given the way that the wires are connected to the arduino? and why can’t an easy driver be used in this case? any help would be 100% greatly appreciated! thanks :}
October 27th, 2009 at 1:01 pm
Hi Sara:
Good luck with your project! Sounds fun. I’ve played with the EasyDriver on other projects, and it works great. The problem? It’s way too expensive! For $15 each, I couldn’t afford more than a couple. You can tweak the code to make it go back and forth without much difficulty, but I’m probably the wrong person to help with that. The Arduino forums would probably yield better results. Basically with this post I was just trying to show the “simplest” possible way, not necessarily the “easiest”. Have fun!
October 27th, 2009 at 2:47 pm
thanks adam,
i’ve been playing with the easydriver as well, and you’re right, it is expensive. i’ve tried tweaking the code but i’m really not very good at this yet so the arduino forums have become a close friend. i hope i can figure something out. although, i’m already becoming more fond of servos again :]
October 27th, 2009 at 4:37 pm
Servos are waaaaay easier, no doubt. In very loose terms, a servo is a stepper with an EasyDriver built-in. I think steppers are amazing, but not for the faint of heart!