Comments (5)
The raw calculation is explained in the datasheet but you have to know what they say. Here is the explaining fragment:
RAW_DATA Register (0x03)
Two byte read only register which contains the latest readings from the sensor. The most significant 6 bits of the Byte 0 contain the value of the current through the sensor (0μA to 63μA). The lower 10 bits contain (as computed from the ADC) the readings of the voltage across the sensor with the selected current (1023 = 1.65V).
One thing they don't tell you is that you want the resistance, which is R= V/I. Also implicit is that V scales linearly: 0..1023 ~ 0..1.65V
from ccs811.
Could you explain how I should change the lib to support both wires on the esp32?
from ccs811.
I suggest to refer to e.g. this lib: https://github.com/adafruit/Adafruit_BME280_Library , where this dual option is used.
And note that in the Wire lib you find this in Wire.cpp:
TwoWire::TwoWire(uint8_t bus_num)
:num(bus_num & 1)
...
TwoWire Wire = TwoWire(0);
TwoWire Wire1 = TwoWire(1);
So, only 2 bus numbers are supported, 0 and 1, and they can be called as Wire and Wire1.
In the Adafruit_BME280.h header file you find the overloaded begin definitions:
bool begin();
bool begin(TwoWire *theWire);
bool begin(uint8_t addr);
bool begin(uint8_t addr, TwoWire *theWire);
In my sketch I then start this lib with:
// setting Wire1 to pins sda, scl
Wire1.begin(sda, scl);
...
#define BME280_ADDRESS (0x76)
...
// Initializing Sensor BME280
bool status = bme.begin(BME280_ADDRESS, &Wire1);
if (!status) {
...
I use Wire1 for time critical readings of sensors on a separate task, and Wire for devices that allow a more leisurely pace in the main loop task. Works well on all ESP32s that I have used (ESP32-WROOM, -WROVER, -PICO).
Your lib has now mastered an overnight run, and all went as expected. (Though the data remain puzzling :-/)
from ccs811.
OK, found the quoted fragment, thanks. The public code goes up to calculating the mox resistance, and ends there. The calculation of eco2 and tvoc seems confidential and hidden in the firmware. The firmware is not disclosed, just this binary blob is available?
This is a similar approach to what Bosch is doing with their sensor BME680. The public code goes up to resistance. For their much PRed "air quality number" you need to register with name, address, ... so that you can download a binary blob fitting to the CPU you are using. It still gives you a single number only; I have not seen any published data supporting their claims. Too bad.
For the CCS811 I find it particular strange, that from one single variable - resistance - you calculate two variables, which are correlated to a degree, but also widely different, and are claimed to be two different things.
I am having some doubts!
from ccs811.
The CCS811 is a so-called MOX sensor. This class of sensors has a chemical reaction with the gases (an oxidation/reduction). But not all gasses react with the sensors. Most "Volatile organic compounds" react. This is the TVOC reading. My guess: the firmware controls the current through the MOX paste, and measures the voltage (ADC). Then computes the MOX resistance, and that is an indication for VOC concentration.
But the sensor is insensitive for CO2. The trick is that the CO2 reading assumes the sensor is inside a building (iAQ - indoor air quality), and that humans are the (only) producer of CO2. So the gas sensor measures VOCs, assumes they are from humans, maps that to the amount of humans, and then maps that to the CO2 they would produce.
from ccs811.
Related Issues (20)
- Esp32 Deepsleep confusion HOT 1
- Problem with CCS811 version HOT 1
- CCS811 firmware demoted to version 1.1.0 HOT 3
- Seek help from CCS811
- begin() required before flash() ? HOT 2
- Self over-heating
- Having a simple questions about the CCS811 function when it comes to modes HOT 5
- [Question] Modes, Burn-In - Several Questions HOT 3
- ESP32 ERRO I2C HOT 2
- IC2 Error with nodemcu HOT 2
- LilyGo T5 V2.3 and cjmcu-8128. Unable to flash ccs811 HOT 3
- Sensor faulty or soldering issue? HOT 2
- Issues in CCS811 sensor reading HOT 2
- version checking functions have wrong comment, I think HOT 2
- Readings drift higher over time. HOT 3
- CCS811 Baseline Issues HOT 8
- My CCS811 from CJMCU does not works after flashing comleted. HOT 2
- Can it really be used for co2 monitoring? HOT 2
- C811 baseline HOT 2
- Firmware version not detected HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ccs811.