Closed RobTillaart closed 1 year ago
getAddress() and isConnected() tested working fine so far
Looks good!
Current commit implements
bool preHeatDone() returns true 120 seconds after constructor is called.
uint32_t preHeatMillisLeft() returns the time in milliseconds left before preHeat is complete.
ACD10_preheat_test.ino
ACD10_readSensorCode.ino
please give those examples a try
here is the output
those 2 function looks good
The readSensorCode functions should not be printed as HEX as it are chars and digits. I'll change the code.
The other works well.
Changed the signature of the readSensorCode() function added the readSensor() function + some related. added a demo sketch how it can be used.
Please verify.
Still open is calibration, which will be later this week.
Seems the value does not looks OK. Do you agree ?
this may be useful to understand
Seems the value does not looks OK. Do you agree ?
1400 CO2 can easily be true for an indoors level. Furthermore the sensor probably need calibration.
With other CO2 sensors it was needed to be 24++ hrs outside before it gave good readings.
The temperature around 13350 does not make sense to me. I will check the code and the datasheet.
The readSensorCode now looks very informative. We're going in the right direction.
have you updated codebase ? Do you want me to test again ?
As per datasheet it says its pre calibrated . Do we need any manual calibration ? Or do you suggest you leave it power up for 24 hrs to make it calibrated ?
Do you understand why temperature looks odd ?
Also 1400 ppm Co2 in indoor is not very good result unless its due to calibration issue
have you updated codebase ? Do you want me to test again ?
No, tomorrow I'll continue with this lib.
As per datasheet it says its pre calibrated . Do we need any manual calibration ? Or do you suggest you leave it power up for 24 hrs to make it calibrated ?
The latter, datasheet states it calibrates after 24 hrs. After start. I assume it should be outside to have ~400 ppm
Do you understand why temperature looks odd ?
No, not investigated yet. What is the temperature (approx).
Also 1400 ppm Co2 in indoor is not very good result unless its due to calibration issue
It is high but not uncommon level for indoor.
Also 1400 ppm Co2 in indoor is not very good result unless its due to calibration issue
It is high but not uncommon level for indoor.
I understand but i tested it in a large room with myself only thats why i am worried its giving right value or it may sorted after 24hrs of continues run. Its true it does not ran 24 hrs yet after i started using that sensor
Tomorrow i will try outside & let you know the value.
Do you understand why temperature looks odd ?
No, not investigated yet.
What is the temperature (approx).
25 - 28 c
To understand the CO2 concentration and temperature I also read the UART interface in the datasheet.
For I2C the CO2 math uses 4 bytes of the answer. For UART the CO2 math uses 2 bytes of the answer.
As the range support is 400-5000 one should say that 2 bytes is sufficient.
I saw that read temperature is not supported in the UART interface!
( table skips command 2, should that be a hidden / reserved one?)
I need to implement the CRC checking to see if the data fetched is correct. Will try to have a new version today.
@fuzonmedia Hi, I uploaded a new version.
Can you please post the output of all the examples?
The ACD10.cpp file has some commented lines, these could provide more info about the data (CO2 and temperature).
First version of calibration functions included, but I did not review them yet (other tasks need attention). Also no example code for calibration exists.
@fuzonmedia Send an email to aosong as some information is missing in the datasheet. About temperature scale and some differences between UART and I2C interface.
@fuzonmedia Got your email and changed the interface of the library as 80 ms delay is an eternity for a microprocessor. Updated all examples to match the new insights.
Still no information about the temperature, although that could be good after 80 ms too. In fact it might be that only the temperature needs the 80 ms delay. Need to think how to find out.
Can you post the output of the examples as TEXT (not as image) Parts can be useful for documentation.
Ok will do
Sorry for bit delay reply. I am outstation for few days due to holidays here.
@fuzonmedia Any progress to report?
@fuzonmedia I am going to release a 0.1.0 version so more people can provide feedback.
@RobTillaart Sorry for delay reply as I was traveling.
I tested the latest code but it gives some error during compile
21:33:21.219 -> /Users/nil/Downloads/ACD10-master/examples/ACD10_readSensorCode/ACD10_readSensorCode.ino 21:33:21.219 -> ACD10_LIB_VERSION: 0.1.0 21:33:21.219 -> FIRMWARE: AS V1.0.00 21:33:21.219 -> SENSORCODE: 0188152356
This one is working fine as expected
But read sensor one is showing compile error
Remarkable as the build (continuous integration) compiles all examples.
Have you fetched the latest branch.
Yes I tried both 2 branch examples files. Both branch read sensor example shows same error. Can you please check the code again as this issue was not present in the earlier codebase
For which board are you compiling
The examples compile for 5 platforms in the build CI.
See: https://github.com/RobTillaart/ACD10/actions/runs/6419162887/job/17428429730
If your compiler cannot find requestSensor() you are somehow using the old version 0.1.0. Maybe your compiler cached it?
Looking at the screenshot (Please copy TEXT not screenshots of errors) shows your 8266 environment cannot find some .h file.
@RobTillaart Sorry for delay reply as I was traveling.
I tested the latest code but it gives some error during compile
For this I used arduino Uno board
You should download the develop 0.1.1 branch as the error indicates you are using the 0.1.0 master branch.
@fuzonmedia Any progress to report?
@fuzonmedia Merged and released 0.1.1 => update readme.md + some minor edits
I downloaded the latest release but its showing same error
Compiling sketch... /private/var/folders/xs/8m8thf7x4d968sw4vqxp2g5w0000gn/T/AppTranslocation/AC51C3D8-AD07-4EED-B8C3-D26D1FB573F9/d/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/private/var/folders/xs/8m8thf7x4d968sw4vqxp2g5w0000gn/T/AppTranslocation/AC51C3D8-AD07-4EED-B8C3-D26D1FB573F9/d/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/private/var/folders/xs/8m8thf7x4d968sw4vqxp2g5w0000gn/T/AppTranslocation/AC51C3D8-AD07-4EED-B8C3-D26D1FB573F9/d/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard -I/private/var/folders/xs/8m8thf7x4d968sw4vqxp2g5w0000gn/T/AppTranslocation/AC51C3D8-AD07-4EED-B8C3-D26D1FB573F9/d/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src -I/Users/nil/Documents/Arduino/libraries/ACD10-develop /var/folders/xs/8m8thf7x4d968sw4vqxp2g5w0000gn/T/arduino_build_652482/sketch/ACD10_demo.ino.cpp -o /var/folders/xs/8m8thf7x4d968sw4vqxp2g5w0000gn/T/arduino_build_652482/sketch/ACD10_demo.ino.cpp.o /Users/nil/Downloads/ACD10-0.1.1/examples/ACD10_demo/ACD10_demo.ino: In function 'void loop()': ACD10_demo:29:12: error: 'class ACD10' has no member named 'requestSensor'; did you mean 'readSensor'? mySensor.requestSensor(); ^~~~~~~~~~~~~ readSensor ACD10_demo:30:19: error: 'class ACD10' has no member named 'requestReady'; did you mean 'lastRead'? while (mySensor.requestReady() == false) delay(10); ^~~~~~~~~~~~ lastRead Using library Wire at version 1.0 in folder: /private/var/folders/xs/8m8thf7x4d968sw4vqxp2g5w0000gn/T/AppTranslocation/AC51C3D8-AD07-4EED-B8C3-D26D1FB573F9/d/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire Using library ACD10-develop at version 0.1.0 in folder: /Users/nil/Documents/Arduino/libraries/ACD10-develop exit status 1 'class ACD10' has no member named 'requestSensor'; did you mean 'readSensor'?
Compiling sketch... /private/var/folders/xs/8m8thf7x4d968sw4vqxp2g5w0000gn/T/AppTranslocation/AC51C3D8-AD07-4EED-B8C3-D26D1FB573F9/d/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/private/var/folders/xs/8m8thf7x4d968sw4vqxp2g5w0000gn/T/AppTranslocation/AC51C3D8-AD07-4EED-B8C3-D26D1FB573F9/d/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/private/var/folders/xs/8m8thf7x4d968sw4vqxp2g5w0000gn/T/AppTranslocation/AC51C3D8-AD07-4EED-B8C3-D26D1FB573F9/d/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard -I/private/var/folders/xs/8m8thf7x4d968sw4vqxp2g5w0000gn/T/AppTranslocation/AC51C3D8-AD07-4EED-B8C3-D26D1FB573F9/d/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire/src -I/Users/nil/Documents/Arduino/libraries/ACD10-develop /var/folders/xs/8m8thf7x4d968sw4vqxp2g5w0000gn/T/arduino_build_900459/sketch/ACD10_readSensor.ino.cpp -o /var/folders/xs/8m8thf7x4d968sw4vqxp2g5w0000gn/T/arduino_build_900459/sketch/ACD10_readSensor.ino.cpp.o /Users/nil/Downloads/ACD10-0.1.1/examples/ACD10_readSensor/ACD10_readSensor.ino:11:16: warning: invalid conversion from 'TwoWire*' to 'uint8_t {aka unsigned char}' [-fpermissive] ACD10 mySensor(&Wire); // explicit default, not needed. ^~~~~ In file included from /Users/nil/Downloads/ACD10-0.1.1/examples/ACD10_readSensor/ACD10_readSensor.ino:8:0: /Users/nil/Documents/Arduino/libraries/ACD10-develop/ACD10.h:22:3: note: initializing argument 1 of 'ACD10::ACD10(uint8_t, TwoWire*)' ACD10(uint8_t address = ACD10_DEFAULT_ADDRESS, TwoWire *wire = &Wire); ^~~~~ /Users/nil/Downloads/ACD10-0.1.1/examples/ACD10_readSensor/ACD10_readSensor.ino: In function 'void loop()': ACD10_readSensor:32:14: error: 'class ACD10' has no member named 'requestSensor'; did you mean 'readSensor'? mySensor.requestSensor(); ^~~~~~~~~~~~~ readSensor ACD10_readSensor:36:16: error: 'class ACD10' has no member named 'requestReady'; did you mean 'lastRead'? if (mySensor.requestReady()) ^~~~~~~~~~~~ lastRead Using library Wire at version 1.0 in folder: /private/var/folders/xs/8m8thf7x4d968sw4vqxp2g5w0000gn/T/AppTranslocation/AC51C3D8-AD07-4EED-B8C3-D26D1FB573F9/d/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire Using library ACD10-develop at version 0.1.0 in folder: /Users/nil/Documents/Arduino/libraries/ACD10-develop exit status 1 'class ACD10' has no member named 'requestSensor'; did you mean 'readSensor'?
That is a lot of info, need some time to analyze what happens in the code.
Ok I understand . It was my fault. It was pulling library from the old codebase. Now I made it correct
17:01:42.501 -> /Users/nil/Documents/Arduino/libraries/ACD10-0.1.1/examples/ACD10_demo/ACD10_demo.ino 17:01:42.501 -> ACD10_LIB_VERSION: 0.1.1 17:01:42.572 -> 1651 12187 17:01:44.673 -> 1647 12183 17:01:46.766 -> 1643 12186 17:01:48.857 -> 1640 12186 17:01:50.973 -> 1638 12187 17:01:53.048 -> 1637 12186 17:01:55.137 -> 1635 12183 17:01:57.243 -> 1634 12186 17:01:59.324 -> 1632 12183 17:02:01.420 -> 1631 12185 17:02:03.504 -> 1630 12184
This is what I am getting now from 0.1.1
Seems the temperature is still not correct. but Co2 is showing as needed
If you divide temperature by 512. ? Would give ~23.8 °C
Does the CO2 match the testcode you got from aosong?
Does the CO2 match the testcode you got from aosong?
Similar
remarks can be made here