My Flame detector is constantly sending a high to digital out..need HELP!!

 if (digitalRead(FLAME_DETC_DIO))  //
  {
  digitalWrite(led, LOW);
  delay(5000);
  digitalWrite(led, HIGH);
     
  }
  else                   // Otherwise there is no alert and the LED is shut down
   {
    Serial.println();
    digitalWrite(led, HIGH);
    delay(60000);
    }

What is this supposed to do ?

When there is no flame, you turn the led ON and leave it ON ?

Is this what you want to do ? Is this what you are complaining about ?

" there is no alert and the led is shut down " ..... digitalWrite( led, HIGH ) Okaaaay

From what I've learned on the flame detector acts in reverse on HIGHS and LOWS.My goal is to have led low until the presence of fire..then led should go high. Once High I'm trying to build a delay of 60 seconds so the leds/buzzer sound for the duration of the fire sprinkler and motor controls until the flame is extinguished. .Ignore the // comment for the else statement it was added by mistake.

My goal is to have led low until the presence of fire..then led should go high.

So, what is the problem?

Once High I'm trying to build a delay of 60 seconds so the leds/buzzer sound for the duration of the fire sprinkler and motor controls until the flame is extinguished.

Forget delay(). Read, understand, and embrace the blink without delay philosophy. Especially the embrace part.

Ignore the // comment for the else statement it was added by mistake.

And your delete key is broken?

Reply #22 The problem is that the Led turns on without the presence of any flame/spark. It's initiating the start of the program before it's suppose to. The led/buzzer is initiating without reason...yet if I write a code specifically for the led alone it works fine..soon as that code is entered into my main loop it begins to turn on automatically defeating the purpose of using a flame detector.

Perhaps the following will steer you in the right direction --

//
//  pirtrippoint5sec
//
//  wait for 5 seconds
//  of constant detection
//  ** works  07APR2014 **

unsigned long refTime;
unsigned long trippoint;

const long threshold = 5000;

byte DET;
const byte pirPin = 8;
const byte ledPin = 13;

void setup ()
{
  //pirPin is INPUT by default, use ExtPullup
  pinMode (ledPin,OUTPUT);
  digitalWrite (ledPin,LOW);
}

void loop ()
{
  DET = digitalRead(pirPin);
  if (DET == 1)  // inactive
  {
    refTime = millis();
    trippoint = refTime;
  }
  else   // Active Low
  {
    pir_active();
  }
}

void pir_active ()
{
  trippoint = millis();
  if ((trippoint-refTime) > threshold)
  {
    digitalWrite(ledPin,HIGH);
  }
}

Its object is to wait for 5 seconds of constant detection and then it latches an output On.

Hi,I think you said that you connected the flame detector output to an LED and it worked, does the output need such a load to give an output, that is, is the output an open collector transistor.
Leave the LED in the output circuit of the flame detector and connect the output to the arduino.
Also how are you powering all this, its about time for circuit diagram please.
A CAD or picture of a hand drawn circuit in jpeg, png or pdf will be fine.

Hope to help.

Tom........ :slight_smile:

Reply #24 thanks ill try using some of your code on my program. #25 pin 13 output is going to a 555 timer circuit outputting to 4 LEDs and a 1/4 watt buzzer.(for a pulsing fire alarm affect) I have also tried using different output pins for this 555 timer circuit. Once the 555 turns on I have a initial delay before the motors cut on..which drop a fire door..pause..turn on a water pump...and then the door returns to the original position. I set a delay of 60000ms on pin 13 output once HIGH to symbolize a fire alarm operating during the functions of the motor and water pump to extinguish the fire. I'll get a schematic posted tonight

Here is a rough schematic

The "flame detector"... the details...
Can you provide a link with the "flame detector" details?

You've depicted it with connections to +5, Gnd, a digital pin, and an analog pin.

How about if you simulate the "flame detector" with a switch (or a jumper wire)?

Tom I haven't tried that yet. But like I stated earlier in this post if I run the flame detector Sketch by itself with only the detector and 555 led setup on output pin 13 I can open the serial port and watch the values..it works fine until I add the sketch to the main loop of my program. Im wondering if I'm picking up some pwm on the digital pin 2 where the flame detector is tied in and that is causing the motor shield to read a invalid HIGH in turn initiating the start of the motor program?

http://m.aliexpress.com/item/1521173066.html?tracelog=wwwdetail2mobilesitedetail#description