2.4 Flame Sensor
The flame sensor detects the presence of fire or flame by sensing the infrared light emitted from flames. It outputs a digital or analog signal indicating whether a flame is detected.
Example Applications:
- Fire detection in safety systems
- Flame monitoring in industrial burners
- Automatic fire alarms
2.4.1 Example Code for the Flame Sensor
- Start by connecting the flame sensor to one of the available single-pin ports using the provided Type-C cable.
- Choose the corresponding pin on the controller to which the flame sensor is connected, for example,
P0
,P1
, orP2
. - Drag a
ScreenDisplay
block to your workspace first. - Next, drag the
READ
function block from the code blocks section and insert it inside theScreenDisplay
block. - From the dropdown menu in the
READ
block:- Select flame as the sensor type.
- Select the corresponding pin connected to your flame sensor (e.g.,
P0
).
- This setup will:
- Continuously monitor the presence of a flame.
- Display a digital output indicating flame detection in real-time on the screen.

Figure 2.4.1a: Flame sensor reading displayed using block-based code