Arduino Nano-Based Battery-Powered Firefighting Robot with Flame Sensor and Water Pump
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit that includes an Arduino Nano, an L298N DC motor driver, motors with wheels, a servo, a flame sensor, a water pump, a 1-channel relay, and power sources. The circuit is designed to control motors and a water pump based on sensor inputs, with the Arduino Nano serving as the central microcontroller.
Component List
2x 18650 Battery Pack
- Description: Power source for the circuit.
- Pins: VCC, GND
Arduino Nano
- Description: Microcontroller used to control the circuit.
- Pins: D1/TX, D0/RX, RESET, GND, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11/MOSI, D12/MISO, VIN, 5V, A7, A6, A5, A4, A3, A2, A1, A0, AREF, 3V3, D13/SCK
L298N DC Motor Driver
- Description: Motor driver used to control the motors.
- 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
Motor and Wheels
- Description: Motors used for movement.
- Pins: VCC, GND
1-Channel Relay (5V 10A)
- Description: Relay used to control the water pump.
- Pins: NC, Signal, C, Power, NO, Ground
Servo
- Description: Servo motor for precise control.
- Pins: GND, VCC, PWM
Flame Sensor
- Description: Sensor to detect flame.
- Pins: A0, GND, D0, VCC
Water Pump
- Description: Pump used to dispense water.
- Pins: VCC, GND
Li-ion 18650 Battery
- Description: Additional power source for the water pump.
- Pins: +, -
Wiring Details
2x 18650 Battery Pack
- VCC connected to L298N DC Motor Driver 12V
- GND connected to:
- Servo GND
- Flame Sensor GND
- L298N DC Motor Driver GND
- 1-Channel Relay Ground
- Arduino Nano GND
Arduino Nano
- VIN connected to L298N DC Motor Driver 5V
- D6 connected to L298N DC Motor Driver ENA
- D10 connected to L298N DC Motor Driver IN1
- D9 connected to L298N DC Motor Driver IN2
- D8 connected to L298N DC Motor Driver IN3
- D7 connected to L298N DC Motor Driver IN4
- D5 connected to L298N DC Motor Driver ENB
- D3 connected to Servo PWM
- D4 connected to Flame Sensor D0
- D11/MOSI connected to 1-Channel Relay Signal
- 5V connected to:
- Servo VCC
- Flame Sensor VCC
- 1-Channel Relay Power
L298N DC Motor Driver
- OUT1 connected to Motor and Wheels GND
- OUT2 connected to Motor and Wheels VCC
- OUT3 connected to Motor and Wheels GND
- OUT4 connected to Motor and Wheels VCC
Motor and Wheels
- Motor 1:
- VCC connected to L298N DC Motor Driver OUT2
- GND connected to L298N DC Motor Driver OUT1
- Motor 2:
- VCC connected to L298N DC Motor Driver OUT4
- GND connected to L298N DC Motor Driver OUT3
1-Channel Relay (5V 10A)
- Signal connected to Arduino Nano D11/MOSI
- Power connected to Arduino Nano 5V
- Ground connected to 2x 18650 Battery Pack GND
- C connected to Water Pump VCC
- NO connected to Li-ion 18650 Battery +
Servo
- GND connected to 2x 18650 Battery Pack GND
- VCC connected to Arduino Nano 5V
- PWM connected to Arduino Nano D3
Flame Sensor
- GND connected to 2x 18650 Battery Pack GND
- VCC connected to Arduino Nano 5V
- D0 connected to Arduino Nano D4
Water Pump
- VCC connected to 1-Channel Relay C
- GND connected to Li-ion 18650 Battery -
Li-ion 18650 Battery
- + connected to 1-Channel Relay NO
- - connected to Water Pump GND
Documented Code
Arduino Nano Code
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
This code is a basic template for the Arduino Nano. The setup() function is used to initialize any settings or configurations, and the loop() function contains the main logic that runs repeatedly. Further code can be added to control the motors, servo, and water pump based on the flame sensor input.