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

Arduino UNO-Based Bluetooth and IR Controlled Robotic Car with Obstacle Avoidance and Line Following

View and Edit Project In Cirkit DesignerImage of Arduino UNO-Based Bluetooth and IR Controlled Robotic Car with Obstacle Avoidance and Line Following

Circuit Documentation

Summary

This document provides a detailed overview of a circuit designed to control multiple motors, sensors, and a Bluetooth module using an Arduino UNO. The circuit includes components such as an L298N DC motor driver, HC-05 Bluetooth module, ultrasonic sensor, IR receiver, micro servo, rocker switch, and several motors with reducers. The Arduino UNO is programmed to handle various functionalities including motor control, sensor data processing, and Bluetooth communication.

Component List

L298N DC Motor Driver

HC-05 Bluetooth Module

Ultrasonic Sensor

Arduino UNO

IR Receiver

Micro Servo 9G

Rocker Switch

Motor with Reducer

IR Sensor

7.4V Battery

HX1838 Infrared IR Wireless Remote Control

Wiring Details

L298N DC Motor Driver

HC-05 Bluetooth Module

Ultrasonic Sensor

Arduino UNO

IR Receiver

Micro Servo 9G

Rocker Switch

Motor with Reducer

IR Sensor

7.4V Battery

Documented Code

#include <SoftwareSerial.h>
SoftwareSerial BT_Serial(2, 3); // RX, TX

#include <IRremote.h>
const int RECV_PIN = A5;
IRrecv irrecv(RECV_PIN);
decode_results results;

#define enA 10 //Enable1 L298 Pin enA 
#define in1 9  //Motor1  L298 Pin in1 
#define in2 8  //Motor1  L298 Pin in1 
#define in3 7  //Motor2  L298 Pin in1 
#define in4 6  //Motor2  L298 Pin in1 
#define enB 5  //Enable2 L298 Pin enB 

#define servo A4

#define R_S A0 //ir sensor Right
#define L_S A1 //ir sensor Left

#define echo A2    //Echo pin
#define trigger A3 //Trigger pin

int distance_L, distance_F = 30, distance_R;
long distance;
int set = 20;

int bt_ir_data; // variable to receive data from the serial port and IRremote
int Speed = 130;  
int mode=0;
int IR_data;

void setup(){ // put your setup code here, to run once

  pinMode(R_S, INPUT); // declare if sensor as input  
  pinMode(L_S, INPUT); // declare ir sensor as input

  pinMode(echo, INPUT );// declare ultrasonic sensor Echo pin as input
  pinMode(trigger, OUTPUT