Using a QN9080-DK for a project, I have configured the system to use the built-in temperature sensor (Channel 13 of ADC), when I receive sampled data at an instance, the data is shown in a hex value format.
Is there a scaling technique/formula I can use to obtain actual temperature values? This is not provided in the data sheet!
Also, does this temp sensor detect ambient temperature? or temperature of ADC input to an allocated channel?
The former would be very odd as temp of the IC would surely be affected by operating temps?!
Does the sensor use peripheral circuitry on the QN908x module of the DK?
Any insight would be greatly appreciated.
Thanks in advance
Sam
Hi Sam,
You can obtain the temperature data through the following modifications.
base on “release_conn_ksdk_2.2_qn9080_1.5.3_RC5_1\boards\qn908xcdk\wireless_examples\bluetooth\temperature_sensor”, you can download it at https://mcuxpresso.nxp.com/en/builder
This modification will be added in the subsequent SDK, and there will be correction factor participation, and the accuracy will be higher.
@@ -314,11 +314,15 @@ int32_t BOARD_GetTemperature(void)
{}
/* Get the result */
adcConvResult = ADC_GetConversionResult(ADC);
// return (int32_t) ADC_ConversionResult2Temperature(ADC, adcConvResult);
float mvResult = ADC_ConversionResult2Mv(ADC, ADC_TEMP_CHANNEL, ADC_CFG_IDX, mAdcBandgap, mAdcVinn,
adcConvResult);
return (int32_t)((865.735696 - mvResult) / 1.35) * 100;
Xing,
Thanks for your reply.
Could you elaborate on the equation for the return value?
Hi Sam,
(int32_t)((865.735696-mvresult) / 1.35)
is the true temperature value, multiplying by 100, which should be a convenient conversion for processing data of bluetooth profile, converting decimal to integer.
The temperature sensor uses adc channel 13,no external input pins correspond to it.
I found some code that does this in the new SDK that was released today (2.2). Look at the temperature sensor project in the Bluetooth examples.
I dont suppose you happen to know the name of the function or source file? are these the latest SDK examples? They say they were last updated (2.2) in July on the QN908x software and tools section.