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

Arduino UNO-Based RC Boat Monitoring System with Bluetooth Control

View and Edit Project In Cirkit DesignerImage of Arduino UNO-Based RC Boat Monitoring System with Bluetooth Control

Circuit Documentation

Summary

This document provides a detailed overview of a circuit designed for an RC Boat Monitoring System. The system includes various sensors, a motor driver, and a Bluetooth module, all controlled by an Arduino UNO. The circuit is powered by a 12V battery and includes components for measuring pH, turbidity, and temperature, as well as controlling motors and a rudder servo.

Component List

  1. Arduino UNO

    • Description: Microcontroller board based on the ATmega328P.
    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
  2. 12V Battery

    • Description: Power source for the circuit.
    • Pins: -, +
  3. HC-05 Bluetooth Module

    • Description: Bluetooth module for wireless communication.
    • Pins: Key, VCC, GND, TXD, RXD, State
  4. pH Meter V1.1

    • Description: Sensor for measuring pH levels.
    • Pins: DATA, VCC, GND
  5. Turbidity Sensor

    • Description: Sensor for measuring water turbidity.
    • Pins: gnd, in, vcc
  6. Temperature Sensor (TEMP)

    • Description: Sensor for measuring temperature.
    • Pins: 5V, D3, GND
  7. L293 Motor Driver

    • Description: Motor driver for controlling DC motors.
    • Pins: A1, A2, EN_A, VCC, GND, EN_B, B2, B1, MA 2, MA1, -V, +V, MB1, MB2
  8. 12V Geared Motor

    • Description: DC motor for propulsion.
    • Pins: Terminal 1, Terminal 2
  9. MG90S Servo Motor

    • Description: Servo motor for rudder control.
    • Pins: SIG, VCC, GND

Wiring Details

Arduino UNO

12V Battery

HC-05 Bluetooth Module

pH Meter V1.1

Turbidity Sensor

Temperature Sensor (TEMP)

L293 Motor Driver

12V Geared Motor

MG90S Servo Motor

Documented Code

#include <Servo.h>
#include <OneWire.h>
#include <DallasTemperature.h>

// Pin Definitions
#define PH_SENSOR_PIN A0
#define TURBIDITY_SENSOR_PIN A1
#define TEMP_SENSOR_PIN 2
#define MOTOR_LEFT_PWM 3
#define MOTOR_RIGHT_PWM 5
#define MOTOR_LEFT_DIR1 6
#define MOTOR_LEFT_DIR2 7
#define MOTOR_RIGHT_DIR1 8
#define MOTOR_RIGHT_DIR2 9
#define RUDDER_SERVO_PIN 10

// Servo
Servo rudder;

// Temperature Sensor
OneWire oneWire(TEMP_SENSOR_PIN);
DallasTemperature tempSensor(&oneWire);

// Bluetooth Commands
char command;

void setup() {
  // Initialize Serial Communication
  Serial.begin(9600);
  
  // Initialize Sensors
  tempSensor.begin();
  
  // Setup Motors and Servo
  pinMode(MOTOR_LEFT_PWM, OUTPUT);
  pinMode(MOTOR_RIGHT_PWM, OUTPUT);
  pinMode(MOTOR_LEFT_DIR1, OUTPUT);
  pinMode(MOTOR_LEFT_DIR2, OUTPUT);
  pinMode(MOTOR_RIGHT_DIR1, OUTPUT);
  pinMode(MOTOR_RIGHT_DIR2, OUTPUT);

  rudder.attach(RUDDER_SERVO_PIN);
  rudder.write(90); // Center the rudder

  // Confirm Setup
  Serial.println("RC Boat Monitoring System Initialized");
}

void loop() {
  // Read and Transmit Sensor Data
  readAndSendSensorData();

  // Bluetooth Command Handling
  if (Serial.available()) {
    command = Serial.read();
    handleCommand(command);
  }
}

// Function to Read and Send Sensor Data
void readAndSendSensorData() {
  int pHValue = analogRead(PH_SENSOR_PIN);
  int turbidityValue = analogRead(TURBIDITY_SENSOR_PIN);

  tempSensor.requestTemperatures();
  float temperature = tempSensor.getTempCByIndex(0);

  // Transmit Data via Bluetooth
  Serial.print("pH: ");
  Serial.println(pHValue);
  Serial.print("Turbidity: ");
  Serial.println(turbidityValue);
  Serial.print("Temperature: ");
  Serial.println(temperature);
}

// Function to Handle Bluetooth Commands
void handleCommand(char cmd) {
  switch (cmd) {
    case 'F': // Move Forward
      moveMotors(150, 150);
      break;
    case 'B': // Move Backward
      moveMotors(-150, -150);
      break;
    case 'L': // Turn Left
      rudder.write(60); // Adjust angle for left turn
      moveMotors(100, 150);
      break;
    case 'R': //