Back to home
Back to MDC home
Stepper motor driver for colorwheel For a general explanation of what MDC is, see the main page MDC

The device described here is a small stepper driver that could be used with smaller types of stepper motors that pull a maximum of 500mA per coil when active.
A lot of lighting devices use these steppers for instance to turn a colorwheel or a small mirror. They are not fast, but do get the job done.
If a bigger NEMA stepper is used, a larger driver is needed and this is not the stepper driver you are looking for..
What does it do? This device simply takes 1 channel to control a stepper motor. This can be any motor really, as long as the correct pins are set in the code.
The code presented here is aimed at a colorwheel with 9 positions on it (0 = blank, 1 - 8 are different colors).
It is however easy to understand what is going on and changes to suit other needs should not be hard.
Hardware The hardware can be anything that can drive a stepper. This ranges from a simple driver like the ULN2003 chip or a complete heavy duty controller specially made for the stepper you are using.
There really is no limit to this, or the size of the stepper, as long as you take care it is driven correct and nothing weird can happen when there is a loss of signal.
When using larger steppers, it is adviseable to provide a power supply specially for driving the stepper motor instead of only relying on the power provider by the MDC signal. For smaller steppers (say: up to 12V 1A per coil) this shouldn't be a problem though.

The device itself is based on the default client hardware. The circuit is displayed below. All free ports are available for driving the stepper motor(s).



As is visible, there are ports enough on the arduino and on the uln2803 to attach a second stepper motor, but here only one is used.
Code There are actually 2 parts to the code when using it as is to drive a colorwheel.

Programmer code
First is the 'programmer'.
This is used to set the exact number of steps for each color on the wheel. Some wheels have small deviations from a uniform division, so the number of steps micht differ a little bit.
The code lets you do just that: go through all positions and alter the steps by keyboard input.
Once done, it is able to save the settings in EEPROM for later use in the running code.
Please check the code comments in the ino file, they will show how to use the code and the commands to set the correct steps etc.

Download the code: setsteps.ino

Running code
This code is loaded in the arduino and stays there. It uses the stored setting of the programmer code so the steps are correct.
There are 2 versions of the code. They both serve their purpose:
Ofcourse, both can be programmed by holding the pushbutton for around 3 seconds, then moving the channel on the controller you want to assign it.
After some changes have been detected, the channel is set and stored in eeprom.