Arduino IOT Project: Nodemcu ESP8266 wifi Robot Car “L298N motor driver + Blynk + Joystick”

(Last Updated On: September 12, 2020)

Nodemcu ESP8266

Description:

Wifi Robot Car- In today’s tutorial, you will learn how to control a robot car using Arduino,  Nodemcu esp8266 wifi module and Blynk application. The joystick widget will be used to control the Forward…Reverse….right …and left movement..while the slider widget will be used to control the speed of the dc motors in real-time…As this project is based on WIFI, it means this robot car can be controlled from anywhere around the world. For remote controlling, an IP camera can be used for live video streaming. I will make a separate video on how to use the IP cameras.

This is the 5th  version of the Robot Car.while in the 4th version I used an ultrasonic sensor to make a safe distance maintaining robot car. in this project, the speed of the robot car is automatically adjusted depending on the distance between the cars.


While in the 3rd version, I used the flex sensor and the joystick together to control the same robot car, in this project the flex sensor was used as the accelerator and the joystick was used to control the car’s forward, left, right and reverse movement, I named this project a wireless hand gesture + joystick robot car… While in the 2nd version, I used only the joystick to control the speed and movement of the robot Car. The program used in this project was a little bit complex, so that’s why I decided to make another version of this robot and use a separate sensor for the speed controlling. So that’s why I created version 3.

 While in the first version, I used an Android cell phone to control the Robot Car using the HC-05 Bluetooth module.

Today’s tutorial is based on my previous tutorial, in this tutorial, I explained, how to assemble the robot parts and how to use the L298N motor driver to control the forward, left, right and reverse movement. In this tutorial, I also explained how to control the speed of a dc motor using the pulse width modulation. If you are a beginner and you have never used the L298N motor driver then I highly recommend you should first watch this tutorial and then you can resume from here.


The components and tools used in this project can be purchased from Amazon, the components Purchase links are given below:

Arduino Uno:

Mega 2560: 

Robot Car chassis kit:

L298N Dual H-Bridge motor driver:

Nodemcu esp8266 wifi module: Best price 

Other Tools and Components:

Super Starter kit for Beginners

Two Channel / 200 MHz Digital Oscilloscope

Variable Supply:

Digital Multimeter:

Soldering iron kit: “best”

PCB small portable drill machine:

*Please Note: These are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!

wifi robot car Circuit Diagram:

Nodemcu ESP8266

All the connections are exactly the same as explained in the L298N motor driver getting started Tutorial.The only modification is the addition of the Nodemcu esp8266 wifi module. The Nodemcu tx pin is connected with the Arduino’s pin number 2 and the Nodemcu Rx pin is connected with the Arduino’s pin number 3 while the Nodemcu ground pin is connected with the Arduino ground. For the demonstration purchases, I will power the Nodemcu module using my laptop.


wifi robot car Blynk Application:

For the Blynk Application designing watch video tutorial.

wifi robot car Programming:

This project is based on two programs, this program is written for the Arduino while this program is written for the Nodemcu ESP8266 wifi module. First, let’s start with Arduino programming.

Robot Car Arduino programming

 


wifi robot car Nodemcu esp8266 wifi module programming

 

Watch Video Tutorial:

 

Some other Projects based on the Nodemcu and Blynk Application:

IOT 3 Phase Transformer Load monitoring using Arduino and Nodemcu

 

IOT Water Quality monitoring using Arduino,pH Sensor,Nodemcu ESP8266

 

Nodemcu ESP8266 DS18b20 Waterproof Temperature Sensor Monitoring

 

Wireless vibration sensor, iot vibration sensor, Industrial vibration sensor “nodemcu esp8266”

 

Esp8266 Iot battery monitor, battery voltage monitoring using nodemcu esp8266 wifi module

 

Recommended For You

About the Author: Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

3 Comments

  1. There’s an error occurred to me while uploading the code. How to fix this error:

    Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: “NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200”

    In file included from C:\Users\user\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkApi.h:17:0,

    C:\Users\user\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkTimer.h:36:21: error: redefinition of ‘class BlynkTimer’

    #define SimpleTimer BlynkTimer

    C:\Users\user\Documents\Arduino\libraries\SimpleTimer/SimpleTimer.h:10:7: note: in expansion of macro ‘SimpleTimer’

    class SimpleTimer {

    C:\Users\user\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkTimer.h:36:21: error: previous definition of ‘class BlynkTimer’

    #define SimpleTimer BlynkTimer

    C:\Users\user\Documents\Arduino\libraries\Blynk\src/Blynk/BlynkTimer.h:41:7: note: in expansion of macro ‘SimpleTimer’

    class SimpleTimer {

    exit status 1
    Error compiling for board NodeMCU 1.0 (ESP-12E Module).

    This report would have more information with
    “Show verbose output during compilation”
    option enabled in File -> Preferences.

    1. //SEE THE BOTTEM FOR INFO

      #ifndef BLYNKTIMER_H
      #define BLYNKTIMER_H

      #include <Blynk/BlynkDebug.h>

      // Replace SimpleTimer
      #define SIMPLETIMER_H
      #define SimpleTimer BlynkTimer

      typedef void (timer_callback)(void);
      typedef void (
      timer_callback_p)(void *);

      class SimpleTimer {

      public:
      // maximum number of timers
      const static int MAX_TIMERS = 16;

      private:
      // deferred call constants
      const static int DEFCALL_DONTRUN = 0; // don’t call the callback function
      const static int DEFCALL_RUNONLY = 1; // call the callback function but don’t delete the timer
      const static int DEFCALL_RUNANDDEL = 2; // call the callback function and delete the timer

      };

      #endif

      // copy this code to notepad and save as BlynkTimer.h (Remember The Save Location) then erase #include<SimpleTimer.h> in the coding .. Then type(in the code)
      // #include
      //Then #define SimpleTimer BlynkTimer in the code
      //Thank You

  2. #ifndef BLYNKTIMER_H
    #define BLYNKTIMER_H

    #include <Blynk/BlynkDebug.h>

    // Replace SimpleTimer
    #define SIMPLETIMER_H
    #define SimpleTimer BlynkTimer

    typedef void (timer_callback)(void);
    typedef void (
    timer_callback_p)(void *);

    class SimpleTimer {

    public:
    // maximum number of timers
    const static int MAX_TIMERS = 16;

    private:
    // deferred call constants
    const static int DEFCALL_DONTRUN = 0; // don’t call the callback function
    const static int DEFCALL_RUNONLY = 1; // call the callback function but don’t delete the timer
    const static int DEFCALL_RUNANDDEL = 2; // call the callback function and delete the timer

    };

    #endif

Leave a Reply