This tutorial will aid us to learn how to use a flame sensor module on the microbit. A flame sensor is a high sensitive device that can detect infrared rays coming from a fire/flame or other light sources. The flame sensor module we are going to use is highly available online and is based on the YG1006 sensor which is a high speed and high sensitive silicon phototransistor. When the sensor detects a flame, the flame indicator LED will light up and the digital out (D out) pin goes LOW. Detection angle is roughly 60 degrees from the flame sensor.
To use the flame sensor module with the microbit, we only have to attach the Vcc terminal to the pin 3V of the GPIO of the microbit, Gnd to pin GND of the GPIO and D out to pin 0 of the GPIO.
The code to input on MS Make Code is illustrated below: