Reply
Posts: 3
Registered: ‎12-09-2016
Accepted Solution

Why are the commands of the SI7021 sensor interchanged?

Hello all

 

I connected a SI7021 sensor (temperature and humidity) to a BLE Nano.

 

The code is in the following repository:
developer.mbed.org/users/ghost22/code/minimal_working_example

 

The output of the program is the following:
RH=3522, T=2550

 

That is 35.22%RH and 25.5 °C (the values are plausible, compared to another sensor)

 

I2C-Command 0xE3 is for the temperature (according to the SI7021-datasheet)
I2C-Command 0xE5 is for the humidity (according to the SI7021-datasheet)

 

In the code I had to use 0xE5 for temperature and 0xE3 for the humidity.

 

Why is this?

 

Thanks for helping me!

 

Best regards,
ghost22

Posts: 11
Registered: ‎11-21-2014

Re: Why are the commands of the SI7021 sensor interchanged?

In your code you are sending extra data after the command byte. It looks like the device address followed by three zeros. Why are you doing this? Can you insert a delay instead to allow the conversion to take place and then read the data?

Posts: 3
Registered: ‎12-09-2016

Re: Why are the commands of the SI7021 sensor interchanged?

Hello lujordan

 

Thank you for the response!

 

You are right, with your suggestion I realized that the code is not as it should be.

 

I will try to fix it in the next days. (Due to other duties I am currently not able to work on that.)

If I have a working solution I will post it here. 

Highlighted
Posts: 3
Registered: ‎12-09-2016

Re: Why are the commands of the SI7021 sensor interchanged?

I commited a fix. Though I will further test it next week.