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

Arduino UNO Bluetooth-Controlled Smart Car with Soil Moisture Monitoring and Water Pump

View and Edit Project In Cirkit DesignerImage of Arduino UNO Bluetooth-Controlled Smart Car with Soil Moisture Monitoring and Water Pump

Circuit Documentation

Summary

This circuit is designed to control a car with additional features such as a water pump, soil moisture sensor, and a servo motor. The control is achieved using an Arduino UNO microcontroller, which interfaces with various components including an HC-05 Bluetooth module, a motor driver (L298N), a micro servo, a 5V mini water pump, a soil moisture sensor, and a 12V single channel relay. The circuit allows for remote control via Bluetooth and includes functionalities for moving the car, controlling the servo motor, activating the water pump, and reading soil moisture levels.

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. HC-05

    • Description: Bluetooth module for wireless communication.
    • Pins: STATE, RXD, TXD, GND, VCC, EN
  3. Micro servo 9G

    • Description: Small servo motor for precise control.
    • Pins: GND, +5V, PWM
  4. 5V mini water pump

    • Description: Small water pump for liquid transfer.
    • Pins: positive pin, negative pin
  5. Soil Moisture Sensor

    • Description: Sensor to measure soil moisture levels.
    • Pins: VCC, GND, SIG
  6. Motor Driver (L298N)

    • Description: Dual H-Bridge motor driver for controlling motors.
    • Pins: OUT 1, OUT 2, OUT 3, OUT 4, +12V INPUT, GND, +5V OUTPUT, ENA, IN 1, IN 2, IN 3, IN 4, ENB
  7. 12V SINGLE CHANNEL RELAY

    • Description: Relay module for switching high power devices.
    • Pins: NC, COM, NO, IN, GND, VCC
  8. Soil Moisture Module

    • Description: Module to interface with the soil moisture sensor.
    • Pins: positive, negative, Analog, Digital, Ground, VCC
  9. 2x 18650

    • Description: Battery pack for power supply.
    • Pins: vcc, gnd
  10. DC Motor

    • Description: Motor for driving the car.
    • Pins: pin 1, pin 2

Wiring Details

Arduino UNO

HC-05

Micro servo 9G

5V mini water pump

Soil Moisture Sensor

Motor Driver (L298N)

12V SINGLE CHANNEL RELAY

Soil Moisture Module

2x 18650

DC Motor

Code Documentation

#define pinK  7
#define pinRX 8
#define pinTX 9

#include <SoftwareSerial.h>
#include <iarduino_Bluetooth_HC05.h>
#include <Servo.h>

SoftwareSerial softSerial(pinRX, pinTX);
iarduino_Bluetooth_HC05 hc05(pinK);
Servo myServo;

const int waterPumpPin = 3;
const int soilMoisturePin = A0;

// Define motor control pins for the car
const int motor1Pin1 = 4;  // IN1 on L298N
const int motor1Pin2 = 5;  // IN2 on L298N
const int motor2Pin1 = 6;  // IN3 on L298N
const int motor2Pin2 = 2;  // IN4 on L298N

void setup() {
  Serial.begin(9600);         
  softSerial.begin(9600);     
  Serial.println("Bluetooth Module Ready");

  // Initialize motor control pins for the car
  pinMode(motor1Pin1, OUTPUT);
  pinMode(motor1Pin2, OUTPUT);
  pinMode(motor2Pin1, OUTPUT);
  pinMode(motor2Pin2, OUTPUT);

  // Initialize water pump pin and set it to OFF
  pinMode(waterPumpPin, OUTPUT);
  digitalWrite(waterPumpPin, LOW); // Water pump OFF

  // Initialize the servo motor and set it to 0 degrees
  myServo.attach(10);
  myServo.write(0); // Servo at 0 degrees

  Serial.println("Car Control and Additional Features Ready. Send 'F', 'B', 'L', 'R', 'S', 'M', 'W', 'D', 'O', or 'Q'.");
}

void loop() {
  if (softSerial.available()) {
    String command = softSerial.readString();
    Serial.println(command);

    // Execute commands for car control, servo motor, water