Skip to content

Question about MS8607 Humidity Resolution Options #12

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

Open
Crowley723 opened this issue Jan 1, 2023 · 2 comments
Open

Question about MS8607 Humidity Resolution Options #12

Crowley723 opened this issue Jan 1, 2023 · 2 comments
Labels
bug Something isn't working question Further information is requested

Comments

@Crowley723
Copy link

Crowley723 commented Jan 1, 2023

I am in the process of attempting to create a smaller port of the MS8607 module to use with Micro Python on an ESP8266 (I have been unable to find a compatible existing module)

While analyzing the existing module and referencing a datasheet for the MS8607-02BA01 PHT Combination Sensor I discovered that (at least in the datasheet I have) that it doesn't have any humidity options other than OSR_2048 - 0x81. Is this the case?
I cant find any reference in the entire datasheet I have to any functions/resolutions/sampling rates that reference (0x01, 0x80, 0x00).

It is possible the datasheet represents a different MS8607 module but I thought I may as well ask.
Any information that could be provided would be much appreciated.

for reference, this is on line 95 of adafruit_ms8607.py:

HumidityResolution.add_values(
    (
        ("OSR_256", 0x01, 8, 0.003),
        ("OSR_1024", 0x80, 10, 0.005),
        ("OSR_2048", 0x81, 11, 0.009),
        ("OSR_4096", 0x00, 12, 0.016),
    )
@tekktrik
Copy link
Member

tekktrik commented Jan 6, 2023

See page 8 of the datasheet here regarding the user register settings. It actually looks like they may be defined incorrectly here in this library.

@tekktrik tekktrik added question Further information is requested bug Something isn't working labels Jan 6, 2023
@jposada202020
Copy link
Contributor

Hello was taking a look at this, Humidity is compared with a mask here and that is why gets a little confusing comparing to the datasheet values.

reg_value |= resolution & _MS8607_HUM_USR_REG_RESOLUTION_MASK

HumidityResolution.add_values(
    (
        ("OSR_256", 0x01, 8, 0.003),
        ("OSR_1024", 0x80, 10, 0.005),
        ("OSR_2048", 0x81, 11, 0.009),
        ("OSR_4096", 0x00, 12, 0.016),
    )
)

image

Bit 7 Bit 0 Resolution Calculation Result
0 0 4096 0x00 & 0b10000001 0......0
0 1 2048 0x01 & 0b10000001 1......1
1 0 1024 0x80 & 0b10000001 1......0
1 1 256 0x81 & 0b10000001 1......1

I do have the Sensor so I an take a look to see if this is indeed the case, and make a PR. let me know, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants