Fire detection using ambient light sensor and IR filter

If you specifically want to detect an open flame, like a candle, you look at what makes it visible.

Obviously, it gives off heat above it, compared to sideways, and mainly, it's going to be yellow if it's rich in carbon. Carbon based flames also give off carbon dioxide.

It would be straightforward if you were in a dark room, but not in a room full of other light sources.

If it's an exhibition and you know where the flame is going to appear, it's easier. Use a focused optical sensor against a dark background.

Here's a challenge for you.

There's a move going on to substitute hydrogen for natural gas in boilers etc.
Have you ever seen a hydrogen flame? Probably not as it's invisible. The carbon that gives "normal" flames their colour, isn't there. It's just water vapour. How would you detect a hydrogen flame?

A clue, it's hot and the water vapour condenses. Think cold mirrors.