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

Arduino Mega 2560-Based Autonomous Robot with GPS, Bluetooth, and Environmental Sensors

View and Edit Project In Cirkit DesignerImage of Arduino Mega 2560-Based Autonomous Robot with GPS, Bluetooth, and Environmental Sensors

Circuit Documentation

Summary

This document provides a detailed overview of a circuit designed to control a robotic vehicle equipped with various sensors and communication modules. The circuit includes temperature sensors, gas sensors, a GPS module, a Bluetooth module, an LCD display, and a motor driver, all interfaced with an Arduino Mega 2560 microcontroller. The vehicle can detect human presence and gas levels, and it can be controlled via Bluetooth commands.

Component List

  1. MLX90614 (Temperature Sensor)

    • Pins: SDA, SCL, GND, VIN
    • Description: Infrared temperature sensor used for non-contact temperature measurements.
  2. MQ-136 (Gas Sensor)

    • Pins: GND, OUT1, OUT2, VCC
    • Description: Gas sensor used to detect the presence of gases.
  3. 12V Power Supply

    • Pins: +, -
    • Description: Provides 12V power to the circuit.
  4. L298N DC Motor Driver

    • Pins: OUT1, OUT2, 12V, GND, 5V, OUT3, OUT4, 5V-ENA-JMP-I, 5V-ENA-JMP-O, +5V-J1, +5V-J2, ENA, IN1, IN2, IN3, IN4, ENB
    • Description: Motor driver used to control the motors of the vehicle.
  5. GPS NEO 6M

    • Pins: VCC, RX, TX, GND
    • Description: GPS module used for location tracking.
  6. 16x2 I2C LCD

    • Pins: GND, VCC, SDA, SCL
    • Description: LCD display used to show sensor readings and status messages.
  7. Bluetooth HC-06

    • Pins: VCC, GND, TXD, RXD
    • Description: Bluetooth module used for wireless communication.
  8. Motor with Reducer

    • Pins: 3 - 6 VCC, GND
    • Description: DC motor with a reducer for driving the vehicle.
  9. Arduino Mega 2560

    • Pins: IOREF, RESET, 3V3, 5V, GND, VIN, A0-A15, D0-D53, AREF, SDA, SCL
    • Description: Microcontroller used to control the entire circuit.

Wiring Details

MLX90614 (Temperature Sensor)

MLX90614 (Temperature Sensor)

MQ-136 (Gas Sensor)

MQ-136 (Gas Sensor)

12V Power Supply

L298N DC Motor Driver

GPS NEO 6M

16x2 I2C LCD

Bluetooth HC-06

Motor with Reducer

Motor with Reducer

Motor with Reducer

Motor with Reducer

Arduino Mega 2560

Documented Code

#include <Wire.h>
#include <SoftwareWire.h>
#include <LiquidCrystal_I2C.h>
#include <TinyGPS++.h>

// Define I2C addresses for MLX90614 sensors
#define MLX1_ADDRESS 0x5A
#define MLX2_ADDRESS 0x5A // Both sensors have the same default address

// I2C instances for MLX90614 sensors (using different buses)
SoftwareWire Wire1(51, 50); // SDA = 23, SCL = 22 for Sensor 1
SoftwareWire Wire2(25, 24); // SDA = 25, SCL = 24 for Sensor 2

// LCD setup (8x16 LCD)
LiquidCrystal_I2C lcd(0x27, 16, 2);

// GPS setup
TinyGPSPlus gps;
HardwareSerial& gpsSerial = Serial2; // Using Serial2 for GPS

// MQ-135 pins
#define MQ135_LEFT A15
#define MQ135_RIGHT A14

// Motor control pins
#define IN1 7
#define IN2 6
#define ENA 10    // Pin 10 for motor speed control
#define IN3 4
#define IN4 5
#define ENB 11

// Thresholds
#define TEMP_THRESHOLD 20.0  // Temperature threshold for human detection
#define GAS_THRESHOLD 20     // Threshold for gas sensor comparison