DIY

WIFI controlled car

Auto with WIFI control  Car with WIFI control In this article, a DIY master will tell us how to make a WiFi remote control car. Such a car can be controlled via a smartphone. The ESP8266 module is used as a microcontroller in this assembly. This module has a MicroUSB port, and operates from a voltage of 7-12 V.
Tools and materials:
-Printing board;
-ESP8266-12E module (NodeMCU); – L293D motor driver chip – 2 pcs.
– DC motor with gearbox – 4 pcs; – 7805 regulator; – Battery compartment; – Batteries; – Capacitor 100 μF/25 V – 4 pcs; – Ceramic capacitor 100 nF – 2 pcs; – Pin connector; -2-pin screw connectors – 5 pcs; -Wheels – 4 pcs; -Switch; -Acryl; -Soldering iron; -Drill; -Wires;
Step one: printed circuit board
This device requires a printed circuit board. The board can be ordered by following this link.
 Cars with WIFI control Step two: mounting the board
After receiving the board, the master mounts it.
 Cars with WIFI control Mounts connectors and capacitors. Installs the L293D motor driver IC. The L293D is a popular 16-pin motor driver IC. One L293D chip is capable of driving two DC motors at the same time, the direction of these two motors can be controlled independently. The master uses two microcircuits for four engines.
 Cars with WIFI control Cars with WIFI control Car with WIFI control Car with WIFI control Step three: code
Now you need to download the code. The master connects the NodeMCU microcontroller to the PC. Opens the Arduino IDE.
Then go to Tools & gt; Fee & gt; ESP8266 Boards & gt; NodeMCU 1.0 (ESP-12E module).
Selects the correct port. Then it loads the code. The code can be downloaded below.

 //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 & lt; ESP8266WiFi .h & gt; #include & lt; WiFiClient.h & gt; #include & lt; ESP8266WebServer.h & gt; String command; //String to store app command state. int speedCar = 800; //400 - 1023. int speed_Coeff = 3; const char * ssid = & # 34; NodeMCU Car & # 34 ;; ESP8266WebServer server (80); void setup () & # 123; 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 (& # 34; AP IP address & # 58; & # 34;); Serial.println (myIP); //Starting WEB-server server.on (& # 34;/& # 34 ;, HTTP_handleRoot); server.onNotFound (HTTP_handleRoot); server.begin (); } void goAhead () & # 123; digitalWrite (IN_1, LOW); digitalWrite (IN_2, HIGH); analogWrite (ENA, speedCar); digitalWrite (IN_3, LOW); digitalWrite (IN_4, HIGH); analogWrite (ENB, speedCar); } void goBack () & # 123; digitalWrite (IN_1, HIGH); digitalWrite (IN_2, LOW); analogWrite (ENA, speedCar); digitalWrite (IN_3, HIGH); digitalWrite (IN_4, LOW); analogWrite (ENB, speedCar); } void goRight () & # 123; digitalWrite (IN_1, HIGH); digitalWrite (IN_2, LOW); analogWrite (ENA, speedCar); digitalWrite (IN_3, LOW); digitalWrite (IN_4, HIGH); analogWrite (ENB, speedCar); } void goLeft () & # 123; digitalWrite (IN_1, LOW); digitalWrite (IN_2, HIGH); analogWrite (ENA, speedCar); digitalWrite (IN_3, HIGH); digitalWrite (IN_4, LOW); analogWrite (ENB, speedCar); } void goAheadRight () & # 123; 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 () & # 123; 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 () & # 123; 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 () & # 123; 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 () & # 123; digitalWrite (IN_1, LOW); digitalWrite (IN_2, LOW); analogWrite (ENA, speedCar); digitalWrite (IN_3, LOW); digitalWrite (IN_4, LOW); analogWrite (ENB, speedCar); } void loop () & # 123; server.handleClient (); command = server.arg (& # 34; State & # 34;); if (command == & # 34; F & # 34;) goAhead (); else if (command == & # 34; B & # 34;) goBack (); else if (command == & # 34; L & # 34;) goLeft (); else if (command == & # 34; R & # 34;) goRight (); else if (command == & # 34; I & # 34;) goAheadRight (); else if (command == & # 34; G & # 34;) goAheadLeft (); else if (command == & # 34; J & # 34;) goBackRight (); else if (command == & # 34; H & # 34;) goBackLeft (); else if (command == & # 34; 0 & # 34;) speedCar = 400; else if (command == & # 34; 1 & # 34;) speedCar = 470; else if (command == & # 34; 2 & # 34;) speedCar = 540; else if (command == & # 34; 3 & # 34;) speedCar = 610; else if (command == & # 34; 4 & # 34;) speedCar = 680; else if (command == & # 34; 5 & # 34;) speedCar = 750; else if (command == & # 34; 6 & # 34;) speedCar = 820; else if (command == & # 34; 7 & # 34;) speedCar = 890; else if (command == & # 34; 8 & # 34;) speedCar = 960; else if (command == & # 34; 9 & # 34;) speedCar = 1023; else if (command == & # 34; S & # 34;) stopRobot (); } void HTTP_handleRoot (void) & # 123; if (server.hasArg (& # 34; State & # 34;)) & # 123; Serial.println (server.arg (& # 34; State & # 34;)); } server.send (200, & # 34; text/html & # 34 ;, & # 34; & # 34;); delay (1); }  

Cars with WIFI control Car with WIFI control Cars with WIFI control Auto with WIFI control After downloading the code, installs the microcontroller on the board.
Cars with WIFI control Auto with WIFI control  Car with WIFI control Step Four: Assembling
Now you can assemble the car. The master made the chassis from acrylic sheet. Cut the sheet to size. Drilled all the necessary holes. Attached the engines to the chassis. The battery is attached between the engine. I installed a switch.
Wheels are installed on the axle of gearmotors.
Cars with WIFI control Car with WIFI control  Car with WIFI control Auto with WIFI control Attaches the board to the chassis.
 Cars with WIFI control Auto with WIFI control Makes connections. There are only five 2-pin connectors on the PCB, one of them is the input (from the battery), and the rest is the output to the geared motor.
Cars with WIFI control Car with WIFI control Cars with WIFI control Car with WIFI control Step five: application
Now you need to install the application on your smartphone.
Includes food for the car.
Cars with WIFI control Next you need to download and install the ESP8266 WIFI ROBOT CAR application on your smartphone.
Turn on Wi-Fi on your smartphone. Makes pairing with Nodemcu Car.
Opens the ESP8266 WIFI ROBOT CAR application.
Cars with WIFI control Car with WIFI control Cars with WIFI control Car with WIFI control  Car with WIFI control Everything is now ready. The car is controlled using the application previously downloaded to the smartphone.
Cars with WIFI control  Car with WIFI control Auto with WIFI control In the video below you can watch the complete assembly of this car, as well as a demonstration of its work.

Source:

usamodelkina.ru

Show More

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button