I built this to drive the stepper motor on a telescope mount. The requirement was for an accurate 12rpm that would make the telescope mount rotate to counter the earth’s rotation. The mount had a motor and gears installed but the commercial electronic ‘tracker’ was hugely more expensive than the system here. I tried to write the code in a way that could be easily modified for other speeds, and could be used as a starting point for more complicated systems. The ‘rpm = 12;’ line is right at the start so in many cases you will just need to change this number. It should work on most Ardunio boards. I started on a Uno and then went for a Nano for the final unit. It is set up for an Arduino with crystal frequency of 16Mhz and hence will need the timer pre-scaler code adjusting for other frequencies.
You will need:
· Arduino, e.g. Uno or Nano
· EasyDriver board
· Power supply – 4 AA batteries used here
· Stepper motor
The EasyDriver board takes a lot of hard work out of the Ardunio. It just needs two inputs – direction and step. It can be setup for single, half or ¼ or 1/8 microstepping with the latter being the default. It can drive up to 700ma per phase, up to 30v. I wanted the extra torque of the half step mode and hence set it up for this. Although designed for two bipolar windings it can also drive unipolar motors by ignoring the middle tap in each winding. In some cases the middle taps of the two windings are connected (as was the case here). If so this connection has to be removed. In this case it just required a cut in a track on the motor connection PCB.
· On EasyDriver board – EN2 to GND (next to +5V) (to set half stepping)
· Positive supply to EasyDriver M+ PWR IN and wire from here to Vin on the Nano
· Negative supply to EasyDriver GND PWR IN
· Three wires from EasyDriver GND, STEP, DIR to the Arduino GND, D12 and D11 respectively.
Check using the wire colours and photos above.
I found that 6v was enough for the stepper motor. If you need to go higher check the voltage regulator chips on both boards to make sure they don’t get too hot.