[SOLVED] Best blynk board with WiFi and 5v GPIO?

I’ve got an army of ESP8266 (nodeMCUs) running blynk in my house right now, however for my latest project I think I need 5v GPIO for getting steppers to work right. I’m wondering if you guys have a suggestion for a good compatible board with wifi and 5v GPIO.

As for getting steppers working with the NodeMCU… I’m open to suggestions, but I have broken two nodeMCUs trying to get them working with the stepper and shield combo, and I can get it to work perfectly on my Arduino Uno (without blynk).

First, how exactly are you physically wiring your ESPs to a stepper?

You need to be going through some form of a motor controller, and since most of them will receive 3.3v control signals just fine (and don’t send any data back to the ESP anyhow) then you should be in no danger of damaging your ESP, even if your steppers have much higher voltage/current requirements.

@taitrt AFAIK all ESP boards are 3.3V so as pointed out by @Gunner it’s just a case of buying the right controller.

We would recommend genuine WeMos products, either the D1 or D1 Mini Pro depending on your specific project. They are normally plug and play boards for Blynk.

WeMos also sell the motor controllers and I think there were problems with the first ones they made but I believe they have all been ironed out now.

@Gunner They are going through a motor controller. I have Vin and Gnd going to the 5v power supply of the motor controller, and then the 4 stepper wires going to D5, D6, D7, D8 (into the motor controller also). I’m powering via a USB to the computer. The ESPs are giving a rst err cause 2… which seems to be something related to insufficient power. Even after disconnecting everything and having just the ESP plugged in it still causes the same reset boot loop…

At first I thought it might have just been a bad NodeMCU, but I did the same thing to another one with identical results.

@taitrt do you have a link to controller you are using?

Huh, the plot thickens: It seems the problem is actually with the stepper.h library, when I remove it the reset loop goes away. I need to do more testing.

Replying to myself here: The problem turns out to be that on an ESP8266 there is a maximum number of steps that you are allowed to issue at the same time. The motors I was using are geared heavily and have 2048 steps per revolution. When I try to send a single revolution with mystepper.step(2048) it causes the ESP8266 to reboot after about 200 steps, if I issue a smaller number like mystepper.step(512) it appears to work without issue. The arduino uno does not have this same limitation. Odd.

You are probably drawing too much current from the USB.

You MUST power the motor controller from a dedicated power supply that can source up to 12v at around 1amp or better. That is the whole purpose of the separate controller, to control something that requires higher voltage and current then the MCU or USB can source. And to an extent, protect the MCU from “flyback” surges caused by discharging motor windings.

The only wired connection between the MCU and controller should be a shared GROUND and whatever control pins it needs, Typically IN1, IN2, IN3, IN4, etc

Yeah, I’m aware of the need to power motor controllers separately, I was just prototyping and cutting a few corners for testing.

Oddly enough, the too many steps problem persists with a separate power supply, and even still happens without any motor controller hooked up at all (program running, but no wires connected).

That will be something in the coding then.

That is because ESP’s have 1 to 6 second software and hardware WDT’s that must be fed when you are spending all that time stepping.

ESP.wdtFeed(); will increase the 1s to around 3s but you must keep feeding the WDT and improve your coding.

Arduino’s don’t have these issues as they are dumb MCU’s i.e. no WiFi to think about.

Off topic, adding WiFi doesn’t make something smarter… just look at all those idiots driving around with their phone stuck to their ear :wink:

On topic… as I am a bit new to the ESP (and only using mine as a WiFi adapter for now) by “feeding” the WDT in Blynk’s case, do you mean simply keeping Blynk.run() from being blocked for more than a few seconds?

No, it’s ESP specific not Blynk related. Stepping is a blocking routine, block an ESP for a “few” seconds and it will reset.

You will see articles on GitHub that state without coding intervention that setup() must be completed within 1s and the maximum blocking time is something like 2.6s. Most setup() routines automatically include feeding the WDT e.g. within WiFi connections etc.


will all feed the WDT but improving your code is the best way to go. So see how long the steps take, step for < 1s, feed WDT and step some more etc.

Another interesting note: I got a NodeMCU ESP32 delivered today, I loaded it with the identical code and it works flawlessly (just like the arduino does). ESP8266s are amazing, but they do strange stuff sometimes.

Ahh OK, now I remember watching a video covering the “separate” WiFi layer of the ESP8266 and how it would disconnect if ignored… I guess that is what “feeding the WDT” is referring to. And how the ESP32 was to have an “improved” interaction and eliminating much of those issues.

Oh, well… I need to learn the ESP8266 before jumping to another “don’t have” MCU :wink:

I have mentioned in the past to others asking about steppers… you could try to offset the stepper control to an Arduino (not running Blynk) linked to an ESP (running Blynk) via I2C or even serial, then just pass target data from the ESP to the Arduino for it to process and command the controller.