The CJMCU-811 is an electronic sensor module designed for the measurement of Carbon Dioxide (CO2) concentration levels in indoor environments. This compact module is based on the CCS811 sensor, which is an ultra-low power digital gas sensor solution. The CJMCU-811 is ideal for use in applications such as air quality monitoring, HVAC systems, and smart home automation.
Pin Number | Pin Name | Description |
---|---|---|
1 | VCC | Power supply (3.3V) |
2 | GND | Ground |
3 | SDA | I2C Data |
4 | SCL | I2C Clock |
5 | WAKE | Wake pin (active low) |
6 | INT | Interrupt pin |
7 | RST | Reset pin (active low) |
8 | ADDR | I2C Address selection (floating/low) |
#include <Wire.h>
// CJMCU-811 I2C address (default)
#define CJMCU_811_ADDRESS 0x5A
void setup() {
Wire.begin(); // Initialize I2C
Serial.begin(9600); // Start serial communication at 9600 baud rate
// Wake up CJMCU-811 sensor
pinMode(2, OUTPUT); // Use digital pin 2 to control WAKE
digitalWrite(2, LOW); // Set to LOW to wake up the sensor
}
void loop() {
// Read CO2 concentration from CJMCU-811
Wire.beginTransmission(CJMCU_811_ADDRESS);
Wire.write(0x02); // Point to the data register
Wire.endTransmission();
Wire.requestFrom(CJMCU_811_ADDRESS, 4); // Request 4 bytes of data
if (Wire.available() == 4) {
// Read the data - high byte first
int co2High = Wire.read();
int co2Low = Wire.read();
int co2 = (co2High << 8) + co2Low;
// Output the CO2 concentration to the serial monitor
Serial.print("CO2 Concentration: ");
Serial.print(co2);
Serial.println(" ppm");
}
delay(2000); // Wait for 2 seconds before reading again
}
Q: Can the CJMCU-811 be used with a 5V microcontroller? A: Yes, but level shifters should be used on the I2C lines to protect the sensor.
Q: How often should the sensor be calibrated? A: Calibration frequency depends on the application, but typically once before initial use and periodically according to the manufacturer's recommendations.
Q: What is the default I2C address of the CJMCU-811? A: The default I2C address is 0x5A. If the ADDR pin is connected to ground, the alternate address is 0x5B.
Q: How long does the sensor need to warm up? A: The sensor requires a warm-up period of at least 20 minutes for stable operation after being powered on.