ESP8266 stepper motor wiring

I’m sure this has been asked a thousand times but I’m struggling to wire up my ESP8266 to a stepper motor via an ULN2003 driver board.

The code appears to be okay as if I connect the power pin from the ULN to the VV pin on the 8266 it starts moving but it won’t move when connected directly to the VIN port on the board (which should be 5V if my understanding is correct).

I’ve tried connecting an external 5V power supply directly into the ULN with ground between the 8266 and ULN board but still no luck there. Which is what my end case will be setup like.

I’ve tried to put some quick pictures here (let me know if there’s a better online designer for showing this), sorry about the random setup and cable colours!

Any ideas to what’s wrong here?

it won’t move when connected directly to the VIN port on the board (which should be 5V if my understanding is correct).

On most Arduino boards Vin is connected to the input of the 5V regulator so will have no power available when the board is powered through the 5V Vcc pin or by USB. Check the schematic for the board that you have.

A link to the datasheet for the ULN2003 driver board might help.

Image from Original Post so we don't have to download it. See this Simple Image Guide


I can't figure anything about the wiring connections from that photo. You need to make a simple pencil drawing showing the connections with everything labelled and post a photo of the drawing.

directly to the VIN port on the board (which should be 5V

What board are you referring to?

The ESP8266 is a 3.3v device.


Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.,148850.0.html .
Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom.... :slight_smile:

Sorry for the delay but as per above comments here's a simple wiring diagram if it's easier than the pic. Although you might need to refer to the picture to see what I mean when it comes to the power supply board.

Also here's the very basic code just to get it moving.

#include <Stepper.h>

const int stepsPerRevolution = 200;

Stepper myStepper(stepsPerRevolution, D1, D2, D5, D6);

void setup() {

void loop() {

I don't see a ground wire from 5V supply to ULN, 60 RPM is impossible for a 28BYJ-48, start at 5 or 6. A standard 28BYJ-48 is a 32 step per rev motor driving a 64 : 1 gear train, so 2048 steps for 1 rev of output shaft. If you are putting 5V into a 5V regulator, you may not be getting 5V out.
You have the yellow wire connected to the wrong pin on the power supply, connect to the 5V pin on the 8 pin white connector, ground goes on one of the GND pins on same connector.


Thanks for the reply.

"I don't see a ground wire from 5V supply to ULN" - I thought I'd read that ground should be between the 8266 and the ULN2003 boards and in this case not directly to the power board? I'm sure I've tried it straight to the power board with no avail too, along with those 8 pins you've mentioned. I will retry if that's the correct way though.

I grabbed that as example code online but I can try changing it to 5 or 6 as per your comment, will do that tomorrow and report back. Oddly it does start rotating if I connect the ULN power pin directly to the VV pin on the ESP board, although with very little speed and torque so I know the components are at least working.