Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using the setAmbientPressure function results in extreme noise in the output #15

Open
gazzat5 opened this issue May 22, 2024 · 1 comment

Comments

@gazzat5
Copy link

gazzat5 commented May 22, 2024

Hi there,

I have a bme680 pressure sensor which is giving fairly stable pressure readings:
image

However when I use the pressure sensor readings to set the ambient pressure for the scd30, the output numbers for Co2 are extremely noisy (and the below is with extensive filtering):
image

I am only setting the ambient pressure after every reading from the scd30, and I have tested intervals of 5, 10 and 20 seconds between each reading but the noise remains. This is similar to the way Example 10 is doing it where it sets the pressure every time data is available as long as the pressure sensor is enabled.

When I remove the setAmbientPressure command and just use the setAltitudeCompensation command the readings are much more stable and sane.

I note that I am sending the readings from a float variable with millibar values such as 1004.79 which is getting automatically converted to an integer value as that's what the function is expecting to receive. I don't know if this is having an affect.

I'm testing on a Wemos D1 Mini pro (esp8266), and using the latest version of the SCD30 library, and the latest version of the Adafruit_BME680.h library.

I also note that the scd30 library is running it's internal beginMeasuring command every time the pressure is provided, which runs sendCommand(COMMAND_CONTINOUS_MEASUREMENT, pressureOffset), so I wonder if the sensor is being reset/restarted each time the command is sent which might explain the noisy readings...?

Can share code if needed though it is rather long (and ugly)

Thanks in advance

@paulvha
Copy link
Owner

paulvha commented May 22, 2024

hi,
It has been a long time since I have worked on the SCD30 and I have not tested for this behavior.

Some feedback:
you can be right that a reset happens with each update. When de sensor is in continuous mode and a change in altitude is done, the complete command needs to be resend. That might mean a complete restart.

What happens if you disregard the first X (say 2) readings AFTER an update of the ambient pressure? will that reduce the noise.

Enable debug and check that the float to uint16 is working as expected.

Instead of taking the result from the BME680, rework example 10 to provide "fake" updates on the ambient pressure. This will rule out that BME680 communication could have an impact.

Do you have the Automatic field calibration enabled? It could have a negative impact.

There was something on GIThub.. but no answer : esphome/issues#4448

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants