3in1 Stepper Motor Controller
This article was submited by morgoth and is part of the PCB giveaway program, so for submitting he’s work morgoth will receive a free PCB. Also in the future we’ll see more of he’s projects.
Of-course there are other projects based on this idea around the web, but what makes this one special, it’s he’s features. There are 3 stepper motors controlled by a single ATmega8 that runs at 8 MHz, and a motor driver for each motor. The motors and their drivers were recovered from an old printer.
Although the motors are controlled by the same microcontroller each one can move independent. The board can receive commands to drive the motors trough serial interface from a computer. There is also a PC software that enables you to send commands from a nice graphical interface.
As you can see this is a very practical application, for example it can be easily developed into a CNC machine. I personally like morgoth’s coding skils and i think he has some more great projects to show.
And in the ending here is a movie with the motors in action.
Here are some downloads:
- asm source, hex, and board files
- source files for pc interface
- pc interface.exe
- pcb picture
- schematic picture
- NOTE: youritronics reader Radu pointed out that the schematic is wrong. According to the datasheet the Atmega8 has GND on pin 3 and 5 and VCC on pin 4 and 6. The schematic has the VCC and GND the other way around, you need to correct that for the system to work.
- schematic for unipolar motor
- interface and source code for unipolar motor and ULN2803
- NOTE: youritronics reader Radu pointed out that the schematic is wrong. According to the datasheet the Atmega8 has GND on pin 3 and 5 and VCC on pin 4 and 6. The schematic has the VCC and GND the other way around, you need to correct that for the system to work.




September 15th, 2008 at 11:32 am
[...] Read more about making a 3-in-1 Stepper Motor Controller [...]
September 15th, 2008 at 8:35 pm
How well does this controller handle heat with constant use of a stepper?
September 15th, 2008 at 8:50 pm
The controller doesn’t have to handle heat at all, because the motors are controlled trough drivers circuits. So you can adapt it for your needs by using adequate drivers.
September 16th, 2008 at 9:40 pm
I’m having trouble opening the .MAX file… it there just a simple image or text/ascii drawing of the circuit somewhere?
September 16th, 2008 at 10:11 pm
Mike, I’ve added a link with the picture at the end of the article.
September 16th, 2008 at 11:34 pm
Thanks for the board diagram. Looks like a neat alternative for a project. My solder-fu is not strong enough for surface mount work, is there an actual circuit diagram I can adapt to non-surface mount components? (ie what pin connect to what?)
September 16th, 2008 at 11:42 pm
Mike the circuit diagram needs to be redone. I will get it up tomorrow.
September 16th, 2008 at 11:50 pm
Fantastic! Thanks!
September 18th, 2008 at 1:42 am
Mike, I’ve added the schematic.
September 18th, 2008 at 5:34 pm
Brilliant! Thank you kindly!
November 10th, 2008 at 8:46 pm
I have a question. I have two stepper motors. They are unipolar. I’m making a board. I need to help with design of board. I want to control it with microcontroller Atmega8. And to communicate with PC via the serial port.
Should I use ULN2803 ?
Thank you.
November 11th, 2008 at 2:50 pm
Hello!
It would be very useful if you post a list with all the components used in this project. Some of us use Eagle which can’t open the .max file.
Thank you.
November 12th, 2008 at 1:09 pm
sloso, you can’t use ULN2803 because the drivers need to be PNP or non-inverting but I’m not saying this is not possible at all, it’s just you’re gonna need to add more components to use ULN2803. so before the ULN you’re gonna need transistors to invert the current outputed by the microcontroller, in standby the mcu has logic 1 on all outputs and when it is runing it outpus logic 0 on the selected output. If the middle windings are connected to Vcc then the drivers needs to non-inverting. If the middle windings are connected to GND then you must use PNP transistors. But you can’t use motors with voltage greater than 5V in the case of PNP transistors as for the other case you can even use motors with 1KV voltage if you have the coresponding transistors
sloso, i talked to morgoth the author and he said he’ll upload a new ROM for you to use with ULN2803
florinx the parts list is coming in a couple of minutes
November 12th, 2008 at 1:21 pm
florinx, the drivers used in the project were LB1836
November 12th, 2008 at 8:25 pm
hi florin,what’s my next steps then?I’ve already got 2 unipolar stepper motors and i have to make my own pcb..What do you suggest?I want to control those motors with atmega8 and communicate with Pc through serial port.
Thank you.
November 12th, 2008 at 11:34 pm
sloso, I’ve uploaded the new schematic, source code and application. You’ll find download links at the end of the article.
and don’t forget to mention the source of the files if you’re making a public project
November 26th, 2008 at 10:22 pm
Hi florin, so I thank you(uploaded schematic). I want to send you my schematic. Can you write me your mail adress, pleace. If you send me your mail, I will send you my schematic. Can you check it, if is it working.
Thank a lot.
November 27th, 2008 at 12:43 pm
you can find my email address at the contact page
December 3rd, 2008 at 10:14 am
Nice project. I am looking to apply this to use old inkjet motors to implement an smt pick and place machine.
Dale
December 3rd, 2008 at 11:49 am
Dale that will take allot of your time, but it will be really nice to see it in action, also I think it will be the first DIY pick and place machine
April 23rd, 2009 at 12:44 am
[...] heart of each CNC machine, and many more automated systems for that matter, is the stepper motor. This motor allows for precise control over the spin of it’s rotor by applying pulses [...]
October 9th, 2010 at 12:01 pm
Quick question: will this schematic work with other programs?
thanks!
October 9th, 2010 at 12:05 pm
Radu, I doubt that. Every software uses its own command list and command interface.
October 9th, 2010 at 12:30 pm
so it won’t help me to build cnc router for using with autocad drawings? i want to build cnc router for milling parts in different materials (wood, paper, aluminium, plastic) using autocad drawings.
October 9th, 2010 at 1:37 pm
Radu your question is too general. but as I’ve said every software uses its own command list and command interface, so the answer is probably not. This project was not designed to be used with any CNC software out there. It was just a proof of concept with a custom software.
October 9th, 2010 at 3:18 pm
well, i’m going to build it, and i’ll post here the results
will this atmega8 support 4 drivers if the hex file is modified?
thanks! Florin
October 9th, 2010 at 4:15 pm
If you know you’re way with ASM you can modify the file to support 4 motors and you can also change the commands it reads from the serialport so you can match it to a certain software.
I can’t help you with that tho, I don’t know any ASM.
October 9th, 2010 at 4:16 pm
i think you have an error in both schematics… the atmega8 uc pin configurations is wrong for vcc and gnd. according to atmega8 datasheet http://www.atmel.com/dyn/resources/prod_documents/2486s.pdf pin3 & pin5 are gnd and pin4 & pin6 are vcc. in your schematics they are switched pin3 & pin5 are vcc and pin4 & pin6 are gnd. please check
thanks!
October 9th, 2010 at 4:23 pm
Yes Radu I’ve checked and you are right. Since I’m not the author of the project, I’ll just write a note next to the download link.
Thanks for pointing that out.
October 9th, 2010 at 4:29 pm
ok!
i was looking at the robotics section, and i saw that awesome BluerRover. Nicely done! I bet you’re student at Politehnica?
October 9th, 2010 at 9:42 pm
Actually I’m not.
I study at Maritime University of Constanta, Faculty of Electronics, Telecommunications and Information Technology.
October 11th, 2010 at 6:01 pm
it didn’t work…. i don’t know why. i used usb to serial for comunication and 8.8mhz instead 8mhz xtall… btw the baud rate for the serial port is 19200..
October 12th, 2010 at 7:23 pm
have you tried it without the usb-to-serial ?
don’t know what else to say to help you cause I’m not the author of this project and I’ve lost contact with morgoth the original author who designed & build this project.
October 12th, 2010 at 9:04 pm
well, i didn’t try it without usb to serial because it doesn’t have any sense… it won’t work stand alone, and i doubt will work on usb?!
October 12th, 2010 at 9:06 pm
Radu, I meant connecting it to the pc directly to a serial port without using a usb to serial adapter.
October 13th, 2010 at 1:32 pm
no, i didn’t try, since i have no serial port to this pc, this is why i used the usb to serial adapter… anyway i have tried using an max232 too between txd/rx & rxd/tx ports, but nothing… i have no clue what’s wrong
October 15th, 2010 at 10:27 am
I was asking that because from my experience those usb to serial adapters can cause problems. For example I have one who only works when connected to a desktop computer USB port. When connected to a laptop USB port its not passing any data. I guess it has something to do with getting less power on the laptop. But if that’s not the case don’t know what else to say.
December 14th, 2011 at 4:12 pm
is there a linux version controller ( input parameter to instruct stepper N , left or right and how many steps and duration and I hope u show us how to do this PLEASE? TX and RX must connect to a max 232 ? I am using atmega 8 ( 28 pins) can I use this chip and match out the connecting pins with 2803 chip?
TIA