How to Make a WIFI (Nodemcu) Car

by Pro Maker_101 in Circuits > Wireless

5465 Views, 26 Favorites, 0 Comments

How to Make a WIFI (Nodemcu) Car

How To Make A WIFI Controlled Car | PCBWay

Today we are going to make an esp8266 smart car. This WiFi remote control car runs with ESP8266 module (NodeMCU).This NodeMCU comes with MicroUSB port and also can be operated with 7-12Volt. You can also program it with Arduino IDE (software). So that's it, let's get started!

COMPONENTS REQUIRED

  • PCB

  • ESP8266-12E Module ( NodeMCU)

  • L293D Motor Driver IC - 2 Nos

  • DC Gear Motor - 4 Nos

  • 7805 regulator IC

  • Battery 7-12V

  • 100uF/25V Capacitor - 4 Nos

  • 100nF Ceramic Capacitor - 2 Nos

  • Female Header Pins

  • 2 Pin Screw Connectors - 5 Nos

  • Wheel - 4 Nos

  • Switch

TOOLS NEEDED

  • Soldering Iron
  • Soldering Wire
  • Flux

PCB

Logopit_1617965650549.jpg

Therefore, case you want your own PCB, you can obtain through this link on PCBWay.com. You can also order good quality PCBS from PCBWay.com at low cost. In addition to the standard pcbs, we could also support advanced Pcbs, FPC/rigid -flex Pcbs, rapid-rpototyping and other related services that could meet your needs to the most extent.

PCB order steps on PCBWay:

  • Visit the website: www.pcbway.com
  • Click PCB Instant QuoteClick
  • quick-order PCB Upload the gerber file by clicking "+Add Gerber File" and wait until the gerber file is finished
  • uploading Set the PCB specifications as you wish, starting from the number of PCBs, the number of layers, thickness, color and others.
  • After that, look at the left, it will display the estimated cost
  • processing time and delivery service selected
  • Click Save to cart

ASSEMBLING COMPONENTS ON PCB

Screenshot (155).png

Connect the components to the PCB

We are using capacitors here to get proper output..

Screenshot (187).png
Screenshot (157).png
Screenshot (159).png

Insert L293D Motor Driver IC in to IC Socket. The L293D is a popular 16-Pin Motor Driver IC.A single L293D IC is capable of running two DC motors at the same time; also the direction of these two motors can be controlled independently. We are using two IC for four motors. The IC works on the principle of Half H-Bridge...

UPLOAD CODE ON NodeMCU

Screenshot (161).png
Screenshot (1).png
Screenshot (154).png
Screenshot (153).png
  • Connect NodeMCU on PC
  • Open Arduino IDE (Software)
  • Then Go To Tools>Board>ESP8266 Boards> NodeMCU 1.0 (ESP-12E Module)
  • Select Correct Port
  • Then Upload Code Below

CODE

// NodeMCU Based WIFI Controlled Car//

#define ENA   14          // Enable/speed motors Right        GPIO14(D5)
#define ENB   12          // Enable/speed motors Left         GPIO12(D6)
#define IN_1  15          // L298N in1 motors Right           GPIO15(D8)
#define IN_2  13          // L298N in2 motors Right           GPIO13(D7)
#define IN_3  2           // L298N in3 motors Left            GPIO2(D4)
#define IN_4  0           // L298N in4 motors Left            GPIO0(D3)

#include <ESP8266WiFi.h>
#include <WiFiClient.h> 
#include <ESP8266WebServer.h>

String command;             //String to store app command state.
int speedCar = 800;         // 400 - 1023.
int speed_Coeff = 3;

const char* ssid = "NodeMCU Car";
ESP8266WebServer server(80);

void setup() {
 
 pinMode(ENA, OUTPUT);
 pinMode(ENB, OUTPUT);  
 pinMode(IN_1, OUTPUT);
 pinMode(IN_2, OUTPUT);
 pinMode(IN_3, OUTPUT);
 pinMode(IN_4, OUTPUT); 
  
  Serial.begin(115200);
 
// Connecting WiFi

  WiFi.mode(WIFI_AP);
  WiFi.softAP(ssid);
  IPAddress myIP = WiFi.softAPIP();
  Serial.print("AP IP address: ");
  Serial.println(myIP);
 
 // Starting WEB-server 
     server.on ( "/", HTTP_handleRoot );
     server.onNotFound ( HTTP_handleRoot );
     server.begin();    
}

void goAhead(){ 

      digitalWrite(IN_1, LOW);
      digitalWrite(IN_2, HIGH);
      analogWrite(ENA, speedCar);

      digitalWrite(IN_3, LOW);
      digitalWrite(IN_4, HIGH);
      analogWrite(ENB, speedCar);
  }

void goBack(){ 

      digitalWrite(IN_1, HIGH);
      digitalWrite(IN_2, LOW);
      analogWrite(ENA, speedCar);

      digitalWrite(IN_3, HIGH);
      digitalWrite(IN_4, LOW);
      analogWrite(ENB, speedCar);
  }

void goRight(){ 

      digitalWrite(IN_1, HIGH);
      digitalWrite(IN_2, LOW);
      analogWrite(ENA, speedCar);

      digitalWrite(IN_3, LOW);
      digitalWrite(IN_4, HIGH);
      analogWrite(ENB, speedCar);
  }

void goLeft(){

      digitalWrite(IN_1, LOW);
      digitalWrite(IN_2, HIGH);
      analogWrite(ENA, speedCar);

      digitalWrite(IN_3, HIGH);
      digitalWrite(IN_4, LOW);
      analogWrite(ENB, speedCar);
  }

void goAheadRight(){
      
      digitalWrite(IN_1, HIGH);
      digitalWrite(IN_2, LOW);
      analogWrite(ENA, speedCar/speed_Coeff);
 
      digitalWrite(IN_3, LOW);
      digitalWrite(IN_4, HIGH);
      analogWrite(ENB, speedCar);
   }

void goAheadLeft(){
      
      digitalWrite(IN_1, LOW);
      digitalWrite(IN_2, HIGH);
      analogWrite(ENA, speedCar);

      digitalWrite(IN_3, HIGH);
      digitalWrite(IN_4, LOW);
      analogWrite(ENB, speedCar/speed_Coeff);
  }

void goBackRight(){ 

      digitalWrite(IN_1, LOW);
      digitalWrite(IN_2, HIGH);
      analogWrite(ENA, speedCar/speed_Coeff);

      digitalWrite(IN_3, HIGH);
      digitalWrite(IN_4, LOW);
      analogWrite(ENB, speedCar);
  }

void goBackLeft(){ 

      digitalWrite(IN_1, HIGH);
      digitalWrite(IN_2, LOW);
      analogWrite(ENA, speedCar);

      digitalWrite(IN_3, LOW);
      digitalWrite(IN_4, HIGH);
      analogWrite(ENB, speedCar/speed_Coeff);
  }

void stopRobot(){  

      digitalWrite(IN_1, LOW);
      digitalWrite(IN_2, LOW);
      analogWrite(ENA, speedCar);

      digitalWrite(IN_3, LOW);
      digitalWrite(IN_4, LOW);
      analogWrite(ENB, speedCar);
 }

void loop() {
    server.handleClient();
    
      command = server.arg("State");
      if (command == "F") goAhead();
      else if (command == "B") goBack();
      else if (command == "L") goLeft();
      else if (command == "R") goRight();
      else if (command == "I") goAheadRight();
      else if (command == "G") goAheadLeft();
      else if (command == "J") goBackRight();
      else if (command == "H") goBackLeft();
      else if (command == "0") speedCar = 400;
      else if (command == "1") speedCar = 470;
      else if (command == "2") speedCar = 540;
      else if (command == "3") speedCar = 610;
      else if (command == "4") speedCar = 680;
      else if (command == "5") speedCar = 750;
      else if (command == "6") speedCar = 820;
      else if (command == "7") speedCar = 890;
      else if (command == "8") speedCar = 960;
      else if (command == "9") speedCar = 1023;
      else if (command == "S") stopRobot();
}

void HTTP_handleRoot(void) {

if( server.hasArg("State") ){
       Serial.println(server.arg("State"));
  }
  server.send ( 200, "text/html", "" );
  delay(1);
}

SCHEMATIC DIAGRAM

Screenshot (186).png

Screenshot (160).png
Screenshot (163).png
Screenshot (164).png

After uploading the code, set NodeMCU to PCB. With this, our PCB work is completed...

CHASSIS

photo_2021-04-19_14-13-57.jpg
Screenshot (165).png
Screenshot (166).png
Screenshot (167).png

Here, I have made CHASSIS using acrylic sheet .If you need it, you can buy the CHASSIS kit from the online store...What I have done here is cut the acrylic sheet to 14CM x 8 CM size and set the 4 gear motor on the 4 side. There is a battery in the middle of the 2 acrylic sheets and a switch to turn it on and off .All gear motor wires have been taken out.

PLACE THE PCB ON TOP OF THE ACRYLIC SHEET

Screenshot (168).png
Screenshot (180).png

You can see it here, PCB board is set on an acrylic sheet using 4 screw..

WIRING

Screenshot (170).png
Screenshot (171).png
Screenshot (172).png
Screenshot (173).png

Then set all the wires of the gear motor in the 2 pin connector on the PCB .The PCB has a total of five 2 pin connectors, One of them is the battery input and the rest is the output of the gear motor..

TURN ON THE SUPPLY WITH THE SWITCH

Screenshot (174).png

APP INSTALLATION

Screenshot (175).png
Screenshot (176).png
Screenshot (177).png
Screenshot (181).png
Screenshot (184).png

  1. Download ESP8266 WIFI ROBOT CAR
  2. Open wifi
  3. Search and connect Nodemcu Car
  4. Open ESP8266 WIFI ROBOT CAR

WORKING

Screenshot (183).png
Screenshot (178).png
Screenshot (179).png

Watch video (Click here)

With this, your NodeMCU car is ready.

THANK YOU!