SCD30 - CO2 sensor

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
Smotek7
Normal user
Posts: 89
Joined: 01 Aug 2020, 16:18
Location: SK

Re: SCD30 - CO2 sensor

#51 Post by Smotek7 » 26 Feb 2022, 14:08

@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.

User avatar
Ath
Normal user
Posts: 1803
Joined: 10 Jun 2018, 12:06
Location: NL

Re: SCD30 - CO2 sensor

#52 Post by Ath » 26 Feb 2022, 14:56

Smotek7 wrote: 26 Feb 2022, 14:08 ... how do I download the .bin with request?
I see files but I don't know how to download it.
- 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 :o

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

User avatar
Ath
Normal user
Posts: 1803
Joined: 10 Jun 2018, 12:06
Location: NL

Re: SCD30 - CO2 sensor

#53 Post by Ath » 26 Feb 2022, 16:43

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.
/Ton

User avatar
Ath
Normal user
Posts: 1803
Joined: 10 Jun 2018, 12:06
Location: NL

Re: SCD30 - CO2 sensor

#54 Post by Ath » 26 Feb 2022, 16:59

Unfortunately, the Github actions build failed, so here are 2 local builds for testing:

Outdated, latest build available from Github
Last edited by Ath on 26 Feb 2022, 23:13, edited 1 time in total.
/Ton

Smotek7
Normal user
Posts: 89
Joined: 01 Aug 2020, 16:18
Location: SK

Re: SCD30 - CO2 sensor

#55 Post by Smotek7 » 26 Feb 2022, 17:26

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.
scd.JPG
scd.JPG (15.06 KiB) Viewed 2205 times

User avatar
Ath
Normal user
Posts: 1803
Joined: 10 Jun 2018, 12:06
Location: NL

Re: SCD30 - CO2 sensor

#56 Post by Ath » 26 Feb 2022, 20:21

The build you downloaded and tested is already outdated :D
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 :lol:
/Ton

User avatar
Ath
Normal user
Posts: 1803
Joined: 10 Jun 2018, 12:06
Location: NL

Re: SCD30 - CO2 sensor

#57 Post by Ath » 13 Apr 2022, 22:17

Smotek7 wrote: 26 Feb 2022, 13:52 I'll test it on one sensor.
Any update on how your tests are progressing?
/Ton

Smotek7
Normal user
Posts: 89
Joined: 01 Aug 2020, 16:18
Location: SK

Re: SCD30 - CO2 sensor

#58 Post by Smotek7 » 13 Apr 2022, 22:37

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

User avatar
Ath
Normal user
Posts: 1803
Joined: 10 Jun 2018, 12:06
Location: NL

Re: SCD30 - CO2 sensor

#59 Post by Ath » 22 Apr 2022, 09:34

Smotek7 wrote: 26 Feb 2022, 13:52 If I understood correctly, automatic calibration takes at least 5 days.
I'm waiting to upload. It goes gradually ...
I'll test it on one sensor.
Any progress with testing this?
/Ton

Smotek7
Normal user
Posts: 89
Joined: 01 Aug 2020, 16:18
Location: SK

Re: SCD30 - CO2 sensor

#60 Post by Smotek7 » 08 May 2022, 21:12

Hi,
I devoted time to something else.
But today I started testing autocalibration.

CaWi
Normal user
Posts: 22
Joined: 03 Jun 2022, 11:27

Re: SCD30 - CO2 sensor

#61 Post by CaWi » 03 Jun 2022, 11:42

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

TD-er
Core team member
Posts: 6341
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: SCD30 - CO2 sensor

#62 Post by TD-er » 03 Jun 2022, 12:00

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)

CaWi
Normal user
Posts: 22
Joined: 03 Jun 2022, 11:27

Re: SCD30 - CO2 sensor

#63 Post by CaWi » 03 Jun 2022, 17:30

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
Bildschirmfoto 2022-06-03 um 16.56.45.png
Bildschirmfoto 2022-06-03 um 16.56.45.png (170.08 KiB) Viewed 891 times

TD-er
Core team member
Posts: 6341
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: SCD30 - CO2 sensor

#64 Post by TD-er » 03 Jun 2022, 17:47

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?

CaWi
Normal user
Posts: 22
Joined: 03 Jun 2022, 11:27

Re: SCD30 - CO2 sensor

#65 Post by CaWi » 11 Jun 2022, 13:36

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. :-(

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 ~ % 
Console error message:

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

When I use the the "espflasher" tool I get the messages:

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)
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

User avatar
Ath
Normal user
Posts: 1803
Joined: 10 Jun 2018, 12:06
Location: NL

Re: SCD30 - CO2 sensor

#66 Post by Ath » 11 Jun 2022, 15:33

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.
/Ton

CaWi
Normal user
Posts: 22
Joined: 03 Jun 2022, 11:27

Re: SCD30 - CO2 sensor

#67 Post by CaWi » 19 Jun 2022, 10:47

@Ath,
wow, now it worked for me out of the box, many thanks! :D

CaWi
Normal user
Posts: 22
Joined: 03 Jun 2022, 11:27

Re: SCD30 - CO2 sensor

#68 Post by CaWi » 20 Jun 2022, 10:17

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? ;-)
Bildschirmfoto 2022-06-20 um 09.35.06.png
Bildschirmfoto 2022-06-20 um 09.35.06.png (60.05 KiB) Viewed 657 times
Bildschirmfoto 2022-06-20 um 09.35.06.png
Bildschirmfoto 2022-06-20 um 09.35.06.png (60.05 KiB) Viewed 657 times
Thanks and regards ....Carsten
Attachments
Bildschirmfoto 2022-06-20 um 09.35.28.png
Bildschirmfoto 2022-06-20 um 09.35.28.png (38.04 KiB) Viewed 657 times

User avatar
Ath
Normal user
Posts: 1803
Joined: 10 Jun 2018, 12:06
Location: NL

Re: SCD30 - CO2 sensor

#69 Post by Ath » 20 Jun 2022, 11:10

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?
/Ton

CaWi
Normal user
Posts: 22
Joined: 03 Jun 2022, 11:27

Re: SCD30 - CO2 sensor

#70 Post by CaWi » 20 Jun 2022, 11:28

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) :shock:
ambient temp here is 25^C
Bildschirmfoto 2022-06-20 um 11.46.21.png
Bildschirmfoto 2022-06-20 um 11.46.21.png (15.18 KiB) Viewed 646 times
Bildschirmfoto 2022-06-20 um 11.46.21.png
Bildschirmfoto 2022-06-20 um 11.46.21.png (15.18 KiB) Viewed 646 times
Bildschirmfoto 2022-06-20 um 11.46.21.png
Bildschirmfoto 2022-06-20 um 11.46.21.png (15.18 KiB) Viewed 646 times
========= EDIT 3
The humidity is also affected from temp offset ...lower temp more humidity (see pic), ambient hum is here 55% :o

Build: ESP_Easy_mega_20220616_test_D_ESP8266_4M1M Jun 16 2022
Attachments
Bildschirmfoto 2022-06-20 um 11.46.41.png
Bildschirmfoto 2022-06-20 um 11.46.41.png (33.98 KiB) Viewed 646 times
Bildschirmfoto 2022-06-20 um 11.46.32.png
Bildschirmfoto 2022-06-20 um 11.46.32.png (31.85 KiB) Viewed 646 times

User avatar
Ath
Normal user
Posts: 1803
Joined: 10 Jun 2018, 12:06
Location: NL

Re: SCD30 - CO2 sensor

#71 Post by Ath » 20 Jun 2022, 12:08

CaWi wrote: 20 Jun 2022, 11:28 No, only one SCD30 sensor and one non active BME280 sensor (deactivated, the temp offset for the BME280 works).
Ok, great.
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) :shock:
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% :o
All technical functionality is left to the device & driver/library used, 'I'm only playing the piano' :lol:, so any behavior, and probably that compensation too, is coming from there, not much I can (or want to) do about it, maybe this behavior is explained in the datasheet of the sensor, but I don't have that available where I am now. Will check later.
/Ton

TD-er
Core team member
Posts: 6341
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: SCD30 - CO2 sensor

#72 Post by TD-er » 20 Jun 2022, 12:14

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.

CaWi
Normal user
Posts: 22
Joined: 03 Jun 2022, 11:27

Re: SCD30 - CO2 sensor

#73 Post by CaWi » 20 Jun 2022, 13:38

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.
Bildschirmfoto 2022-06-20 um 13.25.22.png
Bildschirmfoto 2022-06-20 um 13.25.22.png (185.88 KiB) Viewed 634 times
The offset values is saved incorrectly or could be only without decimal places (X.misssing)?
Bildschirmfoto 2022-06-20 um 13.31.20.png
Bildschirmfoto 2022-06-20 um 13.31.20.png (281.48 KiB) Viewed 634 times

User avatar
Ath
Normal user
Posts: 1803
Joined: 10 Jun 2018, 12:06
Location: NL

Re: SCD30 - CO2 sensor

#74 Post by Ath » 20 Jun 2022, 21:19

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

CaWi
Normal user
Posts: 22
Joined: 03 Jun 2022, 11:27

Re: SCD30 - CO2 sensor

#75 Post by CaWi » 25 Jun 2022, 09:43

Thanks for all helping.
In the last week I did the calibration and it works (after new flashing the ESP) without "Restarting the calibration".

User avatar
Ath
Normal user
Posts: 1803
Joined: 10 Jun 2018, 12:06
Location: NL

Re: SCD30 - CO2 sensor

#76 Post by Ath » 25 Jun 2022, 14:31

Great that it is now working as intended :) and for reporting it here ;)
/Ton

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest