Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino and ESP8266 Nodemcu Controlled Robotic Vehicle with RFID and Ultrasonic Sensing

View and Edit Project In Cirkit DesignerImage of Arduino and ESP8266 Nodemcu Controlled Robotic Vehicle with RFID and Ultrasonic Sensing

Circuit Documentation

Summary

The circuit in question is a complex system designed to control a robot with various sensors and actuators. It includes an Arduino UNO as the main microcontroller, interfaced with an IR sensor, an HC-SR04 ultrasonic sensor, an RFID-RC522 reader, an ESP8266 NodeMCU for WiFi connectivity, and a L298N motor driver to control multiple DC motors. A battery pack provides the power source for the motors and the motor driver, while the Arduino UNO and other sensors receive power from the Arduino's voltage regulators. The system is designed for autonomous navigation with manual override capabilities through a Blynk app interface.

Component List

Microcontrollers

Sensors

Actuators

Power

Wiring Details

Arduino UNO

IR Sensor

HC-SR04 Ultrasonic Sensor

RFID-RC522

L298N DC Motor Driver

ESP8266 NodeMCU

DC Motors

Battery Pack

Documented Code

Arduino UNO Code

#include <SPI.h>
#include <MFRC522.h>

// Define sensor pins
const int leftSensorPin = 2;
const int rightSensorPin = 3;
const int trigPin = 16;
const int echoPin = 17;

// Define motor pins
const int motor1Enable = 10;
const int motor1In1 = 9;
const int motor1In2 = 8;
const int motor2In3 = 7;
const int motor2In4 = 6;
const int motor2Enable = 5;
// Define RFID pins
#define RST_PIN 14
#define SS_PIN 15

MFRC522 mfrc522(SS_PIN, RST_PIN);  // Create instance of the RFID reader

bool manualMode = false; // Flag for manual mode

void setup() {
  // Initialize motor pins
  pinMode(motor1Enable, OUTPUT);
  pinMode(motor1In1, OUTPUT);
  pinMode(motor1In2, OUTPUT);
  pinMode(motor2Enable, OUTPUT);
  pinMode(motor2In3, OUTPUT);
  pinMode(motor2In4, OUTPUT);

  // Initialize sensor pins
  pinMode(leftSensorPin, INPUT);
  pinMode(rightSensorPin, INPUT);
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);

  // RFID initialization
  SPI.begin();        // Start SPI communication
  mfrc522.PCD_Init(); // Init MFRC522 module

  Serial.begin(9600);  // For debugging
}

void loop() {
  if (Serial.available() > 0) {
    char command = Serial.read();
    handleCommand(command);
  }

  if (!manualMode) {
    autoNavigate(); // Only run automatic navigation if not in manual mode
  }
}

// Rest of the code...

ESP8266 NodeMCU Code

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <Servo.h>

#define BLYNK_TEMPLATE_ID "YourTemplateID"
#define BLYNK_DEVICE_NAME "YourDeviceName"
#define BLYNK_AUTH_TOKEN "YourAuthToken"

char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "YourSSID";
char pass[] = "YourPassword";

// Virtual pins for manual control
#define VPIN_FORWARD V1
#define VPIN_BACKWARD V2
#define VPIN_LEFT V3
#define VPIN_RIGHT V4
#define VPIN_STOP V5
#define VPIN_MODE V6

bool manualMode = false;

BLYNK_WRITE(VPIN_FORWARD) {
    if (manualMode && param.asInt() == 1) {
        Serial.write('F');
    }
}

// Rest of the code...

This documentation provides an overview of the circuit, including a description of each component, wiring details, and documented code for the microcontrollers. The code for the Arduino UNO includes setup and loop functions, sensor and motor pin definitions, and initialization for the RFID reader and serial communication. The ESP8266 NodeMCU code includes WiFi and Blynk library initialization, virtual pin definitions for manual control, and functions to handle Blynk app commands.