SCD30 - CO2 sensor
Moderators: grovkillen, Stuntteam, TD-er
Re: SCD30 - CO2 sensor
@Ath
Sorry for the beginner question, but how do I download the .bin with request?
I see files but I don't know how to download it.
Sorry for the beginner question, but how do I download the .bin with request?
I see files but I don't know how to download it.
Re: SCD30 - CO2 sensor
- Go to the PR #3965
- Scroll to the bottom, where it says "All checks have passed", and click the "Show all checks" link, then they will fold out.
- Select on of the "Details" links, the first one will do fine, it will show you the output of that build step.
- Click on the "Summary" link, left above the list of build steps.
- The right side will now show a schema of the build process, and a list of Artifacts.
- Download the Binaries(.zip) file from that list, it is ~660 MB in size.
- Extract the build you need, Binaries.zip contains a .zip file for each build, so you will need to get a 'test_d' .zip file, for the ESP model and flash you are using, as only that build contains this plugin.
- Extract the .bin from that zip, and upload. You can also upload the .bin.gz via OTA (Tools/Update Firmware button) when using a 4MB flash or bigger. (ESP32 doesn't have the .bin.gz file)
s
--------------------
For forced recalibration factor and manual/automatic calibration I already added the commands in this PR

I'll also add getMeasurementInterval and setMeasurementInterval commands (I'll abbreviate a bit) and also a Device configuration setting, as that does seem useful/appropriate to me.
/Ton
Re: SCD30 - CO2 sensor
Added commands 'scdgetinterval' and 'scdsetinterval', and a setting to pre-configure that.
Fixed a bug in the previous commit for handling command 'scdsetfrc'.
See PR #3965 for downloads, once the build has completed.
Fixed a bug in the previous commit for handling command 'scdsetfrc'.
See PR #3965 for downloads, once the build has completed.
/Ton
Re: SCD30 - CO2 sensor
Unfortunately, the Github actions build failed, so here are 2 local builds for testing:
Outdated, latest build available from Github
Outdated, latest build available from Github
Last edited by Ath on 26 Feb 2022, 23:13, edited 1 time in total.
/Ton
Re: SCD30 - CO2 sensor
I didn't know I had to click on Summary
I updated one sensor.
Activated ASC (The ABC label is probably a mistake)
scdgetabc now returns 1
I'll see what changes over time.
I can test on another scdsetfrc sensor
The question is when I set it, how do I verify if the value is in the sensor?
It could also display this value on the web.
I have an application note for calibration.
I don't understand what the scdsetcalibration setting mode is for.
If the Sensorion application is used
there is only a set ASC and a set FRC value.
I updated one sensor.
Activated ASC (The ABC label is probably a mistake)
scdgetabc now returns 1
I'll see what changes over time.
I can test on another scdsetfrc sensor
The question is when I set it, how do I verify if the value is in the sensor?
It could also display this value on the web.
I have an application note for calibration.
I don't understand what the scdsetcalibration setting mode is for.
If the Sensorion application is used
there is only a set ASC and a set FRC value.
Re: SCD30 - CO2 sensor
The build you downloaded and tested is already outdated
I have just pushed some more commits (and earlier too, fixing that ABC to ASC and a bug inn setting the FRC), hopefully this time Github actions won't fail for no apparent reason.
Please re-download and test the latest build from the PR, TIA!
Edit: Build succeeded, so go ahead

I have just pushed some more commits (and earlier too, fixing that ABC to ASC and a bug inn setting the FRC), hopefully this time Github actions won't fail for no apparent reason.
Please re-download and test the latest build from the PR, TIA!
Edit: Build succeeded, so go ahead

/Ton
Re: SCD30 - CO2 sensor
I tested FRC on 2 sensors, it works properly.
I did not test the ASC because the sensor needs to have a reference value for a certain time of day.
Then I have to prepare the environment, I can't try it in one place at home.
The function is intended sooner for office buildings where the building is emptied at night and CO2 drops to 400ppm
I did not test the ASC because the sensor needs to have a reference value for a certain time of day.
Then I have to prepare the environment, I can't try it in one place at home.
The function is intended sooner for office buildings where the building is emptied at night and CO2 drops to 400ppm
Re: SCD30 - CO2 sensor
Hi,
I devoted time to something else.
But today I started testing autocalibration.
I devoted time to something else.
But today I started testing autocalibration.
Re: SCD30 - CO2 sensor
Hi all,
first, thanks for your work for the SCD30 sensor.
But I had a little problem to get the data from the sensor. In easyesp (https://github.com/letscontrolit/ESPEasy/releases last release)I can choose the "Gases - CO2 Senseair", enable it and use the I2C protocol.
I tried all I2C addresses without success.
After some searching I fond in the dataset the the sensor uses 0x61 but it is not choosable in the drop down menu.
The I2C scanner (under tool menu) shows me also 0x61. A short sketch with Adafruit SCD30 library shows me Co2, Temp, Hum.
So, made I a thought error here or is there some other config needed?
Best regards ...Carsten
first, thanks for your work for the SCD30 sensor.
But I had a little problem to get the data from the sensor. In easyesp (https://github.com/letscontrolit/ESPEasy/releases last release)I can choose the "Gases - CO2 Senseair", enable it and use the I2C protocol.
I tried all I2C addresses without success.

The I2C scanner (under tool menu) shows me also 0x61. A short sketch with Adafruit SCD30 library shows me Co2, Temp, Hum.
So, made I a thought error here or is there some other config needed?
Best regards ...Carsten
Re: SCD30 - CO2 sensor
The SCD30 is not a SenseAir sensor.
The SenseAir plugin supports sensors like the S8 and S11 (also called "Sunrise")
These SenseAir sensors typically can be used via a serial (UART) connection.
ESPEasy also supports an I2C to UART bridge, but I do agree that this can be made a bit more clear what the "I2C" selection actually means for "Serial" sensors.
However, to begin with, you choose the wrong plugin. You need the SCD30 plugin.
See: https://espeasy.readthedocs.io/en/lates ... #p117-page
This one is only included in "Testing D" builds, or the "MAX" build (a build containing all, for ESP32 with 16M flash)
The SenseAir plugin supports sensors like the S8 and S11 (also called "Sunrise")
These SenseAir sensors typically can be used via a serial (UART) connection.
ESPEasy also supports an I2C to UART bridge, but I do agree that this can be made a bit more clear what the "I2C" selection actually means for "Serial" sensors.
However, to begin with, you choose the wrong plugin. You need the SCD30 plugin.
See: https://espeasy.readthedocs.io/en/lates ... #p117-page
This one is only included in "Testing D" builds, or the "MAX" build (a build containing all, for ESP32 with 16M flash)
Re: SCD30 - CO2 sensor
Hi,
thanks for your answer.
Yes you're so right and I was to stupid to choose the right plugin and this can't work with my SCD30 ... head bashing (was really to late yesterday).
I read the plugin name so often and did not recognises that I'm using the wrong.
Choosing the right "bin" and choosing the right plugin and it works (after a cold restart) as expected out of the box, THANKS!
My FHEM installation shows now all data from the sensor.
What I have noticed is that some of the changes needs a cold start from the ESP/Sensor with settings for FHEM but if all configured it works like a perfect.
One last question, today I use a ESP8266 D1 mini (https://www.az-delivery.de/products/d1-mini) and tried also a ESP32 Dev Cit v4 (https://www.az-delivery.de/products/esp-32-dev-kit-c-v4) without success, the "bin" (ESP_Easy_mega_20220427_test_D_ESP32_4M316k) restarts always on this device. How to find out the Problem?
SORRY for wasting your time but without your BIG hint I would be trying some some without success.
Best regards ...Carsten
thanks for your answer.
Yes you're so right and I was to stupid to choose the right plugin and this can't work with my SCD30 ... head bashing (was really to late yesterday).
I read the plugin name so often and did not recognises that I'm using the wrong.

Choosing the right "bin" and choosing the right plugin and it works (after a cold restart) as expected out of the box, THANKS!
My FHEM installation shows now all data from the sensor.

What I have noticed is that some of the changes needs a cold start from the ESP/Sensor with settings for FHEM but if all configured it works like a perfect.

One last question, today I use a ESP8266 D1 mini (https://www.az-delivery.de/products/d1-mini) and tried also a ESP32 Dev Cit v4 (https://www.az-delivery.de/products/esp-32-dev-kit-c-v4) without success, the "bin" (ESP_Easy_mega_20220427_test_D_ESP32_4M316k) restarts always on this device. How to find out the Problem?
SORRY for wasting your time but without your BIG hint I would be trying some some without success.
Best regards ...Carsten
Re: SCD30 - CO2 sensor
When flashing via serial to an ESP32, you need to flash the version with "factory" in the filename of the bin you like to flash.
Later, if you plan to update the firmware via the web interface, you have to use the files without the "factory" in the name.
N.B. always use the same flash layout and filesystem (LittleFS is another filesystem, SPIFFS is the default file system)
If not, then the existing settings will be erased.
By the way, what settings you did needed a reboot of the ESP to function?
Later, if you plan to update the firmware via the web interface, you have to use the files without the "factory" in the name.
N.B. always use the same flash layout and filesystem (LittleFS is another filesystem, SPIFFS is the default file system)
If not, then the existing settings will be erased.
By the way, what settings you did needed a reboot of the ESP to function?
Re: SCD30 - CO2 sensor
EDIT POST by myself
===============
Sorry for the late reply, i am always in Bonn during the week (Berlin - Bonn - Berlin) and at the weekend the family comes first, so i don't have much time to experiment with the ESP32.
Thanks for the "factory hint". Today I tried it it again without success.
Console error message:
When I use the the "espflasher" tool I get the messages:
If I flash the esp with the chrome browser (https://td-er.nl/ESPEasy/) it flashed right and it is working but there is no SCD30 plugin (version 20211105). 
To your question first I configured the sensor and it shows after a reboot the messaged data. Then I configured the "Controller" (FHEM) but my FHEM installation can't geht the data. After a physically power down (disconnect from the power) them was able to get the data.
So my next steps I get the esp32 working but I had still no ideas ... will more searching in the internet what the error means.
Best regards ...Carsten
===============
Sorry for the late reply, i am always in Bonn during the week (Berlin - Bonn - Berlin) and at the weekend the family comes first, so i don't have much time to experiment with the ESP32.
Thanks for the "factory hint". Today I tried it it again without success.

Code: Select all
carsten@Carstens-MBP ~ % esptool.py -p /dev/tty.usbserial-0001 -b 460800 --before default_reset --after hard_reset --chip esp32 write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x0000 ~/Downloads/ESPEasy_binaries_build_output/ESP_Easy_mega_20220427_test_D_ESP32-wrover-kit_4M316k-factory.bin
esptool.py v4.1
Serial port /dev/tty.usbserial-0001
Connecting...................
Chip is ESP32-D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: c8:c9:a3:d2:44:ec
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Flash will be erased from 0x00000000 to 0x001c0fff...
Compressed 1838416 bytes to 1029853...
Wrote 1838416 bytes (1029853 compressed) at 0x00000000 in 27.4 seconds (effective 536.3 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
carsten@Carstens-MBP ~ %
Code: Select all
rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DOUT, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:10124
load:0x40080400,len:5856
entry 0x400806a8
Code: Select all
Using '/dev/cu.usbserial-0001' as serial port.
Connecting.........
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting............
Detecting chip type... ESP32
Connecting...........
Chip Info:
- Chip Family: ESP32
- Chip Model: ESP32-D0WDQ6 (revision 1)
- Number of Cores: 2
- Max CPU Frequency: 240MHz
- Has Bluetooth: YES
- Has Embedded Flash: NO
- Has Factory-Calibrated ADC: YES
- MAC Address: C8:C9:A3:D2:44:EC
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
- Flash Size: 4MB
Unexpected error: The firmware binary is invalid (magic byte=00, should be E9)

To your question first I configured the sensor and it shows after a reboot the messaged data. Then I configured the "Controller" (FHEM) but my FHEM installation can't geht the data. After a physically power down (disconnect from the power) them was able to get the data.

So my next steps I get the esp32 working but I had still no ideas ... will more searching in the internet what the error means.
Best regards ...Carsten
Re: SCD30 - CO2 sensor
please download a version *after* 2022-04-27, for ESP32 there have been fixes that are quite 'usable'.
You can download from Github Actions build, I just selected the most recent PR build there: https://github.com/letscontrolit/ESPEas ... 2479937379 (you need to be logged in to Github to be able to download)
Then use the similar flash command you just showed, with the similarly named .factory.bin file from the binaries.zip you download from the Github link.
You can download from Github Actions build, I just selected the most recent PR build there: https://github.com/letscontrolit/ESPEas ... 2479937379 (you need to be logged in to Github to be able to download)
Then use the similar flash command you just showed, with the similarly named .factory.bin file from the binaries.zip you download from the Github link.
/Ton
Re: SCD30 - CO2 sensor
@Ath,
wow, now it worked for me out of the box, many thanks!
wow, now it worked for me out of the box, many thanks!

Re: SCD30 - CO2 sensor
Did some one test to adjust the temp offset for the sensor?
My sensor shows to high temperature so the offset should set to -1.50°C but it seems not working.
Is there a trick?
Thanks and regards ....Carsten
My sensor shows to high temperature so the offset should set to -1.50°C but it seems not working.
Is there a trick?

- Attachments
-
- Bildschirmfoto 2022-06-20 um 09.35.28.png (38.04 KiB) Viewed 744 times
Re: SCD30 - CO2 sensor
I quickly checked the plugin code, and the temp offset is supplied to the sensor driver at startup, and using the 'scdgettmp' command, retrieves it from that same driver again.
Do you have multiple SDC30 sensor-tasks configured (and active) on that ESP, where the first one doesn't have the offset configured?
Do you have multiple SDC30 sensor-tasks configured (and active) on that ESP, where the first one doesn't have the offset configured?
/Ton
Re: SCD30 - CO2 sensor
Thanks,
that was what I read in the docs.
No, only one SCD30 sensor and one non active BME280 sensor (deactivated, the temp offset for the BME280 works).
========= EDIT
offset in positive is also not working
========= EDIT 2
strange, now offset from 20 and the temp is falling down (it takes some more time that the sensor makes the offset)
ambient temp here is 25^C ========= EDIT 3
The humidity is also affected from temp offset ...lower temp more humidity (see pic), ambient hum is here 55%
Build: ESP_Easy_mega_20220616_test_D_ESP8266_4M1M Jun 16 2022
that was what I read in the docs.
No, only one SCD30 sensor and one non active BME280 sensor (deactivated, the temp offset for the BME280 works).
========= EDIT
offset in positive is also not working
========= EDIT 2
strange, now offset from 20 and the temp is falling down (it takes some more time that the sensor makes the offset)

ambient temp here is 25^C ========= EDIT 3
The humidity is also affected from temp offset ...lower temp more humidity (see pic), ambient hum is here 55%

Build: ESP_Easy_mega_20220616_test_D_ESP8266_4M1M Jun 16 2022
- Attachments
-
- Bildschirmfoto 2022-06-20 um 11.46.41.png (33.98 KiB) Viewed 733 times
-
- Bildschirmfoto 2022-06-20 um 11.46.32.png (31.85 KiB) Viewed 733 times
Re: SCD30 - CO2 sensor
Ok, great.
All technical functionality is left to the device & driver/library used, 'I'm only playing the piano'CaWi wrote: ↑20 Jun 2022, 11:28 strange, now offset from 20 and the temp is falling down (it takes some more time that the sensor makes the offset)![]()
ambient temp here is 25^C
========= EDIT 3
The humidity is also affected from temp offset ...lower temp more humidity (see pic), ambient hum is here 55%![]()

/Ton
Re: SCD30 - CO2 sensor
The relation between temperature and humidity is how it should be.
Air can only hold so much water per liter depending on the temperature.
With lower temperature, this maximum amount of water it can hold also gets lower.
Given some amount of water in the air, there is a lowest temperature at which the water in the air will condensate.
This is called the dew point temperature.
You will see water condensate on colder surfaces, like a window or your glasses when you walk from cold air outside to a warm a humid room.
Since the humidity is relative to the temperature, we always refer to the relative humidity in %.
At 100% the water in the air will condensate.
What the temperature compensation does on a sensor that measures both temperature and relative humidity is this:
- Compute absolute humidity based on measured temperature and relative humidity.
- Change temperature value according to the compensation value
- Compute relative humidity from absolute humidity and changed temperature.
Air can only hold so much water per liter depending on the temperature.
With lower temperature, this maximum amount of water it can hold also gets lower.
Given some amount of water in the air, there is a lowest temperature at which the water in the air will condensate.
This is called the dew point temperature.
You will see water condensate on colder surfaces, like a window or your glasses when you walk from cold air outside to a warm a humid room.
Since the humidity is relative to the temperature, we always refer to the relative humidity in %.
At 100% the water in the air will condensate.
What the temperature compensation does on a sensor that measures both temperature and relative humidity is this:
- Compute absolute humidity based on measured temperature and relative humidity.
- Change temperature value according to the compensation value
- Compute relative humidity from absolute humidity and changed temperature.
Re: SCD30 - CO2 sensor
Many thanks for the explanation.
Some other observation:
Offset with "-" number values not working
if I use the "+" offset value for the "calibration" (wrong way round) the temp goes slowly down to the right value AND when the "calibrated" value is reached the sensor lost the right showing temp and starts from the beginninnig ... count down again to the "calibrated" value .... and again. The offset values is saved incorrectly or could be only without decimal places (X.misssing)?
Some other observation:
Offset with "-" number values not working
if I use the "+" offset value for the "calibration" (wrong way round) the temp goes slowly down to the right value AND when the "calibrated" value is reached the sensor lost the right showing temp and starts from the beginninnig ... count down again to the "calibrated" value .... and again. The offset values is saved incorrectly or could be only without decimal places (X.misssing)?
Re: SCD30 - CO2 sensor
You might want to compare your notes with the documentation available at Sensirion, especially the Field Calibration application note might be helpful: https://sensirion.com/products/catalog/SCD30/
/Ton
Re: SCD30 - CO2 sensor
Thanks for all helping.
In the last week I did the calibration and it works (after new flashing the ESP) without "Restarting the calibration".
In the last week I did the calibration and it works (after new flashing the ESP) without "Restarting the calibration".
Re: SCD30 - CO2 sensor
I'm done, thanks for your help! 

Re: SCD30 - CO2 sensor
A little problem,
Ambiente temp is 27°and the SCD30 shows 31°
The temp offset is set to -4.00°
Is there a bug with the temp offset?
Settings: scdgettemp outpt: I remember the that I saw this before ... actual FW: ESP_Easy_mega_20220809_collection_D_ESP8266_4M1M Aug 9 202
I didn't know what I'm doing wrong with the forum sw.
Ambiente temp is 27°and the SCD30 shows 31°
The temp offset is set to -4.00°
Is there a bug with the temp offset?
Settings: scdgettemp outpt: I remember the that I saw this before ... actual FW: ESP_Easy_mega_20220809_collection_D_ESP8266_4M1M Aug 9 202
I didn't know what I'm doing wrong with the forum sw.

- Attachments
-
- Bildschirmfoto 2022-08-13 um 17.20.20.png (6.76 KiB) Viewed 35 times
Re: SCD30 - CO2 sensor
I've had a look at the code, and the plugin is doing everything as expected, it's the SCD30 sensor (and library) that has a twist:
Code: Select all
if (offset_degC >= 0)
{
offset_centiDegC = (uint16_t)offset_degC * 100;
return sendCommandArguments(COMMAND_SCD30_TEMPERATURE_OFFSET, offset_centiDegC);
}
else
{
return ERROR_SCD30_INVALID_VALUE;
}
This is not reflected in the plugin behavior, but can be changed.
/Ton
Re: SCD30 - CO2 sensor
Thanks for looking to the code and confirming this behaviour.
I'm not able to correct the code so did you have a solution form me (us)?
Around 4°C difference is very much ... on or two would be ok for terrarium (second one) but 4 is to heavy.
Best regards ...Carsten
I'm not able to correct the code so did you have a solution form me (us)?
Around 4°C difference is very much ... on or two would be ok for terrarium (second one) but 4 is to heavy.
Best regards ...Carsten
Re: SCD30 - CO2 sensor
I'm not sure if this either can or needs to be 'fixed' as the chip doesn't allow negative compensation. It can be a relative value, so what is the result if you set it to 4?
/Ton
Re: SCD30 - CO2 sensor
Value set to 4:

scdgettmp:

Who is online
Users browsing this forum: Ahrefs [Bot] and 5 guests