Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Si7021 suddenly thinks my room is 90C!
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Si7021 suddenly thinks my room is 90C!

by onioneer on Tue Aug 11, 2020 9:43 am

I recently started experimenting with I2C and chose to purchase an Si7021.

I tested it successfully a few times on a Raspberry Pi 0 W using the Python toolkit located here. It correctly read my room conditions as roughly 20C and 50% humidity.

Since it appeared to work I wanted to explore a bit more and tried some more primitive calls to the device and I followed the instructions provided by SiLabs. I used the SMBus2 library and I was able to connect, however the values now read incorrectly.

My Si7021 is now reporting my room to be 91C and 25% RH! I thought "Clearly I must have a math error in my conversion functions". However, I then ran a sanity check and tested again using the original toolkit and it reported the same. So either it must be reading incorrectly or I am suddenly fireproof.

I didn't do anything to the board between the tests. The board is powered by the 5V and GND pins on the GPIO headers on my Raspberry Pi 0 W which is powered by a dedicated 5VDC 1A usb wall-wart.

What might I be doing incorrectly?

onioneer
 
Posts: 5
Joined: Mon Aug 10, 2020 9:15 pm

Re: Si7021 suddenly thinks my room is 90C!

by adafruit_support_carter on Tue Aug 11, 2020 10:46 am

I didn't do anything to the board between the tests.

You played around with writing to low level registers. Not sure how that could have affected things, but maybe it did? Could the calibration data have been corrupted somehow?

adafruit_support_carter
 
Posts: 16922
Joined: Tue Nov 29, 2016 2:45 pm

Re: Si7021 suddenly thinks my room is 90C!

by onioneer on Tue Aug 11, 2020 11:15 am

That is true, and it was a concern of mine. However I only wrote to the following registers:
Code: Select all | TOGGLE FULL SIZE
CMD_MEASURE_RELATIVE_HUMIDITY = 0xF5
CMD_MEASURE_TEMPERATURE = 0xF3


And once those were giving me a headache I tried:
Code: Select all | TOGGLE FULL SIZE
CMD_RESET = 0xFE
CMD_READ_RH_T_USER_REGISTER_1 = 0xE7
CMD_READ_HEATER_CONTROL_REGISTER = 0x11

onioneer
 
Posts: 5
Joined: Mon Aug 10, 2020 9:15 pm

Re: Si7021 suddenly thinks my room is 90C!

by adafruit_support_carter on Tue Aug 11, 2020 11:47 am

Also, from a quick scan of the datasheet, not sure altering the cal values is even possible. And for the others, a power cycle should restore to defaults.

Maybe the sensor got zapped some other way and it just seems to be related to the playing around with registers.

Post a photo of your current setup and we can take a look.

adafruit_support_carter
 
Posts: 16922
Joined: Tue Nov 29, 2016 2:45 pm

Re: Si7021 suddenly thinks my room is 90C!

by onioneer on Sun Aug 16, 2020 11:49 am

Image
Image
Image

onioneer
 
Posts: 5
Joined: Mon Aug 10, 2020 9:15 pm

Re: Si7021 suddenly thinks my room is 90C!

by adafruit_support_carter on Mon Aug 17, 2020 12:09 pm

Thanks for the photos. Try moving VIN to 3V:
https://learn.adafruit.com/adafruit-si7 ... -2997620-5
and see if that helps.

adafruit_support_carter
 
Posts: 16922
Joined: Tue Nov 29, 2016 2:45 pm

Re: Si7021 suddenly thinks my room is 90C!

by onioneer on Mon Aug 17, 2020 1:39 pm

OK here it is powered by 3.3v from the raspberry pi 0 BCM pin 1.
Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi:~/app/app/thermostat $ python3 __init__.py
Temperature: 94.5C


I tried with a spare Si7021 on both 5V and 3.3V and it read correctly
At 5V:
Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi:~/app/app/thermostat $ python3 __init__.py
Temperature: 26.3C

At 3.3V about 10 seconds later:
Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi:~/app/app/thermostat $ python3 __init__.py
Temperature: 26.9C

onioneer
 
Posts: 5
Joined: Mon Aug 10, 2020 9:15 pm

Re: Si7021 suddenly thinks my room is 90C!

by adafruit_support_carter on Mon Aug 17, 2020 1:45 pm

Thanks for trying. Not sure what then, but must be something related to whatever those low level smbus2 library calls were. Would think a power or software reset would revert back to normal, but maybe one of the commands had a more permanent effect.

adafruit_support_carter
 
Posts: 16922
Joined: Tue Nov 29, 2016 2:45 pm

Re: Si7021 suddenly thinks my room is 90C!

by onioneer on Tue Aug 18, 2020 1:51 am


onioneer
 
Posts: 5
Joined: Mon Aug 10, 2020 9:15 pm

Re: Si7021 suddenly thinks my room is 90C!

by adafruit_support_carter on Tue Aug 18, 2020 10:11 am

Wow, interesting. Thanks for sharing that. Really surprising that's even possible. There's all kinds of chances for sending wrong I2C data when developing driver code, like for CircuitPython or Arduino. One generally does not expect that to brick the sensor though.

adafruit_support_carter
 
Posts: 16922
Joined: Tue Nov 29, 2016 2:45 pm

Please be positive and constructive with your questions and comments.