Arduino and ESP32-Based Flame-Extinguishing Robot with Ultrasonic Obstacle Avoidance
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a robotic system designed to detect and extinguish flames. The system uses an Arduino Uno R3 microcontroller to control various sensors and actuators, including flame sensors, an ultrasonic distance sensor, a motor driver, and servos. The system is powered by a 2x 18650 battery pack and a DC-DC converter. The Arduino Uno R3 is programmed to navigate, detect flames, and activate a water pump to extinguish detected flames.
Component List
Arduino Uno R3
- Description: Microcontroller board based on the ATmega328P.
- Pins: D8, D9, D10, D11, D12, D13, GND, AREF, SDA, SCL, D0/RX, D1/Tx, D2, D3, D4, D5, 6, D7, A5/SCL, A4/SDA, A3, A2, A1, A0, Vin, 5V, 3.3V, RESET, IOREF, NONE, USB Jack, Power Jack
DCDC 12V/5V 3A
- Description: DC-DC converter to step down voltage from 12V to 5V.
- Pins: 12V (+), GND, 5V (+), Vin (+), V in (-)
2x 18650
- Description: Battery pack providing power to the system.
- Pins: vcc, gnd
HC-SR04 Ultrasonic Distance Sensor (Wokwi Compatible)
- Description: Ultrasonic sensor for distance measurement.
- Pins: VCC, TRIG, ECHO, GND
L298N DC Motor Driver
- Description: Motor driver to control DC 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
Hobby Gearmotor with 48:1 Gearbox
- Description: DC motor with a 48:1 gearbox.
- Pins: pin 1, pin 2
KY-026 Flame Sensor
- Description: Sensor to detect flames.
- Pins: A0, GND, VCC, D0
Servo
- Description: Servo motor for precise control.
- Pins: GND, VCC, PWM
ESP 32 DEVKIT V1 (30 pins)
- Description: Microcontroller board with Wi-Fi and Bluetooth capabilities.
- Pins: EN, VP, VN, D34, D35, D32, D33, D25, D26, D27, D14, D12, D13, GND, VIN, 3V3, D15, D2, D4, RX2, TX2, D5, D18, D19, D21, RX0, TX0, D22, D23
Resistor (10k Ohms)
- Description: Resistor with a resistance of 10k Ohms.
- Pins: pin1, pin2
Resistor (15k Ohms)
- Description: Resistor with a resistance of 15k Ohms.
- Pins: pin1, pin2
MQ-2
- Description: Gas sensor for detecting smoke and flammable gases.
- Pins: GND, VCC, ANALOG, Digital
1 Channel Relay 5V
- Description: Relay module for switching high-power devices.
- Pins: VCC, GND, IN, NC, COM, NO
Water Pump
- Description: Pump for extinguishing flames.
- Pins: VCC, GND
Wiring Details
Arduino Uno R3
- Vin: Connected to 5V (+) of DCDC 12V/5V 3A
- GND: Connected to GND of DCDC 12V/5V 3A, 2x 18650, L298N DC motor driver, Water Pump, 1 Channel Relay 5V, MQ-2, HC-SR04 Ultrasonic Distance Sensor, KY-026 Flame Sensors, Servos
- D0/RX: Connected to TX2 of ESP 32 DEVKIT V1
- D1/Tx: Connected to RX2 of ESP 32 DEVKIT V1
- D2: Connected to D0 of KY-026 Flame Sensor (left)
- D3: Connected to D0 of KY-026 Flame Sensor (center)
- D4: Connected to D0 of KY-026 Flame Sensor (right)
- D5: Connected to ENA of L298N DC motor driver
- 6: Connected to ENB of L298N DC motor driver
- D7: Connected to IN1 of L298N DC motor driver
- D8: Connected to IN2 of L298N DC motor driver
- D9: Connected to IN3 of L298N DC motor driver
- D10: Connected to IN4 of L298N DC motor driver
- D11: Connected to TRIG of HC-SR04 Ultrasonic Distance Sensor
- D12: Connected to ECHO of HC-SR04 Ultrasonic Distance Sensor
- D13: Connected to IN of 1 Channel Relay 5V
- A0: Connected to PWM of Servo (flame-extinguishing)
- A1: Connected to PWM of Servo (ultrasonic)
DCDC 12V/5V 3A
- Vin (+): Connected to vcc of 2x 18650
- V in (-): Connected to gnd of 2x 18650
- 5V (+): Connected to Vin of Arduino Uno R3, VCC of HC-SR04 Ultrasonic Distance Sensor, VCC of KY-026 Flame Sensors, VCC of 1 Channel Relay 5V, COM of 1 Channel Relay 5V, VCC of Servos, VCC of MQ-2
2x 18650
- vcc: Connected to Vin (+) of DCDC 12V/5V 3A
- gnd: Connected to V in (-) of DCDC 12V/5V 3A
HC-SR04 Ultrasonic Distance Sensor (Wokwi Compatible)
- VCC: Connected to 5V (+) of DCDC 12V/5V 3A
- TRIG: Connected to D11 of Arduino Uno R3
- ECHO: Connected to D12 of Arduino Uno R3
- GND: Connected to GND of DCDC 12V/5V 3A
L298N DC Motor Driver
- 12V: Connected to Vin (+) of DCDC 12V/5V 3A
- GND: Connected to GND of DCDC 12V/5V 3A
- ENA: Connected to D5 of Arduino Uno R3
- ENB: Connected to 6 of Arduino Uno R3
- IN1: Connected to D7 of Arduino Uno R3
- IN2: Connected to D8 of Arduino Uno R3
- IN3: Connected to D9 of Arduino Uno R3
- IN4: Connected to D10 of Arduino Uno R3
- OUT1: Connected to pin 2 of Hobby Gearmotor (left)
- OUT2: Connected to pin 1 of Hobby Gearmotor (left)
- OUT3: Connected to pin 2 of Hobby Gearmotor (right)
- OUT4: Connected to pin 1 of Hobby Gearmotor (right)
Hobby Gearmotor with 48:1 Gearbox (left)
- pin 1: Connected to OUT2 of L298N DC motor driver
- pin 2: Connected to OUT1 of L298N DC motor driver
Hobby Gearmotor with 48:1 Gearbox (right)
- pin 1: Connected to OUT4 of L298N DC motor driver
- pin 2: Connected to OUT3 of L298N DC motor driver
KY-026 Flame Sensor (left)
- D0: Connected to D2 of Arduino Uno R3
- GND: Connected to GND of DCDC 12V/5V 3A
- VCC: Connected to 5V (+) of DCDC 12V/5V 3A
KY-026 Flame Sensor (center)
- D0: Connected to D3 of Arduino Uno R3
- GND: Connected to GND of DCDC 12V/5V 3A
- VCC: Connected to 5V (+) of DCDC 12V/5V 3A
KY-026 Flame Sensor (right)
- D0: Connected to D4 of Arduino Uno R3
- GND: Connected to GND of DCDC 12V/5V 3A
- VCC: Connected to 5V