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

Arduino UNO Flame Detection Robot with LCD Display and Buzzer Alert

View and Edit Project In Cirkit DesignerImage of Arduino UNO Flame Detection Robot with LCD Display and Buzzer Alert

Circuit Documentation

Summary

This circuit is designed to detect flames using an IR sensor and respond by activating motors, LEDs, and a buzzer. The system is controlled by an Arduino UNO, which processes the sensor input and drives the output components accordingly. The status is displayed on a 16x2 I2C LCD.

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. Ponte H

    • Description: H-Bridge motor driver.
    • Pins: OUT4-Motor2, OUT3-Motor2, OUT2-Motor1, OUT1-Motor1, 5V, GND, 12V, IN3, IN1, IN2, IN4
  3. IR Sensor

    • Description: Infrared sensor for flame detection.
    • Pins: out, gnd, vcc
  4. LED: Two Pin (red)

    • Description: Red LED.
    • Pins: cathode, anode
  5. LED: Two Pin (green)

    • Description: Green LED.
    • Pins: cathode, anode
  6. Motor amarillo motorreductor hobby

    • Description: Hobby motor with gearbox.
    • Pins: vcc, GND
  7. Buzzer Module

    • Description: Buzzer for sound alerts.
    • Pins: GND, Vcc, I/O
  8. 16x2 I2C LCD

    • Description: 16x2 character LCD with I2C interface.
    • Pins: GND, VCC, SDA, SCL

Wiring Details

Arduino UNO

Ponte H

IR Sensor

LED: Two Pin (red)

LED: Two Pin (green)

Motor amarillo motorreductor hobby

Buzzer Module

16x2 I2C LCD

Code Documentation

#include <Wire.h> 
#include <LiquidCrystal_I2C.h>

#define buzzer 2
#define motor_a1 9
#define motor_a2 8
#define motor_b1 7
#define motor_b2 6
#define LED_red 5
#define LED_green 4
#define flame_sensor 3

int flame_detected;

LiquidCrystal_I2C lcd(0x27, 16 , 2);

void setup() {
  Serial.begin(9600);
  lcd.init();
  lcd.backlight();
  pinMode(buzzer, OUTPUT);
  pinMode(motor_a1, OUTPUT);
  pinMode(motor_a2, OUTPUT);
  pinMode(motor_b1, OUTPUT);
  pinMode(motor_b2, OUTPUT);
  pinMode(LED_red, OUTPUT);
  pinMode(LED_green, OUTPUT);
  pinMode(flame_sensor, INPUT);
}

void loop() {
  flame_detected = digitalRead(flame_sensor);
  
  if (flame_detected == 1) {
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("Flame detected");
    digitalWrite(motor_a1, 1);
    digitalWrite(motor_a2, 0);
    digitalWrite(motor_b1, 1);
    digitalWrite(motor_b2, 0);
    digitalWrite(LED_red, 1);
    digitalWrite(LED_green, 0);
    digitalWrite(buzzer, 1);
    delay(250);
    digitalWrite(buzzer, 0);
    delay(250);
  }

  else{
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("No");
    lcd.setCursor(0,1);
    lcd.print("Flame detected");
    digitalWrite(motor_a1, 0);
    digitalWrite(motor_a2, 0);
    digitalWrite(motor_b1, 0);
    digitalWrite(motor_b2, 0);
    digitalWrite(LED_green, 1);
    digitalWrite(LED_red, 0);
    digitalWrite(buzzer, 0);
    delay(250);
  }
}

This code initializes the components and continuously checks for flame detection. If a flame is detected, it activates the motors, red LED, and buzzer, and displays a message on the LCD. If no flame is detected, it stops the motors, activates the green LED, and displays a different message on the LCD.