กลับไปหน้ารวมไฟล์
phone-controlled-robot-car-using-wi-fi-module-aa8555-en.md

Project Overview

The "Cortex-Connect 4WD" is an advanced IoT robotic platform that demonstrates the power of Distributed Processing. By decoupling the high-level Wi-Fi networking (handled by a NodeMCU ESP8266) from the low-level hardware timing and motor actuation (handled by an Arduino UNO), the system achieves superior responsiveness and stability. Controlling the car via a custom MIT App Inventor joystick, this project explores Inter-Integrated Circuit (I2C) communication, H-Bridge PWM modulation, and Li-Po power distribution strategies.

Technical Deep-Dive

  • Decoupled Dual-MCU Architecture:
    • The Master (NodeMCU): Runs a lightweight Web Server on Port 80. It listens for HTTP requests from the smartphone (e.g., http://192.168.1.5/forward). Once a command is received, it translates the request into a series of I2C bytes.
    • The Slave (Arduino Uno): Polled by the NodeMCU via I2C (Address 0x08). The Uno is dedicated to generating high-frequency Pulse-Width Modulation (PWM) signals for the motor drivers, ensuring smooth acceleration without interrupting the Wi-Fi connection.
  • I2C Multi-Byte Protocol:
    • 16-bit Data Merging: Standard I2C sends 8-bit bytes (0-255). To send high-resolution speed data from the joystick (0-1023), the project utilizes HighByte/LowByte bit-shifting. The NodeMCU splits the integer into two bytes, and the Uno "melts" them back into a single word using the logical formula: (high << 8) | low.
  • L298N H-Bridge Drive Train:
    • Parallel Driver Configuration: To drive four 12V motors while conserving pins, the two L298N modules are connected in parallel. This ensures that the left-side motors (Front/Rear) and right-side motors (Front/Rear) operate in perfect synchronicity, preventing the mechanical "pulling" typical of unevenly powered 4WD systems.
    • Directional Logic: The H-Bridge uses four digital pins per side to control the internal transistor gates. By toggling High/Low across the IN1 to IN4 pins, the system achieves Forward, Reverse, and Zero-Radius turns.
  • Battery C-Rating & Current Sourcing:
    • The Power Budget: 4WD systems under load can draw over 5 Amps. Standard alkaline batteries suffer from high internal resistance and voltage sag. This project utilizes an 11.1V 3S Li-Po with a 25C discharge rating, which can theoretically provide over 50A burst—ensuring the motors never "stall" during rapid direction changes.

Engineering & Implementation

  • MIT App Inventor Joystick Blocks: The companion app uses a "Canvas" and "Ball" component to create a virtual joystick. It calculates the Theta (angle) and Radius (strength) of the user's touch and triggers a Web.Get request to the NodeMCU's local IP address, creating a low-latency control loop.
  • Serial Integration Challenges: A common hurdle in this project is the 3.3V vs 5V logic gap. While many users connect NodeMCU (3.3V) directly to Uno (5V) via I2C, a high-reliability build should use a Bi-directional Logic Level Shifter to prevent accidental overvoltage on the ESP8266 pins.
  • EMI Suppression: Continuous DC motors create significant Electromagnetic Interference (EMI). To protect the sensitive Wi-Fi module, the hardware layout separates the high-power motor wires from the logic signal wires and recommends adding 0.1µF ceramic capacitors across the motor terminals to snub high-frequency noise.
  • Fail-Safe Logic: The Arduino code includes a "Watchdog" timer. If no I2C command is received for more than 500ms (indicating a lost Wi-Fi connection), the Uno automatically stops all motors, preventing the car from "running away" indefinitely.

Drive the future of IoT robotics with a high-performance, Wi-Fi controlled 4WD platform.

ข้อมูล Frontmatter ดั้งเดิม

title: "Phone Controlled Robot Car using Wi-Fi Module"
description: "Remotely controlled car - IoT based project using Wi-Fi Module and MIT App Inventor with intuitive control. A step-by-step guide!"
author: "suk_"
category: "Motors & Robotics"
tags:
  - "iot"
  - "esp8266"
  - "robotics"
  - "i2c"
  - "4wd"
views: 14090
likes: 4
price: 699
difficulty: "Easy"
components:
  - "1x Arduino UNO R3"
  - "1x NodeMCU ESP8266 (Master Controller)"
  - "2x L298N Dual H-Bridge Motor Drivers"
  - "4x 12V DC Gear Motors"
  - "1x 11.1V 3S Li-Po Battery (2200mAh)"
  - "1x logic Level Shifter (Recommended for I2C)"
  - "1x 4WD Robot Car Chassis"
tools:
  - "Digital Multimeter"
  - "Screwdriver Set"
apps:
  - "1x Arduino IDE"
  - "1x MIT App Inventor 2"
downloadableFiles:
  - "https://projects.arduinocontent.cc/849dd4f7-939a-4054-a755-62623bc7e79b.aia"
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/phone-controlled-robot-car-using-wi-fi-module-aa8555_cover.jpg"
lang: "en"