element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Logic for flame sensor which is mounted on 4 DOF robotic arm ,so when flame gets detected it should lock /follow the flame
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 6 replies
  • Subscribers 387 subscribers
  • Views 14831 views
  • Users 0 members are here
  • mega
  • embedded c
  • robotics
  • robot
  • projects
  • programming
  • arduino_code
  • code
  • adafruit
  • sensor
Related

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

headhoe_15
headhoe_15 over 2 years ago

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..
a image of code has been attached here so feel free to correct the code. 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 ??????

#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);
  }
}

  • Sign in to reply
  • Cancel

Top Replies

  • shabaz
    shabaz over 2 years ago +3
    Regarding " i just only need the help in following / tracking of the flame once its get detected " isn't that the main, core part of the project? Your code lines 20-25 already implement your algorithm…
  • beacon_dave
    beacon_dave over 2 years ago +3
    Perhaps if you were to read the other 4 sensor channels as well, then you can detect the flame moving to the left or to the right and then move your robot arm in the same direction until it is back in…
  • shabaz
    shabaz over 2 years ago in reply to beacon_dave +2
    Probably some college project! I remember doing a course for a few months at some college in the middle of nowhere (Bracknell) where they wanted you to track a microwave source, i.e. exactly the same thing…
Parents
  • shabaz
    shabaz over 2 years ago

    Regarding "i just only need the help in following / tracking of the flame once its get detected"

    isn't that the main, core part of the project? 

    Your code lines 20-25 already implement your algorithm* to identify the direction. If you want to move some device to orient itself into that direction, look up something called 'inverse kinematics'. It involves you coming up with a model (formula) that can take the angle (from your line 20) and translate that into the angle that your robot arm needs to move, in a number of motion axes (depends on your robot arm). You can do some of it with a pen and paper, drawing the mechanism of your arm, and then using trigonometry. And then implementing that inside your code. Note: It won't necessarily be easy. If this is a school project then get someone good at trigonometry to help you. It's high-school level of maths, so not overly difficult, but requires someone to put some effort in.

    *That algorithm could be improved too. It's up to you how sophisticated you make it. You'll soon discover how you may wish to improve it, if you use (say) the Arduino plotting tool to see sensor values in real life, with a flame or other heat source.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Cancel
  • headhoe_15
    headhoe_15 over 2 years ago in reply to shabaz

    hey listen , can you suggest a more detail on how to code the flame tracking movement of  robotic arm when the fire is detected through the 5 channel flame sensor ...?????

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • headhoe_15
    headhoe_15 over 2 years ago in reply to shabaz

    hey listen , can you suggest a more detail on how to code the flame tracking movement of  robotic arm when the fire is detected through the 5 channel flame sensor ...?????

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube