You are here

Solar-Power IoT Device kit - temperature conversion from I2C to Beacon protocol | Cypress Semiconductor

Solar-Power IoT Device kit - temperature conversion from I2C to Beacon protocol

Summary: 2 Replies, Latest post by Bob Marlowe on 19 Apr 2016 03:54 AM PDT
Verified Answers: 1
Last post
Log in to post new comments.

I want to import temperature values on Matlab, from the USB bridge.

To do so, I read the serial communication from the USB bridge to my computer:

According to the Beacon protocol, the temperature is coded on a 8 bits-word, which is here 71, 71, then 72.

To understand how the temperature is coded, I looked into the Si7020_A10 datasheet (the humidity and temperature) sensor. This sensor uses a I2C protocol where the temperature is coded on a 16 bits-word, according to the following formula:
Temperature(°C) = 175.72*Temp_Code/65535 - 46.85.

Yet, I lack the temperature conversion from 16 bits-word to 8 bits word; and I couldn't find it in the I2C interface of the Motherboard.

Does anyone can help me please? 

suja's picture
Cypress Employee
4 posts


The sensor supports  16bit resolution, however we are utilizing only 8bit resolution.

PSOC4BLE device reads only the MSB of the temperature from Si7020, and the firmware associated with this is in line 366 of main.c and  in function Si7020_WriteRead. Hence for 8bit MSB temperature data the formula would be.

Temperature(°C) = 175.72*Temp_Code/256- 46.85.

This formula has been implemented in PMIC.exe and the mother board sends only the  8bit Temp_Code through USB.



user_1377889's picture
9279 posts

When there is an example for a sensor, why do you not address the sensor correctly? Transferring two bytes and receiving them instead of reducing the accuracy. Furthermore does the above formula not guarantee that under all circumstances (optimizations) the term


is not calculated first and so leads to a false result because Temp_Code and 256 are both integers.


(double)Temp_Code / 256

would be safe.



Log in to post new comments.