To Control Dc motor Direction without internet using esp8266/nodemcu, motor shield,audrino

Need help i want to connect a dc motor with android using audrino and esp8266 wifishield or nodemcu,motor shield without using internet i am a beginner.i just want to control the direction of motor i.e clockwise and anticlockwise with android please post the code and connection too if possible.
Thanks in advance :slightly_smiling_face:

A couple of pointers…

Blynk is predominantly an IoT application… That stands for Internet of Things… emphasis on the word INTERNET :stuck_out_tongue_winking_eye:

That said, it is possible to have a Blynk interface running on a Local Server with total internal networking… but for that to work, you need your Local Server to also act as a Wireless AP and you connect your phone to it, not to whatever service you normally use.

This is not beginner level stuff and there is no drop-in code to offer… Like transitioning from walking to driving to flying, you need to start at the ground level and work your way up :wink:

So first…

  • Have you been able to control the motor with “normal” Arduino/C++ code? This is a must, as Blynk will not directly control your motor, only pass on commands from the App to whatever motor controlling code/hardware you already have.

  • Have you been able to use Blynk, with normal Cloud Server, for anything? - This is a requirement to start learning how Blynk works before trying to merge it with pre-existing code… let alone a fully independent AP/Server.

If you have all that prior experience and code under your belt… then you can search this forum for a topic or topics of setting up something like a RPi Zero W as a full AP/Blynk Server.

We can assist with any Blynk related questions as you learn. Happy Blynking :smiley:

In addition to what @Gunner has written, I can tell you, that to control DC motor you need some kind of driver. It can be a ready, prebuilt module (just look for Arduino motor driver, or even L298 module which is one of them) or it can be made using 4 relays properly connected. In either way you need 2 control pins (as you need three states - stop, turn clockwise, turn counterclockwise)

At least the OP seems to understand that… I think :stuck_out_tongue:

i have done motor direction control the basic stuff using motor shield,audrino and there is no resitriction in using the cloud(internet) but i am a little bit confused that does it require a router to connect to esp8266 and then to my android device which is a constraint for me. if you have a example code for dc motor control using blynk please post it.i will sort something out or some resource i will appreciate it very much. kinda stuck here.please help

As I already said… Blynk does NOT directly control your motors, it can only control the digital pins on the ESP8266… but both the ESP (running Blynk library and some code) and your phone (running the Blynk App), need internet access to do so as they both need to communicate to a Blynk Server. (There are Local Server option, but it is advanced user level… start with the Cloud Server)

So, if you have functional Motor controller and code for it, and know what pins need to do what in order to drive a motor, then you can use Blynk to do the same thing.

There are many existing topics with examples of sketches controlling motors, robots, etc in this forum… a little searching will go a long way. Try keywords like Motor, Robot, Rover, Car, etc.

2 Likes

if your phone can create hotspot AP so you will not need a dedicated router