- All products
- Sensors & Modules
- Flame
- IR Positioning Camera Flame Sensor For Arduino DFRobot - SEN0158
- Flame
Features
- Tracks up to four infrared sources simultaneously.
- Provides X and Y coordinates for detected infrared objects.
- Suitable for robot navigation using infrared transmitters or beacons.
- Can be used for infrared flame detection and flame-position monitoring.
- Simple four-wire connection using the I2C interface.
- High sensitivity to infrared light sources.
- Wide field of view for object-position tracking.
- Compact design for easy integration into electronic projects.
- Compatible with Arduino and other I2C-enabled microcontrollers.
- Suitable for robotics, automation, positioning, and security projects.
- Supports infrared object tracking and direction detection.
Principle of Operation
The SEN0158 contains an infrared positioning sensor that detects infrared light sources within its field of view. Instead of simply reporting whether infrared radiation is present, the sensor processes the detected infrared sources and provides their positions as X and Y coordinates.

The module can detect and track up to four infrared objects at the same time. The coordinates are transmitted to the connected microcontroller through the I2C interface, allowing the user to determine the approximate position and movement of each detected source.
For flame detection applications, the sensor responds to infrared radiation emitted by a flame. The reported coordinates can be used to determine the approximate direction or position of the detected infrared source. Detection performance depends on the flame size, distance, surrounding environment, and other infrared light sources.
Applications
- Robot navigation using infrared transmitters.
- Infrared beacon tracking.
- Flame detection and monitoring projects.
- Fire-fighting robot projects.
- Infrared object positioning.
- Light barrier systems.
- Direction and movement detection.
- Robotics and automation projects.
- Security and monitoring systems.
- Educational electronics experiments.
Pinout

| Pin | Wire Color | Description |
|---|---|---|
| VCC | Red | Power supply input, 3.3V to 5V. |
| SDA | Yellow | I2C data line. |
| SCL | Green | I2C clock line. |
| GND | Black | Ground connection. |
Wiring
The SEN0158 communicates using the I2C interface and requires only four connections. Connect the module's VCC and GND pins to the appropriate power and ground pins on the Arduino, then connect SDA and SCL to the Arduino I2C pins.

| SEN0158 Module | Arduino UNO |
|---|---|
| VCC | 5V |
| GND | GND |
| SDA | A4 / SDA |
| SCL | A5 / SCL |
Note: On Arduino Mega, ESP32, ESP8266, and other boards, the I2C pins may be different. Refer to your microcontroller board documentation for the correct SDA and SCL connections.
Sample Project
When the camera detects an infrared source, it reports the coordinates of the detected object. The sensor can track up to four infrared objects simultaneously, with each detected source assigned to one of four coordinate positions.
The X and Y coordinates can be used to determine the relative position of the infrared source within the sensor's field of view. If a tracked object moves out of the camera's field of view, its coordinate position may return a value such as 1023, 1023 to indicate that no object is currently detected in that position.
This feature is useful for robot navigation and object-tracking applications. For example, a robot can compare the reported X coordinate with the center of the sensor's field of view to determine whether an infrared beacon is located to the left, right, or directly ahead.
Library
No additional Arduino library is required for the basic example. The module communicates using the standard Arduino Wire.h library for I2C communication.
Arduino Code
#include "Wire.h"
int IRsensorAddress = 0xB0;
int slaveAddress;
int ledPin = 13;
boolean ledState = false;
byte data_buf[16];
int i;
int Ix[4];
int Iy[4];
int s;
void Write_2bytes(byte d1, byte d2) {
Wire.beginTransmission(slaveAddress);
Wire.write(d1);
Wire.write(d2);
Wire.endTransmission();
}
void setup() {
slaveAddress = IRsensorAddress >> 1;
Serial.begin(19200);
pinMode(ledPin, OUTPUT);
Wire.begin();
Write_2bytes(0x30, 0x01);
delay(10);
Write_2bytes(0x30, 0x08);
delay(10);
Write_2bytes(0x06, 0x90);
delay(10);
Write_2bytes(0x08, 0xC0);
delay(10);
Write_2bytes(0x1A, 0x40);
delay(10);
Write_2bytes(0x33, 0x33);
delay(10);
delay(100);
}
void loop() {
ledState = !ledState;
digitalWrite(ledPin, ledState);
Wire.beginTransmission(slaveAddress);
Wire.write(0x36);
Wire.endTransmission();
Wire.requestFrom(slaveAddress, 16);
for (i = 0; i < 16; i++) {
data_buf[i] = 0;
}
i = 0;
while (Wire.available() && i < 16) {
data_buf[i] = Wire.read();
i++;
}
Ix[0] = data_buf[1];
Iy[0] = data_buf[2];
s = data_buf[3];
Ix[0] += (s & 0x30) << 4;
Iy[0] += (s & 0xC0) << 2;
Ix[1] = data_buf[4];
Iy[1] = data_buf[5];
s = data_buf[6];
Ix[1] += (s & 0x30) << 4;
Iy[1] += (s & 0xC0) << 2;
Ix[2] = data_buf[7];
Iy[2] = data_buf[8];
s = data_buf[9];
Ix[2] += (s & 0x30) << 4;
Iy[2] += (s & 0xC0) << 2;
Ix[3] = data_buf[10];
Iy[3] = data_buf[11];
s = data_buf[12];
Ix[3] += (s & 0x30) << 4;
Iy[3] += (s & 0xC0) << 2;
for (i = 0; i < 4; i++) {
Serial.print(Ix[i]);
Serial.print(",");
Serial.print(Iy[i]);
if (i < 3) {
Serial.print(",");
}
}
Serial.println("");
delay(15);
}
The example initializes the IR positioning sensor and reads coordinate data for up to four infrared sources. The coordinates are displayed through the Arduino Serial Monitor at 19200 baud.
Technical Specifications
| Parameter | Specification |
|---|---|
| Product Model | DFRobot SEN0158 |
| Sensor Type | IR Positioning Camera / Infrared Tracking Sensor |
| Operating Voltage | 3.3V to 5V |
| Communication Interface | I2C |
| Detecting Distance | 0 to 3 meters |
| Horizontal Detecting Angle | 33° |
| Vertical Detecting Angle | 23° |
| Sensor Resolution | 128 × 96 pixels |
| Object Tracking | Up to 4 infrared sources |
| Dimensions | 32 × 16 mm |
| Microcontroller Compatibility | Arduino and other I2C-enabled microcontrollers |
Important Notes
- The sensor detects infrared sources and reports their relative positions.
- Detection distance depends on the strength and size of the infrared source.
- Strong sunlight and other infrared sources can affect detection performance.
- Flame detection performance depends on the flame size, distance, environment, and other sources of infrared radiation.
- The module should be used for experimental and development projects and is not a replacement for certified fire or safety detection equipment.
- The I2C address used in the example is derived from
0xB0as an 8-bit address.
Resources
Features
- Tracks up to four infrared sources simultaneously.
- Provides X and Y coordinates for detected infrared objects.
- Suitable for robot navigation using infrared transmitters or beacons.
- Can be used for infrared flame detection and flame-position monitoring.
- Simple four-wire connection using the I2C interface.
- High sensitivity to infrared light sources.
- Wide field of view for object-position tracking.
- Compact design for easy integration into electronic projects.
- Compatible with Arduino and other I2C-enabled microcontrollers.
- Suitable for robotics, automation, positioning, and security projects.
- Supports infrared object tracking and direction detection.
Principle of Operation
The SEN0158 contains an infrared positioning sensor that detects infrared light sources within its field of view. Instead of simply reporting whether infrared radiation is present, the sensor processes the detected infrared sources and provides their positions as X and Y coordinates.

The module can detect and track up to four infrared objects at the same time. The coordinates are transmitted to the connected microcontroller through the I2C interface, allowing the user to determine the approximate position and movement of each detected source.
For flame detection applications, the sensor responds to infrared radiation emitted by a flame. The reported coordinates can be used to determine the approximate direction or position of the detected infrared source. Detection performance depends on the flame size, distance, surrounding environment, and other infrared light sources.
Applications
- Robot navigation using infrared transmitters.
- Infrared beacon tracking.
- Flame detection and monitoring projects.
- Fire-fighting robot projects.
- Infrared object positioning.
- Light barrier systems.
- Direction and movement detection.
- Robotics and automation projects.
- Security and monitoring systems.
- Educational electronics experiments.
Pinout

| Pin | Wire Color | Description |
|---|---|---|
| VCC | Red | Power supply input, 3.3V to 5V. |
| SDA | Yellow | I2C data line. |
| SCL | Green | I2C clock line. |
| GND | Black | Ground connection. |
Wiring
The SEN0158 communicates using the I2C interface and requires only four connections. Connect the module's VCC and GND pins to the appropriate power and ground pins on the Arduino, then connect SDA and SCL to the Arduino I2C pins.

| SEN0158 Module | Arduino UNO |
|---|---|
| VCC | 5V |
| GND | GND |
| SDA | A4 / SDA |
| SCL | A5 / SCL |
Note: On Arduino Mega, ESP32, ESP8266, and other boards, the I2C pins may be different. Refer to your microcontroller board documentation for the correct SDA and SCL connections.
Sample Project
When the camera detects an infrared source, it reports the coordinates of the detected object. The sensor can track up to four infrared objects simultaneously, with each detected source assigned to one of four coordinate positions.
The X and Y coordinates can be used to determine the relative position of the infrared source within the sensor's field of view. If a tracked object moves out of the camera's field of view, its coordinate position may return a value such as 1023, 1023 to indicate that no object is currently detected in that position.
This feature is useful for robot navigation and object-tracking applications. For example, a robot can compare the reported X coordinate with the center of the sensor's field of view to determine whether an infrared beacon is located to the left, right, or directly ahead.
Library
No additional Arduino library is required for the basic example. The module communicates using the standard Arduino Wire.h library for I2C communication.
Arduino Code
#include "Wire.h"
int IRsensorAddress = 0xB0;
int slaveAddress;
int ledPin = 13;
boolean ledState = false;
byte data_buf[16];
int i;
int Ix[4];
int Iy[4];
int s;
void Write_2bytes(byte d1, byte d2) {
Wire.beginTransmission(slaveAddress);
Wire.write(d1);
Wire.write(d2);
Wire.endTransmission();
}
void setup() {
slaveAddress = IRsensorAddress >> 1;
Serial.begin(19200);
pinMode(ledPin, OUTPUT);
Wire.begin();
Write_2bytes(0x30, 0x01);
delay(10);
Write_2bytes(0x30, 0x08);
delay(10);
Write_2bytes(0x06, 0x90);
delay(10);
Write_2bytes(0x08, 0xC0);
delay(10);
Write_2bytes(0x1A, 0x40);
delay(10);
Write_2bytes(0x33, 0x33);
delay(10);
delay(100);
}
void loop() {
ledState = !ledState;
digitalWrite(ledPin, ledState);
Wire.beginTransmission(slaveAddress);
Wire.write(0x36);
Wire.endTransmission();
Wire.requestFrom(slaveAddress, 16);
for (i = 0; i < 16; i++) {
data_buf[i] = 0;
}
i = 0;
while (Wire.available() && i < 16) {
data_buf[i] = Wire.read();
i++;
}
Ix[0] = data_buf[1];
Iy[0] = data_buf[2];
s = data_buf[3];
Ix[0] += (s & 0x30) << 4;
Iy[0] += (s & 0xC0) << 2;
Ix[1] = data_buf[4];
Iy[1] = data_buf[5];
s = data_buf[6];
Ix[1] += (s & 0x30) << 4;
Iy[1] += (s & 0xC0) << 2;
Ix[2] = data_buf[7];
Iy[2] = data_buf[8];
s = data_buf[9];
Ix[2] += (s & 0x30) << 4;
Iy[2] += (s & 0xC0) << 2;
Ix[3] = data_buf[10];
Iy[3] = data_buf[11];
s = data_buf[12];
Ix[3] += (s & 0x30) << 4;
Iy[3] += (s & 0xC0) << 2;
for (i = 0; i < 4; i++) {
Serial.print(Ix[i]);
Serial.print(",");
Serial.print(Iy[i]);
if (i < 3) {
Serial.print(",");
}
}
Serial.println("");
delay(15);
}The example initializes the IR positioning sensor and reads coordinate data for up to four infrared sources. The coordinates are displayed through the Arduino Serial Monitor at 19200 baud.
Technical Specifications
| Parameter | Specification |
|---|---|
| Product Model | DFRobot SEN0158 |
| Sensor Type | IR Positioning Camera / Infrared Tracking Sensor |
| Operating Voltage | 3.3V to 5V |
| Communication Interface | I2C |
| Detecting Distance | 0 to 3 meters |
| Horizontal Detecting Angle | 33° |
| Vertical Detecting Angle | 23° |
| Sensor Resolution | 128 × 96 pixels |
| Object Tracking | Up to 4 infrared sources |
| Dimensions | 32 × 16 mm |
| Microcontroller Compatibility | Arduino and other I2C-enabled microcontrollers |
Important Notes
- The sensor detects infrared sources and reports their relative positions.
- Detection distance depends on the strength and size of the infrared source.
- Strong sunlight and other infrared sources can affect detection performance.
- Flame detection performance depends on the flame size, distance, environment, and other sources of infrared radiation.
- The module should be used for experimental and development projects and is not a replacement for certified fire or safety detection equipment.
- The I2C address used in the example is derived from
0xB0as an 8-bit address.



