This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Temperature sensor reading in cc2541

Other Parts Discussed in Thread: CC2541, CC2530

I have added the code I used for temperature sensor. I got a value 547 (decimal) for room temperature. How can I verify whether this is the correct value or not.

uint16 temperatureValue = 0;
temperatureValue = HalAdcRead( HAL_ADC_CHN_TEMP, HAL_ADC_RESOLUTION_14  );
printf("%d", temperatureValue);

This gives me an output - 547

I failed to understand how temperature can be obtained from ADC value. The data sheet provides following information about temperature sensor.

PARAMETER

TEST CONDITIONS

MIN TYP MAX

UNIT

Output

Measured using integrated ADC, internal band-gap voltage reference, and maximum resolution

1480

12-bit

Temperature coefficient

4.5

/ 1°C

Voltage coefficient

1

0.1 V

Initial accuracy without calibration

±10

°C

Accuracy using 1-point calibration

±5

°C

Current consumption when enabled

0.5

mA

I don't know how to get the current temperature using these.

  • What is your HW? Is it a customized CC2541 board with temperature sensor?

  • Yes. But I thought the temperature sensor is internally available in CC2541 chip itself where it is connected to ADC. Sorry. I forgot to mention the reference voltage for ADC in my previous post. It is HAL_ADC_REF_AVDD. The measured voltage is 2.7V.

  • You can refer to the discussion at http://e2e.ti.com/support/wireless_connectivity/f/538/t/259483.aspx

  • Hi,

    It has almost been an year but the question remains. My previous assumptions were thrown to bits and hence I am here once again.

    I got a reading of 526 in ADC with 12 bit resolution and 2.3V reference voltage at 25 C.

    With the help of values given datasheet, how can I conclusively say this is the correct value for 25 C? I won't be able to know whether I am doing the right calculations or not without measuring ADC reading at another very different temperature. (But that is 2 point calibration and my current setup does not allow this).

    As per the code in this document - www.ti.com/.../swra101a.pdf, the OFFSET_ZERO is given from datasheet. This is clearly not the case in CC2541.

    Can someone please explain how I can get temperature reading from ADC value obtained?

    Regards,
    Tejas J
  • It is hard to do calibration using ADC reading from analog type temperature sensor. I would suggest you using TMP102 which uses I2C interface and doesn't need any calibration.

  • Thanks YK Chen. I will definitely look into this component.

    However, my question still remains.
    If there is no way we can measure temperature using the in-built temperature sensor and ADC, what is the point of having these in the first place? I don't need a very accurate temperature reading but just need to read temperature in the correct way.

    Lets say, I get an ADC reading of 1000 at a higher temperature. How do I calculate the approximate temperature?
  • You can refer to sunmaysky.blogspot.tw/.../temperature%20monitoring. It works on CC2530 and supposes to work on CC2541 too.
  • Thanks for the link YK Chen.

    With the internal reference, I was able to get the temperature value. (approximate). I did some math and was able to get it working for my AVDD5 as well.

    For future reference,

    Temperature T = ((ADC - 1480) / 4.5) + 25

    Because by datasheet, at 25C, ADC will supposedly give you 1480 with internal voltage reference given to ADC and there is a change of 4.5 units for every 1C change in temperature. Pretty straightforward if we can understand it. This is without an calibration. With a single point calibration, the variation in 1480 can be taken into account.
  • You are welcome and it's good to know it works now.