if i light a candle and get that closer to the sensor, it shows upto 998, 1000..it cant differentiate between light and flame.. if i take it into a bright room, the reading shows 400, 500..if i am going to show some demo, then i have to show it only in a normal lighting room it seems..
13 corresponds to motor wheels..7 corresponds to 12V DC Brushless fan..if it senses fire, it stops and the fan starts rotating thus extinguishing fire..
it works...but not in a brighter room/outdoors.. any help??
i said what i got...if the room is brighter , i get 400 - 500 reading..but if i light a candle and take that upto certain level ( nearer to the sensor ) say 5cm, the reading shoots up to 900-1000...if the intensity gets lowered, the reading comes to 400-500..at this stage it cant differentiate between flame and brightness..
i am using 5v supply from arduino atmega 8. i connected it to analog pin 5 and then opened serial monitor after making vcc and gnd connections.. then i obtained the above mentioned readings..
The spec you listed, then, shows the range to be 20 cm. Is this, or is it not, consistent with the range that the sensor is actual able to detect the flame (vs. bright ambient light)?
you noticed "fire" but forgot to notice that the fire is from a "candle".. no fire from candle can fume up if air is blown towards it..if i am in earth, this is the fact..and i am in earth infact
13 corresponds to motor wheels..7 corresponds to 12V DC Brushless fan..if it senses fire, it stops and the fan starts rotating thus extinguishing fire..
Here's a tip. Use constants.
const byte MOTOR = 13;
const byte FAN = 7;
const int UPPER_THRESHOLD = 400;
const int LOWER_THRESHOLD = 100;
if (val > UPPER_THRESHOLD)
{
digitalWrite (MOTOR, LOW);
digitalWrite (FAN, HIGH);
}
if (val < LOWER_THRESHOLD)
{
digitalWrite (MOTOR, HIGH);
digitalWrite (FAN, LOW);
}
i light a candle and take that upto certain level ( nearer to the sensor ) say 5cm, the reading shoots up to 900-1000...if the intensity gets lowered, the reading comes to 400-500..at this stage it cant differentiate between flame and brightness..
How do you lower a candle's intensity? You seem to be saying that the sensor reading goes up when a flame is near it. Isn't that what is supposed to happen?
Well, when using just one sensor the ambient light will have an effect.
One way is to add another sensor which is physically offset, ie 30 degrees, so you measure the difference and act when the difference is more than x
Off course you could also do this with one sensor, read the ambient light at the start, then act when it is more than x, just not as likely to be as reliable in real lift, but cheaper