กลับไปหน้ารวมไฟล์
motor-control-using-nodemcu-9de7a5-en.md

This is a project that enables the user to control 2 Separate DC motors in either direction via Web Browser.

The main components used are nodeMCU, motor driver(ICL293D) and 2 DC motors.

The motor is controlled using a motor driver IC L293D and an external supply (5V) is given to the motor driver at pin 8 and 16. Pin 4 and 13 is given as the ground supply. Input to motor 1 is at pin 2 and 7 provided by pin D5 and D6 of ESP8266. Similarly for motor 2, input is provided by pin D7 and D8 to pin 10 and 15 of ICL293D.

Technical Implementation: WiFi and Pulse Width Modulation

The project reveals the hidden layers of simple internet-to-motion interaction:

  • Identification layer: The ESP8266 NodeMCU acts as the high-resolution WiFi brain, receiving smartphone commands through the local 2.4GHz network.
  • Wireless Interface layer: Using a web-dashboard, the ESP8266 receives "Forward," "Back," and "Stop" requests.
  • Actuation layer: An L293D H-Bridge Driver acts as the high-power switching heart, allowing the ESP8266 to control the motors while protecting the micro-controller.
  • Conversion layer: The NodeMCU uses its digital pins to coordinate the motor orientation tasks.
  • Processing Logic layer: The NodeMCU code follows a "sequential decoding" strategy: it only activates the wheels if the WiFi is connected and the command is valid.

The ESP8266 is connected to the WiFi router using an SSID and password of the WiFi router and creates a Web Server which can be accessed by the user(using a smartphone or a Laptop) connected to the Wifi router. After the connection is established, an IP address will be displayed on the Serial monitor. The user then needs to put the same IP address on the Web Browser of their device to obtain a web page.

the Web page looks like this....

Hardware Infrastructure

  • ESP8266 NodeMCU: The core WiFi-enabled micro-controller that manages the wireless data and coordinates the motor tasks.
  • L293D Motor Driver: Providing the high-power mobile base for the motors.
  • DC Geared Motors: Providing the physical movement and orientation for the robot.
  • Battery Pack (5V): Essential for providing the high voltage and energy-efficient power for the motor's operation.
  • Micro-USB Cable: Used to program the ESP8266 and provides the primary power for the initial setup.

Upon pressing any button the status will be displayed on the Web page showing the direction rotation of both the motors.

The status is updated automatically depending on the button pressed.

motor 1 provides status as either forward or backward.Similarly motor 2 status is either left or right.(like the motors moving in RC cars)

After pressing any button

Future Expansion

  • OLED Identity Dashboard Integration: Add a small OLED display to the robot to show the "IP Address," "Battery Level (%)" and "RSSI Signal."
  • Multi-sensor Sync: Connect an Ultrasonic sensor to perform an "Auto-Stop" if the robot is about to crash.
  • Cloud Interface Support: Add a specialized web-dashboard to precisely track and log the robot's history from a smartphone anywhere.
  • Advanced Velocity Profile: Add specialized "Speed Control" (PWM) to the code to allow the robot to accelerate smoothly.

[!IMPORTANT] Always ensure a common ground (GND) between the NodeMCU and the motor driver to avoid random resets or command failures!

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

apps:
  - "1x Arduino IDE"
  - "1x Blynk App Dashboard"
author: "shubhamsantosh99"
category: "Motors & Robotics"
components:
  - "1x ESP8266 NodeMCU"
  - "1x L298N Dual H-Bridge Motor Driver"
  - "2x DC Geared Motors with Wheels"
  - "1x 7.4V Li-ion Battery Pack (or 9V)"
  - "1x Breadboard (generic)"
  - "10x Jumper wires (female-to-female)"
  - "1x Micro-USB Cable"
description: "A fun and basic IoT robotics project to control DC motors wirelessly from your smartphone or computer using an ESP8266 and a motor driver."
difficulty: "Intermediate"
documentationLinks: []
downloadableFiles: []
encryptedPayload: "U2FsdGVkX191VYSNGjEsEnwlg+I3IVHtlmNV2bsc0W8OgZ+GV5MQ5aj1tuATUVzy8m+MNgaKF5x9XGLuNyeSPy4wb/fhTv58IhTvgbf0JNQ="
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/motor-control-using-nodemcu-9de7a5_cover.jpg"
lang: "en"
likes: 3
passwordHash: "7091fc1e5350d1d858453561d5b6955df5c2301e8b7b6af0358f1070f8089691"
price: 1120
seoDescription: "An intuitive and simple NodeMCU WiFi motor control setup for beginners interested in Arduino wireless robotics and smartphone-to-motion projects."
tags:
  - "nodemcu"
  - "esp8266"
  - "motor-control"
  - "wifi"
  - "beginners"
title: "Motor Control Using NodeMCU"
tools: []
videoLinks:
  - "https://www.youtube.com/embed/-UhdH_8ajV8"
views: 19895