Logic for flame sensor which is mounted on 4 DOF robotic arm ,so when flame gets detected it should lock /follow the flame

Thread Starter

headhoe_15

Joined Feb 14, 2023
3
note : 5 channel flame sensor is used which is mounted on the end effector of the arm,and the robotic arm scan does 180 degree scanning...So experts you are all in here..

hey listen m also using PCA9685 Servo motor driver to control the robotic arm ,,,i just only need the help in following / tracking of the flame once its get detected ??????
Code:
#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>

#define FLAME_SENSOR_PIN A0
#define FIRE_THRESHOLD 200
#define MIN_ANGLE 0
#define MAX_ANGLE 180

Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
int servoPin = 0;

void setup() {
  Serial.begin(9600);
  pwm.begin();
  pwm.setPWMFreq(60);
}

void loop() {
  for (int angle = MIN_ANGLE; angle <= MAX_ANGLE; angle++) {
    pwm.setPWM(servoPin, 0, map(angle, 0, 180, 120, 620));
    int flameValue = analogRead(FLAME_SENSOR_PIN);
    if (flameValue > FIRE_THRESHOLD) {
      Serial.println("Fire detected!");
      break;
    }
    delay(20);
  }
}
 

nsaspook

Joined Aug 27, 2009
13,079
You will need to map the 'flame' XY sensor detection level coordinates into a coordinate system the robot arm understands , then generate error signals that minimize as the arm is pointed directly at the 'flame' target. Once you have a target lock, those error signals can be used to move the robot to match target movements. It's not a simple objective that might require at least two flame sensors to minimize X/Y arm scanning.
 

Thread Starter

headhoe_15

Joined Feb 14, 2023
3
I am using following components in the my project :

  1. 12 v dc motor for vehicle movement
  2. Ultrasonic sensor for obstacle avoidance.
  3. 4 DOF robotic arm
  4. 5 -channel flame sensor
  5. 12 v submersible pump
  6. Arduino mega 2560 microcontroller.
    Problem : After detecting fire through flame sensor.robotic arm position is not getting freezed but its coming to the initial position.
    once the fire is detected through flame sensor ,robotic arm should move forward to the flame,the position of the arm should be freezed and vehicle sholud move towards the fire, a water sholud be sprayed on the fire ,once the fire is extinguished a arm should again scan for any remaining fire by scanning from 0 to 180 degree for three different levels of height, if its detect another fire same position of the arm should be repeated ,and when alll fire are extinguish ,the arm should come to its initial position.
 

Sensacell

Joined Jun 19, 2012
3,432
I thin you will find the amount of variability in the real world and the sparce sensor data you have will make this a very frustrating task.

How do you know how far from the fire you are, for example? 10 cm or 10 meters? it makes a big difference.
 

nsaspook

Joined Aug 27, 2009
13,079
I am using following components in the my project :

  1. 12 v dc motor for vehicle movement
  2. Ultrasonic sensor for obstacle avoidance.
  3. 4 DOF robotic arm
  4. 5 -channel flame sensor
  5. 12 v submersible pump
  6. Arduino mega 2560 microcontroller.
    Problem : After detecting fire through flame sensor.robotic arm position is not getting freezed but its coming to the initial position.
    once the fire is detected through flame sensor ,robotic arm should move forward to the flame,the position of the arm should be freezed and vehicle sholud move towards the fire, a water sholud be sprayed on the fire ,once the fire is extinguished a arm should again scan for any remaining fire by scanning from 0 to 180 degree for three different levels of height, if its detect another fire same position of the arm should be repeated ,and when alll fire are extinguish ,the arm should come to its initial position.
I know this is really a learning project with fairly simple objectives but a real world practical fire robot would be a much more complex device.

The first thing you learn at firefighting school is to not spray at the flame. You aim at the ignition surface to break the fire triangle of

Oxygen
Heat
Fuel

1676477371264.png
Grease fire. Where do you aim here?

This usually means aiming at the base of the fire below the most intense flame. So once you have a flame lock that only begins the process of deciding where to spray the extinguishing materials.
 
Last edited:

nsaspook

Joined Aug 27, 2009
13,079
From the requirements, it sounds like this might be a good problem domain for a fuzzy logic control system.
His simple tracking requirement is not too complicated but a true firefighting robot is a very complex task that requires the ability to predict the future of a fire using a complex set of variables that interact with other complex sets of variables. It's something our brain/body/sensor can do fairly easily with training but for a machine, it's a problem with lots of deadly corner cases like fully automatic car driving.
 
Last edited:

dcbingaman

Joined Jun 30, 2021
1,065
His simple requirements tracking requirement is not too complicated but a true firefighting robot is a very complex task that requires the ability to predict the future of a fire using a complex set of variables that interact with other complex sets of variables. It's something our brain/body/sensor can do fairly easily with training but for a machine, it's a problem with lots of deadly corner cases like fully automatic car driving.
Absolutely. I doubt we will anytime soon create any machine that comes close to the flexibility and intelligence of a human being. How do you program a machine for the unexpected, yet humans do it all the time. For example, I live back 18 miles of dirt roads in Arizona. How would a self driving car ever be able to navigate such roads and at the same time avoid pot holes, animals, mud puddles in the road not to mention the contrast between the road and what is not the road is very vague.
 
Top