-->
Page 1 of 3

[SOLVED] Need Sketch to control 28BYJ-48 stepper w/NodeMCU

PostPosted: Sat Dec 15, 2018 9:14 pm
by JoeVanGeaux
I would like a sample of a working Arduino-like sketch and guidance on pin connections that will permit a demonstration that my 28BYJ-48 Unipolar stepper can be driven by a ULN2003 driver through my NodeMCU ESP8266-12E LoLin V3 dev board. So far, all I got it to do was to blink an LED (to verify proper board connections and for me to experience the process of flashing the board via the Arduino IDE).

I am attaching a photo of my setup which, hopefully, shows the connections (mostly the output pins on the NodeMCU and the input on the ULN2003 driver).

In the setup, the NodeMCU is being powered by 3.3v and the stepper is being powered by 5v. I am only using the micro USB to my PC to flash the ESP8266 ( I want it to run on its own after flashing. NO WiFi for the moment!!). I am using Arduino IDE v 1.6.7 (later versions didn't work for some reason - and that could be by some mistake I made, of course.)

What I would like help with is which pins on the dev board should be hooked to which pins on the driver board AND a sample of some bare bones Arduio-like code that will make the stepper move in some controlled fashion in a stand-alone mode. The numerous examples I tried from the 'net all have some difference that is causing me the world of confusion - possibly due to something ordinarily considered a 'no brainer'.

I would be appreciative of any help to clear up what shouldn't be such a mystery!

Re: Need Sketch to control 28BYJ-48 stepper w/NodeMCU 12E

PostPosted: Sun Dec 16, 2018 8:26 am
by rudy
Take a look at this. https://www.electronicwings.com/nodemcu ... th-nodemcu

It is pretty cude but it should get your motor turning.

This looks like a better next step. You will need to reassign the port pins. I didn't look too closely at it though. https://42bots.com/tutorials/28byj-48-s ... duino-uno/

Re: Need Sketch to control 28BYJ-48 stepper w/NodeMCU 12E

PostPosted: Sun Dec 16, 2018 1:25 pm
by JoeVanGeaux
rudy wrote:Take a look at this. https://www.electronicwings.com/nodemcu ... th-nodemcu

It is pretty cude but it should get your motor turning.

This looks like a better next step. You will need to reassign the port pins. I didn't look too closely at it though. https://42bots.com/tutorials/28byj-48-s ... duino-uno/


Thanks for the reply, but I tried that first one a few days ago and it didn't move the stepper. It flashed okay and all that but nothing happened afterwards. Is there some sort of "Run" command or procedure I am missing? I didn't need to do anything to make that LED immediately start blinking so I wouldn't think this is any different.

For the second example, I saw (and attempted) that one, too. However, I may have scrambled the pin assignments but won't ever know what, or if, I did something wrong until I get it to work! lol Plus, I may have made changes to how the sketch references the newly assigned pins, so maybe some guidance there?

You guys on this site have the best guidance I've come across, so far, so I'm hoping with your help to get passed this, seemingly trivial, hurdle so I can start doing something useful. I bought three of these NodeMCU boards so I can only afford to permanently brick two!!

Re: Need Sketch to control 28BYJ-48 stepper w/NodeMCU 12E

PostPosted: Sun Dec 16, 2018 3:14 pm
by JoeVanGeaux
rudy wrote:Take a look at this. https://www.electronicwings.com/nodemcu ... th-nodemcu

It is pretty cude but it should get your motor turning.

This looks like a better next step. You will need to reassign the port pins. I didn't look too closely at it though. https://42bots.com/tutorials/28byj-48-s ... duino-uno/
rudy wrote:Take a look at this. https://www.electronicwings.com/nodemcu ... th-nodemcu

It is pretty cude but it should get your motor turning.

This looks like a better next step. You will need to reassign the port pins. I didn't look too closely at it though. https://42bots.com/tutorials/28byj-48-s ... duino-uno/


Thanks for the reply, Rudy! (I don't see a "Thanks!" button anywhere.)

I'm not sure if there will be multiple replies from me. I can't figure out if my earlier reply is getting processed or if it ever got "submitted"... so apologies for the clutter! [Admins: You are perfectly welcome to delete any duplicates or trim the fat if necessary!]

To summarize, I tried those sketches suggested already and nothing moves the motor. I don't know if I'm screwing up on a very basic level or not. So any stepwise guidance on the pinout in my photo and the proper code references to those pins (within some sample known working sketch) would send me on my way to doing something useful with these boards!

Extra details: My board came with "LUA" (which I don't really intend to use and basically ignored to this point) and all I did was add a driver for the ULN2003 to the Arduino IDE and flashed the suggested sketches from the Arduino IDE using the 8266 board option.