Sensirion SCD4X family modules

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
sobolkz
Normal user
Posts: 37
Joined: 12 Sep 2019, 16:30

Sensirion SCD4X family modules

#1 Post by sobolkz » 14 Jun 2022, 07:09

Hi all! Is here anybody, who does testing new Sensirion SCD4X modules with ESPEasy? As I understand new sensors are photoacoustic instead SCD30, which NDIR. Is new one using same data protocols?

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

Re: Sensirion SCD4X family modules

#2 Post by TD-er » 14 Jun 2022, 09:12

Have not used those myself, but seeing the price I'm not sure I will soon.
Are there boards available with this sensor? It seems to be hard to solder by hand.
Only to be soldered using reflow oven or hot air I guess, since the pads are below the package.

But I guess someone might easily compare the commands and conversion formulas of both to see if they are the same and if not, the plugin can probably be easily adapted to support the sensor.
Sensirion SCD40 on Mouser (datasheet page 7 & 9)

What is nice however is that this sensor apparently allows for altitude and ambient pressure to compensate the measurements for these environmental parameters in the sensor.
Also it has a temp/humidity sensor inside which can be tuned with some temperature offset to show the correct relative humidity.
Nice sensor, really small for a CO2 sensor and also a low average current consumption.

sobolkz
Normal user
Posts: 37
Joined: 12 Sep 2019, 16:30

Re: Sensirion SCD4X family modules

#3 Post by sobolkz » 14 Jun 2022, 11:18

TD-er wrote: 14 Jun 2022, 09:12 Are there boards available with this sensor? It seems to be hard to solder by hand.
There is many more sellers at Aliexpress, which offers SCD4X as sensor amd ready to use modules:
https://a.aliexpress.com/_9fPZY5
https://a.aliexpress.com/_Aqnk9b
Price is equal for Senseair S8.
Sparkfun offering module too
https://www.sparkfun.com/products/18366
As I understand it's cost also equal to Senseair S8 from EU sellers.

sobolkz
Normal user
Posts: 37
Joined: 12 Sep 2019, 16:30

Re: Sensirion SCD4X family modules

#4 Post by sobolkz » 26 Jun 2022, 17:28

I'm accepting congratulations, just received SCD41 module.
SCD41.jpeg
SCD41.jpeg (133.54 KiB) Viewed 2098 times
TD-er, seems that SCD30 plugin doesn't support SCD4x. I2C scanner report only device at 0x62 addres without definitions.
I'll check with Arduino IDE and inform here.

UPD:
Module are working, Sparkfun SCD4x library was used https://github.com/sparkfun/SparkFun_SC ... no_Library.
Result is:
22:21:31.127 -> CO2(ppm):584 Temperature(C):29.5 Humidity(%RH):51.4
22:21:31.596 -> ........
22:21:35.629 -> CO2(ppm):584 Temperature(C):29.4 Humidity(%RH):52.2
22:21:36.131 -> .........
22:21:40.668 -> CO2(ppm):589 Temperature(C):29.4 Humidity(%RH):52.5
22:21:41.137 -> ........
22:21:45.174 -> CO2(ppm):586 Temperature(C):29.4 Humidity(%RH):53.0
22:21:45.678 -> ........
22:21:49.684 -> CO2(ppm):609 Temperature(C):29.3 Humidity(%RH):53.8
22:21:50.187 -> .........
22:21:54.721 -> CO2(ppm):725 Temperature(C):29.2 Humidity(%RH):55.0
22:21:55.223 -> ........
22:21:59.253 -> CO2(ppm):907 Temperature(C):29.1 Humidity(%RH):56.2
22:21:59.723 -> ........
22:22:03.765 -> CO2(ppm):1022 Temperature(C):29.0 Humidity(%RH):57.2
22:22:04.270 -> .........
22:22:08.769 -> CO2(ppm):1182 Temperature(C):29.0 Humidity(%RH):57.6
22:22:09.272 -> ........
22:22:13.306 -> CO2(ppm):1204 Temperature(C):28.9 Humidity(%RH):58.5
22:22:13.812 -> ........
22:22:17.841 -> CO2(ppm):1237 Temperature(C):28.8 Humidity(%RH):58.8
22:22:18.312 -> .........
22:22:22.847 -> CO2(ppm):1246 Temperature(C):28.9 Humidity(%RH):58.6
CO2 and humidity increasing is reaction to breathing to sensor.
UPD2
Also Sensirion library https://github.com/Sensirion/arduino-i2c-scd4x
was successfully tested. Same result.

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

Re: Sensirion SCD4X family modules

#5 Post by Ath » 26 Jun 2022, 19:53

I have received a SCD40 module this week, will reserve a new plugin id for this, as it doesn't seem feasible to integrate with existing SCD30 code.
Edit: Reserved P135 Environment - SCD4x CO2, Temp, Hum.
/Ton

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

Re: Sensirion SCD4X family modules

#6 Post by TD-er » 26 Jun 2022, 21:15

Ah good to know that the implementation is apparently not too complex to add with the available libraries :)

sobolkz
Normal user
Posts: 37
Joined: 12 Sep 2019, 16:30

Re: Sensirion SCD4X family modules

#7 Post by sobolkz » 27 Jun 2022, 05:26

Ath wrote: 26 Jun 2022, 19:53 I have received a SCD40 module this week, will reserve a new plugin id for this, as it doesn't seem feasible to integrate with existing SCD30 code.
Edit: Reserved P135 Environment - SCD4x CO2, Temp, Hum.
Ton, perfect. I can help with testing.

sobolkz
Normal user
Posts: 37
Joined: 12 Sep 2019, 16:30

Re: Sensirion SCD4X family modules

#8 Post by sobolkz » 30 Jun 2022, 12:49

After few days of testing I can say, that SCD41 CO2 measurements are equal with Senseair S8. But SCD41 more compact and can work directly with I2C at 3.3V instead separate MODBUS for S8 and 5V. It can help with sizie of final devices.

chemmex
Normal user
Posts: 54
Joined: 15 Feb 2019, 16:18

Re: Sensirion SCD4X family modules

#9 Post by chemmex » 03 Aug 2022, 18:23

Ath wrote: 26 Jun 2022, 19:53 I have received a SCD40 module this week, will reserve a new plugin id for this, as it doesn't seem feasible to integrate with existing SCD30 code.
Edit: Reserved P135 Environment - SCD4x CO2, Temp, Hum.
Hi Ton, any chance P135 is ready for testing?

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

Re: Sensirion SCD4X family modules

#10 Post by Ath » 03 Aug 2022, 19:00

I have actually been working on P135 since yesterday, and expect to create a PR tomorrow or the day after, it is working fine already, just adding some features, testing and to write documentation :D

Any specific feature you're looking for?
/Ton

chemmex
Normal user
Posts: 54
Joined: 15 Feb 2019, 16:18

Re: Sensirion SCD4X family modules

#11 Post by chemmex » 03 Aug 2022, 20:01

Well, I am looking especially at the SCD41's single shot mode, so it would be nice to have respective settings for that. I have SCD40 for now, but SCD41 is on the way

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

Re: Sensirion SCD4X family modules

#12 Post by Ath » 03 Aug 2022, 22:50

sobolkz wrote: 30 Jun 2022, 12:49 After few days of testing I can say, that SCD41 CO2 measurements are equal with Senseair S8. But SCD41 more compact and can work directly with I2C at 3.3V instead separate MODBUS for S8 and 5V. It can help with sizie of final devices.
chemmex wrote: 03 Aug 2022, 20:01 Well, I am looking especially at the SCD41's single shot mode, so it would be nice to have respective settings for that. I have SCD40 for now, but SCD41 is on the way
I've made good progress, so created PR #4171.

Changed the category from Environment to Gases, to group it with (most) other CO2 sensors.

The Single-shot measurements is part of the feature set (had it already in before you mentioned it here 8-))

Please provide any feedback via comments in the PR :idea:
/Ton

Haldi_2
Normal user
Posts: 43
Joined: 24 Aug 2020, 18:10

Re: Sensirion SCD4X family modules

#13 Post by Haldi_2 » 18 Aug 2022, 21:51

Ohoooo
Optional Single-shot measurements (take 5 seconds) (only with an SCD41)
Does that mean a battery powered device would actually be feasible with this thingy?
Or does it need a "pre-heating" time of 15-120 seconds when disconnected from power?


Just ordered one and gonna join the fun :)

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

Re: Sensirion SCD4X family modules

#14 Post by Ath » 18 Aug 2022, 22:00

From what I understood from the documentation, it should stay powered on. But the ESP can go in deep sleep mode, and start a measurement at wake-up, wait for the result to arrive (~5 sec.), transmit that, and go back to sleep again.
The Single Shot mode is especially designed for applications like that, AFAICS.
/Ton

chemmex
Normal user
Posts: 54
Joined: 15 Feb 2019, 16:18

Re: Sensirion SCD4X family modules

#15 Post by chemmex » 18 Aug 2022, 23:41

Taking into account the fact that SCD4x stores calibration data in its internal NVRAM, there might be no reason to keep it powered while ESP sleeps. However, I discovered huge (more than 4°C) difference in temperature and humidity readings between first and second samples with SCD40, so would wait until SCD41 arrives and check which mode is better

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

Re: Sensirion SCD4X family modules

#16 Post by Ath » 19 Aug 2022, 09:12

The first reading might indeed be unreliable, have to check the datasheet to be sure. Might need to discard the first read value if that is true. I'll check.
/Ton

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

Re: Sensirion SCD4X family modules

#17 Post by TD-er » 19 Aug 2022, 10:21

Some sensors also use some IIR filter to reduce noise.
This also delays the signal responsiveness a bit.

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

Re: Sensirion SCD4X family modules

#18 Post by Ath » 24 Aug 2022, 10:27

I think development of this plugin is completed.
Wether to add an IIR filter we can decide later, IMHO.

I've updated the PR with some minor code updates, and removed the [TESTING] tag. Any testing feedback is still welcome, of course.
/Ton

chemmex
Normal user
Posts: 54
Joined: 15 Feb 2019, 16:18

Re: Sensirion SCD4X family modules

#19 Post by chemmex » 25 Aug 2022, 01:19

Yes, I think it's time to go to the main repo.

I will do some more tests when SCD41 arrives.

Now, just for curiosity, current consumption graph of SCD40's single measurement
IMG_20220825_020229.jpg
IMG_20220825_020229.jpg (81 KiB) Viewed 867 times

Haldi_2
Normal user
Posts: 43
Joined: 24 Aug 2020, 18:10

Re: Sensirion SCD4X family modules

#20 Post by Haldi_2 » 21 Sep 2022, 19:11

Does anyone have a Testbuild for EPS32 laying around ? :)
last nightly is from early august.

I know there once was a webpage that let you build a ESP easy build with a webinterface for configuration which plugins you want included... but i cant find it anymore :(

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

Re: Sensirion SCD4X family modules

#21 Post by TD-er » 21 Sep 2022, 19:27

Haldi_2 wrote: 21 Sep 2022, 19:11 [...]

I know there once was a webpage that let you build a ESP easy build with a webinterface for configuration which plugins you want included... but i cant find it anymore :(
If you found it, please let me know :)
That way I don't have to make it myself as that's (still) the plan to do.

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

Re: Sensirion SCD4X family modules

#22 Post by Ath » 21 Sep 2022, 19:27

Haldi_2 wrote: 21 Sep 2022, 19:11 Does anyone have a Testbuild for EPS32 laying around ? :)
last nightly is from early august.
The plugin was merged quite recently, any updated build from the Github actions can be used, I'd suggest to use the latest mega merge build: https://github.com/letscontrolit/ESPEas ... 3095834710

Haldi_2 wrote: 21 Sep 2022, 19:11 I know there once was a webpage that let you build a ESP easy build with a webinterface for configuration which plugins you want included... but i cant find it anymore :(
You must be having predictive dreams, as that page has been mostly in our thoughts, but not materialized yet... :lol:
/Ton

Haldi_2
Normal user
Posts: 43
Joined: 24 Aug 2020, 18:10

Re: Sensirion SCD4X family modules

#23 Post by Haldi_2 » 22 Sep 2022, 20:18

Ath wrote: 21 Sep 2022, 19:27 I'd suggest to use the latest mega merge build: https://github.com/letscontrolit/ESPEas ... 3095834710
You must be having predictive dreams, as that page has been mostly in our thoughts, but not materialized yet... :lol:
Oh... that's pretty cool. Didn't know you had auotmated builds.

I kid you not! I Sweat i once used that thingy to create a 1M esp8266 build with BME680 included. Might have been a Tasmota build though....
You first had to start some kind of online docker thingy that then pulls the code from github, then you get a webppage that is run inside the VM to select your configuration then it builds and you can download the Bin.
Was fkn Awesome. No need to install all that build tools on your local machine.

P.S Collection E is the one we want...

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests