ULN2003 Stepper Motor Driver

The ULN2003 Driver lets you control a stepper motor like the 28BYJ-48 which are often sold together.



Start by connecting the motor to the white seat on the board labeled "Motor Connection" in the diagram above. It can only go one way so it's hard to mess up.

Next connect the board to your Arduino. Connect pins 1N1, 1N2, 1N3, and 1N4 to Arduino digital pins 3, 4, 5, and 6. You can of course connect to any digital pins on the Arduino, you'll just have to make sure to pick the correct pin numbers on the node.

Finally connect the board to a power source. You can technically power this board from your Arduino, but the stepper motor will probably try to draw more power than the Arduino can supply so you should power it with a good battery or power supply.

If you have any trouble setting up the hardware
here is a good page with further information.

The node uses the AccellStepper library to control the board.

The node is easy to use, just drag it onto a node screen and change the pin inputs if necessary to match which pins you connected to on your Arduino. Then simply set the number of steps input and fire the Do Steps input trigger to move that many steps. The Moving output goes to 1 when the motor is moving, otherwise it stays at 0. The Move Start and Move Done output triggers fire when the move starts and stops.

Note that the Every Update code calls the stepper motor's run() function, so the refresh rate of the Agent that this node is on has an impact on how fast the motor turns. If you want the motor to move faster you can change the Agent's refresh rate to something higher than the default 32 times per second.

View discussion page on forum

To use this node in your Embrio project, either add it from the Library toolbar or copy the XML in the below box and paste it into a node screen.