The Gravity: ENS160 Air Quality Sensor, manufactured by DFRobot, is a digital sensor designed to measure air quality by detecting various gases and volatile organic compounds (VOCs) in the environment. It provides accurate and reliable data, making it ideal for applications such as indoor air quality monitoring, HVAC systems, and smart home devices.
Parameter | Value |
---|---|
Supply Voltage | 3.3V - 5V |
Operating Current | < 20mA |
Interface | I2C |
I2C Address | 0x53 |
Measurement Range | 0 - 500 IAQ (Indoor Air Quality) |
Operating Temperature | -40°C to 85°C |
Dimensions | 30mm x 22mm |
Pin | Name | Description |
---|---|---|
1 | VCC | Power supply (3.3V - 5V) |
2 | GND | Ground |
3 | SDA | I2C data line |
4 | SCL | I2C clock line |
Below is a sample code to interface the Gravity: ENS160 Air Quality Sensor with an Arduino UNO:
#include <Wire.h>
// I2C address of the ENS160 sensor
#define ENS160_ADDRESS 0x53
void setup() {
// Initialize serial communication at 9600 baud rate
Serial.begin(9600);
// Initialize I2C communication
Wire.begin();
// Initialize the ENS160 sensor
initENS160();
}
void loop() {
// Read air quality data from the sensor
int airQuality = readAirQuality();
// Print the air quality data to the serial monitor
Serial.print("Air Quality: ");
Serial.println(airQuality);
// Wait for 1 second before the next reading
delay(1000);
}
void initENS160() {
// Send initialization commands to the ENS160 sensor
Wire.beginTransmission(ENS160_ADDRESS);
Wire.write(0x00); // Example command to initialize the sensor
Wire.endTransmission();
}
int readAirQuality() {
int airQuality = 0;
// Request air quality data from the ENS160 sensor
Wire.beginTransmission(ENS160_ADDRESS);
Wire.write(0x01); // Example command to read air quality data
Wire.endTransmission();
// Read the data from the sensor
Wire.requestFrom(ENS160_ADDRESS, 2);
if (Wire.available() == 2) {
airQuality = Wire.read() << 8 | Wire.read();
}
return airQuality;
}
By following this documentation, users can effectively integrate and utilize the Gravity: ENS160 Air Quality Sensor in their projects, ensuring accurate and reliable air quality measurements.