Skip to content

NodeMCU Car Control is a fun, lightweight project that lets you remotely control a two-wheeled robot using a NodeMCU (ESP8266) and an L298N motor driver. The code is modular and easy to tweak, making it perfect for anyone looking to dive into robotics and experiment with cool features. ๐Ÿš—โš™๏ธ

License

Notifications You must be signed in to change notification settings

Customize5773/Controlled-Mobile-Phone-RC-Car

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

15 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

NodeMCU Car Control: A Modular Two-Wheel Robot Controller ๐Ÿค–๐Ÿš—โšก

Overview ๐Ÿ“š

NodeMCU-ESP8266-WiFi-Controlled-Robotic-Car

Source:[https://how2electronics.com/wifi-controlled-robot-using-esp8266-android-app/]

NodeMCU Car Control is a robust and flexible control system designed for two-wheeled robots. Leveraging the NodeMCU (ESP8266) and an L298N motor driver, this project offers remote robot control via an integrated HTTP server. Built with a modular, object-oriented approach, it targets real-world competitive robotics challenges by providing an affordable and scalable solution ideal for mechatronics enthusiasts and students.


Backstory ๐Ÿ“– In our early days of diving into competitive roboticsโ€”whether it was the intensity of sumo battles or the spirited excitement of robot soccerโ€”we quickly learned that the toughest opponent wasnโ€™t always on the arena floor. It was the endless string of technical hiccups that kept us up at night. We faced component limitations that made even the simplest tasks feel like climbing Everest, performance issues that seemed to pop up when we least expected them, and the ever-present challenge of navigating expensive parts on a shoestring budget. And, not to mention, our schoolโ€™s enthusiasm (or lack thereof) could best be described as tepid at best when it came to supporting our wild ideas.

Despite these hurdles, our shared passion for innovation kept us going. Picture a group of sleep-deprived enthusiasts huddled in a cramped, makeshift workshopโ€”where laughter was as common as the sound of soldering irons. We experimented with every idea that came to mind, learned from spectacular failures (yes, there were plenty of โ€œoopsโ€ moments), and gradually figured out what worked. Tired of being boxed in by proprietary systems that limited our creativity, we turned to the versatile and cost-effective NodeMCU. It was like discovering a secret weapon that allowed us to dream big without breaking the bank.

This project was born out of those long nights, countless trials, and the determination to overcome every obstacle in our path. It isnโ€™t just a tool for better performanceโ€”itโ€™s a tribute to our resilience, our ability to laugh at our missteps, and our relentless pursuit of solutions under real-world pressure.


Hardware Components โš™๏ธ๐Ÿ”‹

The project requires the following electronic components:

Component Details
ESP8266 Module NodeMCU or any ESP8266-based development board
Motor Driver Module L298N
DC Motors (2x) Right and Left motors as dictated by the connections below
Jumper Wires For connecting the ESP8266 to the motor driver and other peripherals
Power Supply/Battery Suitable power source to drive the ESP8266 and motors

Pin Assignments for Motors (as used in the code):

  • Right Motor:

    • Speed control (RIGHT_EN): GPIO14 (D5)
    • Direction control (RIGHT_IN1): GPIO15 (D8)
    • Direction control (RIGHT_IN2): GPIO13 (D7)
  • Left Motor:

    • Speed control (LEFT_EN): GPIO12 (D6)
    • Direction control (LEFT_IN1): GPIO2 (D4)
    • Direction control (LEFT_IN2): GPIO0 (D3)

Software Design ๐Ÿ’ป๐Ÿ“

Screenshot 2025-04-20 at 14-47-55 wifi Mobile Phone Controlled Car arduino - Penelusuran Google

The firmware is written in C++ and leverages the ESP8266WiFi and ESP8266WebServer libraries. The software design is modular, separating the low-level motor operations from the higher-level control algorithms. Key functionalities include:

  • WiFi Access Point Setup:
    The ESP8266 is configured as an access point with the SSID NodeMCU_Car and an IP address provided on initialization.

  • Embedded Web Server:
    A lightweight HTTP server listens on port 80. Incoming HTTP requests containing motor commands (via the "State" parameter) are processed and executed.

  • Motor Control Algorithms:
    Various commands allow for nuanced control of the car including forward, backward, pivoting, and turning. PWM is used to adjust speeds dynamically, and custom speed levels can be set by sending numeric commands (0-9).

  • Object-Oriented Implementation:
    The separation into Motor and MotorController classes ensures an organized code architecture that is both scalable and easy to modifyโ€”a highly recommended practice in academic and research environments.

Link Download App : [https://drive.google.com/file/d/1AoNs3wSQclL30Q25xIi6Hopy8Fb1ctwT/view?usp=sharing]


Diagrams and Wiring ๐Ÿ“Š๐Ÿ”Œ

System Architecture Diagram

     +------------------+
     | ESP8266-Module   |
     +------------------+
              |
              v
     +-------------------------+
     | WiFi-AP: NodeMCU-Car     |
     +-------------------------+
              |
              v
     +------------------+
     | HTTP-Commands    |
     +------------------+
              |
              v
     +------------------------------+
     | L298N-Motor-Driver-Module    |
     +------------------------------+
            /               |          \
           v                v           v
  +---------------+  +---------------+  +--------------+
  | Right-Motor   |  | Control-Signal|  | Left-Motor   |
  +---------------+  +---------------+  +--------------+

Wiring Overview

  • ESP8266 โ†’ L298N
    The ESP8266 GPIO pins are interlinked with the L298N's control pins according to the following configuration:
    • Right Motor:
      • EN: GPIO14, IN1: GPIO15, IN2: GPIO13
    • Left Motor:
      • EN: GPIO12, IN1: GPIO2, IN2: GPIO0

image

Source:[https://www.youtube.com/watch?v=uz4UvLh3jqg]


Implementation ๐Ÿ—๏ธ๐Ÿ“

The implementation of NodeMCU Car Control is carefully structured to ensure clarity and extensibility. Here's a step-by-step breakdown:

  1. Hardware Abstraction:

    • Motor Class:
      Encapsulates individual motor control, handling operations such as moving forward ๐ŸŸข, backward ๐Ÿ”™, and stopping ๐Ÿ›‘. The class manages PWM speed control and directional signals.
    • MotorController Class:
      Integrates two motor objects โš™๏ธโš™๏ธ, enabling coordinated maneuvers like pivoting ๐ŸŒ€ and differential turns ๐Ÿ”„ by adjusting motor speeds.
  2. Network Initialization:

    • Configures the NodeMCU as a WiFi Access Point ๐Ÿ“ถ, allowing remote control through any WiFi-enabled device.
    • Launches a lightweight HTTP server ๐ŸŒ on port 80 to receive commands in real time.
  3. Command Processing Workflow:

    • The HTTP handler listens for simple GET requests โœ‰๏ธ that include a command parameter (such as "F" for forward, "B" for backward).
    • A dedicated function maps these commands to specific motor controller methods โœ…, ensuring smooth and immediate operation.
  4. Modular & Scalable Code Design:

    • The clear separation of motor functions into distinct classes ๐Ÿ”’ ensures that additional featuresโ€”like sensor integrations ๐Ÿ› ๏ธ or advanced state machines ๐Ÿง โ€”can be added with minimal disruption.
    • This architecture supports iterative development ๐Ÿ’ป, allowing the controller to evolve alongside the challenges of competitive robotics.

License ๐Ÿ“„๐Ÿ›ก๏ธ

This project is licensed under the GNU GENERAL PUBLIC LICENSE Version 3. See the LICENSE file for further details.


Inspiration ๐Ÿ’กโœจ

Inspired by creative engineering showcased by A to Z tech solution, this project embodies a relentless quest for innovation amid technical challenges โš™๏ธ๐Ÿ”ฅ. For a glimpse into the inspiration, check out the A to Z tech solution YouTube video and dive into the world of dynamic robotics competition. ๐Ÿš€๐Ÿค–


Let your creativity drive innovation and take your robotics game to new heights! ๐ŸŒŸ Happy Building! ๐Ÿ› ๏ธ

About

NodeMCU Car Control is a fun, lightweight project that lets you remotely control a two-wheeled robot using a NodeMCU (ESP8266) and an L298N motor driver. The code is modular and easy to tweak, making it perfect for anyone looking to dive into robotics and experiment with cool features. ๐Ÿš—โš™๏ธ

Topics

Resources

License

Stars

Watchers

Forks

Languages