I'm attaching sensor spec sheet, and I'm trying to get CO2 concentration in ppm. No other data required.
I'm using I2C protocol with Arduino UNO board.
I got 0x61 as a device address, so I used that in the code i wrote below.
#include <Wire.h>
void setup()
{
Wire.begin();
Serial.begin(19200);
}
void loop()
{
Wire.requestFrom(0x61,2);
while(Wire.available())
{
byte c = Wire.read();
Serial.print(c); Serial.print("\n");Serial.print("\n");
}
delay(500);
}
For calibration, need to change ASC(auto-calibration) condition and FRC(forced calibration) condition, with the arguments showed in data sheet. I've never red or written an internal register value of sensor, so I'm having trouble to understand Wire.read and Wire.write functions. Do registers have their own addresses and values?
For example, I could find "Write Header", "Cmd MSB", "Cmd LSB",.... So, Do they have own address I couldn't find?
So, for the tables I'm attaching as PNG files.
- Is "Write Header" a given name from developers?
- Does it have a certain address?
- Is 0xC2 the value what "Write Header" has?
- I could find using beginTransmission(address) function for communicating with sensor registers, the "address" means a certain hex value of "ASC MSB" or "ASC LSB"?
co2_Sensirion_SCD30_Protocol.pdf (1.1 MB)