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.
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.
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.
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
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?