Driving a Bipolar Stepper Motor with Arduino and ULN2803AG

30,346

Circuit Image

While preparing to disassemble several broken DVD-RW drives obtained from an eBay seller, the idea arose to create a testing platform for the bipolar stepper motors that would be salvaged from these drives. A collection of ULN2803AG Eight Darlington Transistor Arrays with Common Emitters, leftover from previous projects, is available for use. These arrays can sink peak loads of 600mA (500mA continuous) and are well-suited for powering small motors. However, there is a challenge with 4-wire bipolar stepper motors: the common points of the windings are not wired to the exterior, which is necessary for supplying power to the motors. The ULN2003 datasheet provides additional information about the ICs: ULN2801, 2802, 2803, 2804, and 2805 Darlington Arrays. Despite this limitation, it appears feasible to operate a small bipolar stepper motor by floating the voltage using 22 Ohm resistors connected to the motor supply voltage (the motor featured in the video has 18 Ohm windings, making this the closest resistor value). Initially, the same +5V supplied by the Arduino was used for the motor voltage; however, due to the floating middle point, the maximum voltage across each winding was only 1.7V, which was insufficient to move the rotor. Increasing the motor supply voltage to +9V (using a 9V battery) resulted in successful operation. Although only 4V is present across each winding when energized, it is sufficient to move the linear slide with enough force to carry the laser diode housing. A schematic of the entire setup is provided, along with the Arduino sketch. It is important to note that the resistors should be rated for at least 1/4W; however, 1/8W resistors were used in this project, which became noticeably hot, indicating that this is not a practical solution. A more efficient method for driving a 4-wire bipolar motor would be to utilize quad half-H ICs like the SN754410, which forms the basis of the official Arduino bipolar instructions. However, this approach offers a simpler connection method using ULN chips, which may appeal to hobbyists. Additionally, one ULN2803AG chip can drive two motors, making it a cost-effective solution for controlling 4-wire bipolar steppers. It should be noted that the ULN2003A, another common Darlington Array IC, has 7 arrays instead of 8 and can only drive one stepper motor per IC. Operating a 4-wire bipolar stepper via a ULN2803AG is not efficient, as a significant amount of energy is wasted as heat in the resistors used to float the median voltage point. Nonetheless, if efficiency is not a primary concern, this straightforward connection can be employed with programming that accounts for the different HIGH/LOW levels required to drive the motor in this configuration. When pins 1 and 2 are HIGH, the voltage across winding #1 is effectively zero, disabling that winding to conserve power. This method functions similarly to a logical LOW-LOW configuration, though LOW-LOW would draw current through the respective resistors, which is wasteful.

The circuit utilizes the ULN2803AG Darlington transistor array to drive a 4-wire bipolar stepper motor, which is characterized by its two winding pairs. The ULN2803AG features eight Darlington pairs, allowing for the control of two bipolar stepper motors simultaneously. The motor's windings are connected to the outputs of the ULN2803AG, while the inputs are connected to the Arduino pins, which send control signals.

The resistors used in this circuit are essential for floating the voltage of the windings. When the Arduino sends a HIGH signal to the corresponding pins of the ULN2803AG, it activates the respective Darlington pairs, allowing current to flow through the motor windings. By alternating the signals sent to the motor, the rotor can be made to turn in either direction. The use of 22 Ohm resistors, in this case, is a workaround to provide the necessary voltage levels across the windings; however, care must be taken regarding the power rating of the resistors to prevent overheating.

The Arduino sketch is designed to handle the logic required for driving the motor effectively. It defines pin numbers for various buttons and LEDs, allowing for user input to control the motor's direction and movement. The control logic ensures that the motor operates smoothly, taking into account the necessary HIGH/LOW states to prevent unnecessary power draw when the windings are disabled.

In summary, this circuit demonstrates a creative approach to utilizing the ULN2803AG to drive bipolar stepper motors salvaged from DVD-RW drives, providing a low-cost solution for hobbyists interested in motor control applications.While I`m getting ready to rip open some 10+ broken DVD-RW drives coming to me from an eBay seller, I though it would be great to have a testbed for the bipolar stepper motors I will harvest from those. I have a bunch of ULN2803AG Eight Darlington Transistor Arrays with Common Emitters left from past projects and these can sink (but unfortunately

not source) peak loads of 600mA (500mA continuous) and are well suited for power application like driving small motors. However, there is a problem with 4-wire bipolar stepper motors: they don`t have the common points of windings wired to the outside which would be needed for providing the motors with power.

See the ULN2003 datasheet for more information about the IC: ULN2801, 2802, 2803, 2804 and 2805 Darlington Array datasheet Still, it looked to me that it would still be possible to make a small bipolar stepper work by floating the voltage using some 22 Ohm resistors to the motor supply voltage (motor you see on the video has 18 Ohm windings, so this was the closest resistor value). At first I attempted to use for the motor voltage the same +5V supplied by Arduino but because of the floating middle point the max voltage across each winding was only 1.

7V and that was not enough to move the rotor. When the motor supply voltage was increased to +9V (the 9V battery on the picture), things started working. There is still only 4V across each winding at any time it`s energized but it looks enough to make the linear slide move with some force which I hope will be enough for carrying the laser diode housing.

Here is the schematic of the whole setup and below is the Arduino sketch. Please note that the resistors needed to be at least 1/4W rated but I did not have the 22 Ohm needed for the project and used 1/8W ones. They did get noticeably hot, so it`s not the way to do it in real life. Additionally, a better way to drive a 4-wire bipolar motor would be to use the quad half-H ICs like SN754410 (on which Arduino`s official bipolar instructions are based) but I thought many hobbyists would appreciate a possibility to make things run using a simpler hookup that ULN chips allow.

Also, one $0. 60 ULN2803AG chip can actually drive two motors, so it`s pretty much the cheapest way to drive your 4-way bipolar stepper. Please note that another common Darlington Array IC, ULN2003A (similarly priced) has 7 arrays instead of 8 and therefore can only be used to drive one stepper motor per IC.

Driving your 4-wire bipolar stepper via a ULN2803AG is not efficient because you`re wasting pretty much the same amount of energy on heating the resistors that float the median voltage point as you`re using for rotating the motor`s rotor but if efficiency is not your immediate concern, you can use this simple hookup with a little bit of programming that takes into consideration the different HIGH/LOW levels needed to drive the motor if hooked up this way. When 1 is HIGH and 2 is HIGH, the voltage across winding #1 is considered zero or winding disabled. This is basically done to conserve motor supply power. It works in exact same way as more logical LOW-LOW but LOW-LOW will draw current through the respective resistors simply wasteful.

// Driving a bipolar stepper motor with Arduino and a ULN2803 // Octal High Voltage High Current Darlington Transistor Array // This example code is in the public domain. Based on several // Arduino code samples // // constants won`t change. They`re used here to // set pin numbers: const int buttonPin = 2; // the number of the misc. pushbutton pin const int buttonForwardPin = 6; // the number of the misc. pushbutton pin const int buttonBackwardPin = 7; // the number of the misc. pushbutton pin const int ledPin = 13; // the number of the forward LED pin const int ledForwardPin = 4; // the number of the forward LED pin const int ledBackwardPin = 5; // the number of the backward LED pin const int motorPin1 =8; const int moto

🔗 External reference