Arduino library and demo sketch for the BME280 & AMS iAQ Weather Multi-sensor.
In order to access both sensors, the Arduino sketch should include both the BME280 library and this (iAQ-MOD1023) library. Refer to the demo sketch for usage.
The iAQ-MOD1023 uses I2C to communicate with the iAQ sensor. The sensor is constantly performing measurements and will have data stored in its registers, as well information on the data's status.
Retrieve the data all at once by calling
readRegisters();
Call the following functions to get the appropriate values for each item
getPrediction(); //CO2 prediction value
getResistance(); //Sensor resistance
getTVOC(); //total volatile organic compounds in the air (ppb)
Call one of the following functions to determine if the data retrieved is valid.
getStatus();
getStatusByte(); //If you only want a byte
- 0x00/OK = the measurement data is valid
- 0x10/RUNIN = data not valid; sensor is still calibrating
- 0x01/BUSY = sensor is still performing measurements; data may not be valid
- 0x80/ERROR = if this happens frequently, the sensor element may be defective
- Arduino Uno/compatible
- ESP32 Module
- IO21 - SDA
- IO22 - SCL
- ESP8266 Module (ESP7 and ESP12)
- IO5 - SDA
- IO4 - SCL
- SAMD21-based Arduino board
Questions/comments/concerns regarding the code? Raise it up as a new issue and we will help as soon as possible. You may also contact support@embeddedadventures.com or drances@embeddedadventures.com . Thanks!