Astronomy with Arduino

Hello guys,

i am new to arduino and stepper motors. I bought from eBay arduino compatible and unipolar motor. My plan is to control it via PC and install motor on focuser of telescope, so i can focus my telescope with stepper motor. I also install Arduino 1.0 for windows (programing), but i have no idea what to do. Plan is to control stepper with speed 1,2 and 3 and backward-forward. Can someone help me on this please ?



Hi Greg,

Welcome to the wonderfull world of Arduino. As you are new I would advice spent a evening or two in the tutorial section and work through the samples. You will learn a lot there what is possible and what not.

Furthermore go through the discussions in this subsection and see if there are some that sounds familiar.

Finally the playground may contain interesting articles you can learn from e.g. - -

HOpe this helps to get you started, in the meanwhile if there are questions just ask! Astronomy related items are discussed here too e.g. - -


i managed to connect arduino to pc. I got some random code’s to try how it work, but than i wanted to stop that code of working so i upload this code that i got on net :

#include <avr/io.h>
#include <avr/wdt.h>

#define Reset_AVR() wdt_enable(WDTO_30MS); while(1) {}

int main(void)

now my arduino is not responding. Any idea how can i repair this ?



SOunds like your arduino is constantly resetting itself,

IIRC you must upload a new sketch and while compiling keep the reset button pressed and let it go when upload starts. You might need to try a few times.

use a minimal sketch like:

void setup(){}
void loop(){}

which does nothing forever.

Thank you, i managed to install another one, just as soon as i plug in usb.

I was thinking something like this :

But i am not sure bout code here : v2 code.txt, there is also program.

My arduino is connected on right port, but it want move my stepper somehow. When i press sent to motor it blink once asap as i click on that button in program, but motor is still.

My connection is like this :

Let me know if is wrong.



anyone, please?



I would advise looking at this page: Specially, the Four pin configuration. I don't know the pin configuration for the ULN2003 module you are using. Do you have a schematic for your ULN2003 module ?


Hey, Sajuuk.

I have 5 wire motor unipolar. I wrote 4 wires by mistake, but is 5.

Here is code, but is only for pin 3 and 12, how can change to pin 8,9,10,11 ?


Its probably best not to power the motor from the Arduino's 5V supply, that is a recipe for problems - you're best with a power supply suitable for your motor that goes just to the motor and ULN2003 board. Common the grounds between Arduino and ULN2003 board.

What are the specs/datasheet of your particular motor? Particularly the current and winding resistance (or motor voltage).

It is 35byj412b LEILI gear Stepper motor: Voltage: 12V Diameter: 28mm Step angle: 5.625 x 1 / 64 Reduction ratio: 1 / 64 5 Line 4 phase

Stepper motor driver board with ULN2003 A, B, C, D four-phase LED indicates the status of the stepper motor work Stepper motor with a standard interface, when used directly pluggable.

Hi Ronzi, From what I could gather, the "stepperserial" is used to connect the sparkfun easy driver v3, which is for bipolar steppers (4 wire connection). I don't think this code will work that well(if at all) with your unipolar stepper...

Have you managed to test the stepper ? Make it turn in one way and then the other way ?

If not, I suggest you try to make the connections just like in the unipolar stepper schematic and then use the stepper_oneRevolution example from the Arduino IDE to see if it runs.

More informations on steppers you can find here: