Sensirion SCD4X family modules
Moderators: grovkillen, Stuntteam, TD-er
Sensirion SCD4X family modules
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?
Re: Sensirion SCD4X family modules
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.
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.
Re: Sensirion SCD4X family modules
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.
Re: Sensirion SCD4X family modules
I'm accepting congratulations, just received SCD41 module.
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:
UPD2
Also Sensirion library https://github.com/Sensirion/arduino-i2c-scd4x
was successfully tested. Same result.
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:
CO2 and humidity increasing is reaction to breathing to sensor.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
UPD2
Also Sensirion library https://github.com/Sensirion/arduino-i2c-scd4x
was successfully tested. Same result.
Re: Sensirion SCD4X family modules
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.
Edit: Reserved P135 Environment - SCD4x CO2, Temp, Hum.
/Ton (PayPal.me)
Re: Sensirion SCD4X family modules
Ah good to know that the implementation is apparently not too complex to add with the available libraries ![Lach :)](./images/smilies/icon_e_smile.gif)
![Lach :)](./images/smilies/icon_e_smile.gif)
Re: Sensirion SCD4X family modules
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.
Re: Sensirion SCD4X family modules
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
Any specific feature you're looking for?
![Erg Blij :D](./images/smilies/icon_e_biggrin.gif)
Any specific feature you're looking for?
/Ton (PayPal.me)
Re: Sensirion SCD4X family modules
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
Re: Sensirion SCD4X family modules
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
![Cool 8-)](./images/smilies/icon_cool.gif)
Please provide any feedback via comments in the PR
![Idee :idea:](./images/smilies/icon_idea.gif)
/Ton (PayPal.me)
Re: Sensirion SCD4X family modules
Ohoooo
Or does it need a "pre-heating" time of 15-120 seconds when disconnected from power?
Just ordered one and gonna join the fun![Lach :)](./images/smilies/icon_e_smile.gif)
Does that mean a battery powered device would actually be feasible with this thingy?Optional Single-shot measurements (take 5 seconds) (only with an SCD41)
Or does it need a "pre-heating" time of 15-120 seconds when disconnected from power?
Just ordered one and gonna join the fun
![Lach :)](./images/smilies/icon_e_smile.gif)
Re: Sensirion SCD4X family modules
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.
The Single Shot mode is especially designed for applications like that, AFAICS.
/Ton (PayPal.me)
Re: Sensirion SCD4X family modules
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
Re: Sensirion SCD4X family modules
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 (PayPal.me)
Re: Sensirion SCD4X family modules
Some sensors also use some IIR filter to reduce noise.
This also delays the signal responsiveness a bit.
This also delays the signal responsiveness a bit.
Re: Sensirion SCD4X family modules
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.
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 (PayPal.me)
Re: Sensirion SCD4X family modules
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
I will do some more tests when SCD41 arrives.
Now, just for curiosity, current consumption graph of SCD40's single measurement
Re: Sensirion SCD4X family modules
Does anyone have a Testbuild for EPS32 laying around ? ![Lach :)](./images/smilies/icon_e_smile.gif)
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![Bedroeft :(](./images/smilies/icon_e_sad.gif)
![Lach :)](./images/smilies/icon_e_smile.gif)
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
![Bedroeft :(](./images/smilies/icon_e_sad.gif)
Re: Sensirion SCD4X family modules
If you found it, please let me know
![Lach :)](./images/smilies/icon_e_smile.gif)
That way I don't have to make it myself as that's (still) the plan to do.
Re: Sensirion SCD4X family modules
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
You must be having predictive dreams, as that page has been mostly in our thoughts, but not materialized yet...
![Lachend :lol:](./images/smilies/icon_lol.gif)
/Ton (PayPal.me)
Re: Sensirion SCD4X family modules
Oh... that's pretty cool. Didn't know you had auotmated builds.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...![]()
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...
Re: Sensirion SCD4X family modules
@Ath doesn't seem to be working...
![Image](https://i.imgur.com/Ierw8LY.png)
![Image](https://i.imgur.com/CDJgat3.png)
no matter what i don't get an Co2 value.
Tried the scd4x,selftest[,selftestcode] (with the generated code) while Serial connected but nothing shows up.
949201 : Info : SCD4x: SingleShot measurement started.
949202 : Info : SCD4x: READ Scheduler started: +5000 ms.
Did you use your device on 3.3V or 5V?
![Image](https://i.imgur.com/Ierw8LY.png)
![Image](https://i.imgur.com/CDJgat3.png)
no matter what i don't get an Co2 value.
Tried the scd4x,selftest[,selftestcode] (with the generated code) while Serial connected but nothing shows up.
949201 : Info : SCD4x: SingleShot measurement started.
949202 : Info : SCD4x: READ Scheduler started: +5000 ms.
Did you use your device on 3.3V or 5V?
Re: Sensirion SCD4X family modules
The sensor is 3.3V only, and mine has been working great on the regular I2C clock speed of 400 kHz (as you have ticked the Force Slow I2C speed checkbox)
It looks like you will have to look into the mounting of the sensor, did you remove anything of the white sticker/tape from the sensor, as AFAIK, that's not the intention, the sensor should be used as-is when removed from the packaging.
Also, ESD-measures should be taken, as with any electronic components, when handling the sensor. I assume you have taken care of that.
If all of that is in order, then the last cause I can think of is that your sensor is just broken.
It looks like you will have to look into the mounting of the sensor, did you remove anything of the white sticker/tape from the sensor, as AFAIK, that's not the intention, the sensor should be used as-is when removed from the packaging.
Also, ESD-measures should be taken, as with any electronic components, when handling the sensor. I assume you have taken care of that.
If all of that is in order, then the last cause I can think of is that your sensor is just broken.
/Ton (PayPal.me)
Re: Sensirion SCD4X family modules
Datasheet says it's 2.4~5.5VAth wrote: The sensor is 3.3V only
Re: Sensirion SCD4X family modules
Got another one...
Recognized By i2c but no values
Always shows 0 in all values.
Does anyone have a working Build for ESP32?
Recognized By i2c but no values
![Bedroeft :(](./images/smilies/icon_e_sad.gif)
Code: Select all
836469: SCD4x: READ Scheduler started: +5000 ms.
841474: SCD4x: READ Scheduler started: +5000 ms.
842212: Webserver 1 Arguments: 0: 'cmd' length: 28
842213: HTTP: scd4x,selftest,Scd4x0A20SelF
842219: SCD4x: Selftest starting... (may take up to 11 seconds!)
854225: SCD4x: Sensor self-test failed!
854274: WD : Uptime 14 ConnectFailures 0 FreeMem 196128 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init
Re: Sensirion SCD4X family modules
Not worried about the build, that does look to be OK, but more about the sensor quality, as the self-test fails...Haldi_2 wrote: ↑19 Oct 2022, 18:34 Got another one...
...Does anyone have a working Build for ESP32?Code: Select all
842219: SCD4x: Selftest starting... (may take up to 11 seconds!) 854225: SCD4x: Sensor self-test failed!
Assuming your wiring is short (< 50 cm), and you didn't add any additional I2C pull-up resistors (they are included on all boards I've seen available), I have no clue what's going on here, my SCD40 sensor worked at first try.
/Ton (PayPal.me)
Re: Sensirion SCD4X family modules
Short checklist for I2C debugging:
- Do not use long cables
- Check total pull-up resistance value (typically 4k7 - 10k is needed, when using several boards they all may have pull-up resistors which makes it too strong)
- Check wiring quality (I know some people even get offended when it is mentioned, but please double-check)
- Test with only 1 sensor connected and/or with 1 known to be working sensor on the same bus (to make sure it isn't a pull-up resistor issue)
- Test at lower I2C clock speed (setting on Hardware tab)
- Try using different pins (default pins 4 & 5 was just about the worst possible choice for ESP32 boards) For example pin 13 & 16 often work just fine on ESP32. See: https://espeasy.readthedocs.io/en/lates ... e-on-esp32
- Do not use long cables
- Check total pull-up resistance value (typically 4k7 - 10k is needed, when using several boards they all may have pull-up resistors which makes it too strong)
- Check wiring quality (I know some people even get offended when it is mentioned, but please double-check)
- Test with only 1 sensor connected and/or with 1 known to be working sensor on the same bus (to make sure it isn't a pull-up resistor issue)
- Test at lower I2C clock speed (setting on Hardware tab)
- Try using different pins (default pins 4 & 5 was just about the worst possible choice for ESP32 boards) For example pin 13 & 16 often work just fine on ESP32. See: https://espeasy.readthedocs.io/en/lates ... e-on-esp32
Re: Sensirion SCD4X family modules
guys how accurate readings are getting you from this sensor? I've received it yesterday and I'm trying it but it gives suspicious values. When I open the window it drops as low as 210 ppm (maybe even lower but I'm sampling at 1 min rate) which is nonsense and then slowly climbs up after few minutes
Re: Sensirion SCD4X family modules
I have not yet had a chance to play with this sensor.
So I don't know if it needs some parameters to setup some kind of compensation for various use case specifics.
Things like humidity, air pressure and perhaps voltage of the sensor maybe have some impact? Have to read the datasheet for these.
I do know that those sensors may be affected by some kinds of packaging materials.
Not sure what the actual effect is. So I don't know whether it is a temporary effect or permanent.
Maybe the sensor can compensate for it when left in a well ventilated room for a few days?
So I don't know if it needs some parameters to setup some kind of compensation for various use case specifics.
Things like humidity, air pressure and perhaps voltage of the sensor maybe have some impact? Have to read the datasheet for these.
I do know that those sensors may be affected by some kinds of packaging materials.
Not sure what the actual effect is. So I don't know whether it is a temporary effect or permanent.
Maybe the sensor can compensate for it when left in a well ventilated room for a few days?
Re: Sensirion SCD4X family modules
I've found out there is altitude or pressure settings, so I've ordered barometric pressure sensor and will play with it later. Also when I compare data with SI7021, the temperature is off by 2 degrees and humidity by 10% ![Verward :?](./images/smilies/icon_e_confused.gif)
![Verward :?](./images/smilies/icon_e_confused.gif)
Re: Sensirion SCD4X family modules
If temperature readings are off, then obviously the humidity is also off.
Re: Sensirion SCD4X family modules
I have a pair of SCD40 and SCD41 on the bench working for over a month. Both were initially reset to defaults and had the same settings - periodic measurements with autocalibration enabled. During 3 weeks SCD40 was showing 200 ppm less than SCD41 until one day both were taken to the fresh air. After that they aligned the readings to the level of SCD41.
Now they are accompanied by the S8 and, as you may see, the curves are absolutely identical although S8 definitely shows understated values and I cannot re-calibrate it.
You may see from the graph that calibration by offset is no good since SCD40 and SCD41 most likely have different slopes.
I am waiting for some more breakout boards to check the value spread within the same model
Now they are accompanied by the S8 and, as you may see, the curves are absolutely identical although S8 definitely shows understated values and I cannot re-calibrate it.
You may see from the graph that calibration by offset is no good since SCD40 and SCD41 most likely have different slopes.
I am waiting for some more breakout boards to check the value spread within the same model
- Attachments
-
- IMG_20221126_013849.jpg (119.29 KiB) Viewed 12540 times
Re: Sensirion SCD4X family modules
Here are my readings (green is the temperature).
I've set correct altitude and today I've still got readings around 200ppm:
there is also lot of sudden drops for short time (although home was empty for most of the day).
I'll try to bring it outside when I'll have more time.
I've set correct altitude and today I've still got readings around 200ppm:
there is also lot of sudden drops for short time (although home was empty for most of the day).
I'll try to bring it outside when I'll have more time.
Re: Sensirion SCD4X family modules
Sudden drop of temperature is really strange.
Is it possible the connections to the chip are flaky?
For example unstable power supply?
Is it possible the connections to the chip are flaky?
For example unstable power supply?
Re: Sensirion SCD4X family modules
I still have it on breadboard, I've checked the output and it seems there are some restarts. Maybe it drops after restart, it is possible that first readings after sensor powerup are lower. I'll rebuild it to PCB
Re: Sensirion SCD4X family modules
Sudden drops are resolved now as I've switched from breadboard to PCB. But it seems strange to me, that in closed empty room co2 have dropped by 300ppm over night. I have good windows and also humidity was constant whole night so I don't think the fresh air made it into a room
Re: Sensirion SCD4X family modules
As with all kinds of transfer (heat, air concentration, etc), the transfer speed increases proportional to the difference of what needs to be transferred.
Heat transfer speed is faster when the difference in temperature is higher.
That's why you can heat up a room with a relatively small radiator, only if you supply hot water. With relatively colder "warm water", like with a heat pump, you need a much larger radiator. (e.g. a heated floor)
The same applies for gas mixing.
If the concentration differs between gasses, the exchange rate is faster. It slows down when more gas molecules have exchanged.
Just compare it with 2 jars of marbles. One with red, one with blue marbles.
If you randomly exchange 2 marbles from each jar, your first exchange will for sure be a red one from one jar and blue from the second one.
However, after some exchanges, you will be more likely to exchange a different color.
This decrease in exchange rate is showing perfectly in your chart.
You do have some natural ventilation and without people or animals in the room, you will not add CO2. Thus the CO2 concentration can only become lower.
Heat transfer speed is faster when the difference in temperature is higher.
That's why you can heat up a room with a relatively small radiator, only if you supply hot water. With relatively colder "warm water", like with a heat pump, you need a much larger radiator. (e.g. a heated floor)
The same applies for gas mixing.
If the concentration differs between gasses, the exchange rate is faster. It slows down when more gas molecules have exchanged.
Just compare it with 2 jars of marbles. One with red, one with blue marbles.
If you randomly exchange 2 marbles from each jar, your first exchange will for sure be a red one from one jar and blue from the second one.
However, after some exchanges, you will be more likely to exchange a different color.
This decrease in exchange rate is showing perfectly in your chart.
You do have some natural ventilation and without people or animals in the room, you will not add CO2. Thus the CO2 concentration can only become lower.
Re: Sensirion SCD4X family modules
[/quote]
....
P.S Collection E is the one we want...
ESP_Easy_mega_20220921_collection_E_ESP32_4M316k.bin.not.zip
[/quote]
Hello,
is this firmware also available for the ESP8266?
Best regards
....
P.S Collection E is the one we want...
ESP_Easy_mega_20220921_collection_E_ESP32_4M316k.bin.not.zip
[/quote]
Hello,
is this firmware also available for the ESP8266?
Best regards
Re: Sensirion SCD4X family modules
See the ZIP file here: https://github.com/letscontrolit/ESPEas ... a-20221105
As can be seen in the documentation, it is present in both the "collection E" builds as well as the "climate" builds.
https://espeasy.readthedocs.io/en/lates ... #p135-page
Here you can see which build has which plugin: https://espeasy.readthedocs.io/en/lates ... al-plugins
As can be seen in the documentation, it is present in both the "collection E" builds as well as the "climate" builds.
https://espeasy.readthedocs.io/en/lates ... #p135-page
Here you can see which build has which plugin: https://espeasy.readthedocs.io/en/lates ... al-plugins
Re: Sensirion SCD4X family modules
Thanks for the info.
Re: Sensirion SCD4X family modules
Hi!
Has anyone encountered the appearance of regular 'oscillations' when measuring CO2 by the Sensirion SCD41?
Two sensors have been tested simultaneously connected to both Raspberry Pico or Raspberry Pi. Below is an example result.
Thanks!
Has anyone encountered the appearance of regular 'oscillations' when measuring CO2 by the Sensirion SCD41?
Two sensors have been tested simultaneously connected to both Raspberry Pico or Raspberry Pi. Below is an example result.
Thanks!
- Attachments
-
- ex.2.jpg (74.4 KiB) Viewed 9378 times
Re: Sensirion SCD4X family modules
Without an knowledge from experience with those modules, my first guess would be that the sensors might be read at an interval very close to their actual reading time (or multiple of it).
My second guess would be that the I2C registers are not being read in a single I2C read command and thus you might end up with mixed results of intermediate values from the next reading and the previous reading.
My second guess would be that the I2C registers are not being read in a single I2C read command and thus you might end up with mixed results of intermediate values from the next reading and the previous reading.
Who is online
Users browsing this forum: No registered users and 127 guests