POLITEKNIK MERLIMAU MELAKA JABATAN KEJURUTERAAN ELEKTRIK D E C 5 0 1 3 2 – INTERNET BASED CONTROLLER RC CAR PROJECT E-BOOK MUHAMMAD FIKRUL RAZIN BIN MOHD YUSUF (14DTK21F1047) ADAM ISKANDAR BIN ZULFADLI (14DTK21F1057)
CONTENT INTRODUCTION OBJECTIVE METHODOLOGY -HARDWARE -SOFTWARE -COMPONENT & TOOLS PROCEDURE RC CAR VIEW CIRCUIT DIAGRAM SOURCE CODE 1 2 4 7 9 10 11
INTRODUCTION The IoT-enabled RC Car Mini Project brings together the immense potential of the Internet of Things (IoT) and the joyous thrill of remotecontrolled cars. By integrating a range of sensors and establishing an internet connection, an ordinary RC car transforms into a smart and interactive device. This innovative project not only provides an exciting experience with RC cars but also offers an opportunity to delve into the realms of IoT, robotics, and programming. With the ability to control the car remotely using a smartphone, this project seamlessly blends educational exploration with the sheer delight of maneuvering an RC car. 1
OBJECTIVE To build a remotely controlled car that can be controlled over the phone application. Establishing an internet connection through Wi-Fi on the ESP32 microcontroller To make RC car moveable for 360 degree 2
FEATURES & SUSTAINIBILITY The IoT RC Car Mini Project can integrate a range of environmentallyfriendly elements and sustainable approaches to minimize its ecological footprint and foster sustainability. The RC car utilizing the ESP32 microcontroller incorporates energy-efficient operation, renewable energy integration, remote monitoring and control, environmental sensing, an open-source and collaborative platform, sustainable materials and manufacturing, and education and awareness to promote sustainability. By optimizing power consumption, utilizing renewable energy sources, enabling remote control, integrating environmental sensors, fostering collaboration, employing sustainable materials, and providing educational resources, this RC car project combines technology and sustainable practices to minimize environmental impact and promote a greener future. 3
RC CAR MINI POWER BANK BATTERY HOLDER DC MOTOR SERVO MOTOR L928 MOTOR DRIVER HARDWARE 4 NODE MCU ESP32 METHODOLOGY
ADRUINO IDE MIT APP SOFTWARE 5
COMPONENT & TOOLS SCREW DRIVER JUMPER WIRE SOLDERING TOOL BATTERY 6
1. Gather material: gather an Esp32 microcontroller, Rc car chassis, motor driver tool, battery, and other part. The part can be purchased online or any electrical shop. 2. Assemble car chassis: assemble car chassis based on instruction and screw it tightly so they look solid. 3. Install the dc motor: Install the dc motor that comes with the Rc car chassis. Mount the motor securely to the chassis. 4. Connect the motor driver module: Connect the motor driver module to the esp32 based on the circuit diagram. 5. Add the wheel and tires: Install the Wheels and Tires that come with the rc car chassis into the dc motor securely. 6. Install the ESP32 microcontroller: Follow the instructions that came with the ESP32 microcontroller to install it into the RC car. Make sure it is securely mounted and all wires are properly connected. PROCEDURE 7
7. Add the battery: Choose a battery that is compatible with the motor driver module and ESP32 microcontroller. Make sure it is fully charged and securely mounted in the car. 8. Program the ESP32 microcontroller: Use appropriate programming software, such as Arduino IDE, to program your ESP32 microcontroller to control the DC motors and other functions of the RC car. 9. Test and adjust: Once have assembled all the components and programmed the ESP32 microcontroller, test the RC car to make sure it works properly. If necessary, make adjustments to the motor driver module or programming. 10. Decorate and finish: Add any finishing touches to the car, such as paint, decals, or body structure to rc car 8
RC CAR VIEW FRONT VIEW BACK VIEW LEFT SIDE VIEW RIGHT SIDE VIEW 9
CIRCUIT DIAGRAM To construct an RC car using a NodeMCU, gather the necessary components: a NodeMCU board, an H-bridge motor driver module (such as L298N or L293D), DC motors, wheels, a power source, and jumper wires. Begin by linking the power source to the VCC and GND pins of the NodeMCU. Proceed to connect the motor driver to the NodeMCU, ensuring that the motor driver's input pins are appropriately attached to the GPIO pins of the NodeMCU for motor control. Follow the documentation of the motor driver to determine the specific pin configurations for connecting the DC motors to the output pins of the motor driver. Don't forget to connect the power source to the motor driver's power input pins. Lastly, attach the wheels to the DC motors. 10
SOURCE CODE //#define ENA 14 #//#define ENA 14 #define IN_1 27// L298N in1 motors Right#define IN_2 26// L298N in2 motors Right #define IN_3 33// L298N in3 motors Left #define IN_425// L298N in4 motors Left //#define ENB 32 #include <ESP32Servo.h>#include <WiFi.h> #include <WiFiClient.h> #include <WebServer.h> String command; //String to store app command state. intspeedCar = 800;// 400 - 1023. int speed_Coeff = 3; const char* ssid = "mantobek";WebServer server(80); Servo myservo; void setup() { //pinMode(ENA,OUTPUT); pinMode(IN_1,OUTPUT); pinMode(IN_2, OUTPUT); pinMode(IN_3, OUTPUT); pinMode(IN_4,OUTPUT); //pinMode(ENB, OUTPUT); Serial.begin(115200); 11
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); digitalWrite(IN_3, LOW); digitalWrite(IN_4, HIGH); } void goBack(){ digitalWrite(IN_1, HIGH); digitalWrite(IN_2, LOW); digitalWrite(IN_3, HIGH); digitalWrite(IN_4, LOW); } void goRight(){ 12
digitalWrite(IN_1, HIGH); digitalWrite(IN_2, LOW); digitalWrite(IN_3, LOW); digitalWrite(IN_4, HIGH); } void goLeft(){ igitalWrite(IN_1, LOW); digitalWrite(IN_2, HIGH); digitalWrite(IN_3, HIGH); digitalWrite(IN_4, LOW); } voidgoAhea dRight() { digitalWrite(IN_1, LOW); digitalWrite(IN_2, HIGH); digitalWrite(IN_3, LOW); digitalWrite(IN_4, HIGH); } void goAheadLeft(){ digitalWrite(IN_1, LOW); digitalWrite(IN_2, HIGH); 13
digitalWrite(IN_3, LOW); digitalWrite(IN_4, HIGH); } void goBackRight(){ digitalWrite(IN_1, HIGH); digitalWrite(IN_2, LOW); digitalWrite(IN_3, HIGH); digitalWrite(IN_4, LOW); } void goBackLeft(){ digitalWrite(IN_1, HIGH);digitalWrite(IN_2, LOW); digitalWrite(IN_3, HIGH);digitalWrite(IN_4, LOW); } void stopRobot(){ digitalWrite(IN_1, LOW); digitalWrite(IN_2, LOW); digitalWrite(IN_3, LOW); } void loop() { server.handleClient(); if (command == "F")goAhead(); 14
else if (command == "B") goBack(); else if (command == "L") goLeft(); else if (command == "R") { goRight(); myservo.write (180); } 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")); 15
} server.send ( 200, "text/html", "" ); delay(1); } 16
CONCLUSION 17 7 In summary The RC car project can be a challenging and rewarding effort for students, hobbyists, and anybody with an interest in electronics, programming, and mechanics. The design, building, and testing of an RC car can aid players in developing crucial abilities including problem-solving, cooperation, and critical thinking.The success of an RC car project hinges on careful planning, research, and attention to detail. It is crucial to build and test the control system as well as pick the right materials, tools, and components in order to achieve optimal performance.The opportunity to develop technical skills, as well as communication and cooperation skills, while working together to solve difficulties and materialise ideas, is provided by an RC vehicle project.