Skip to main content

how to get temperature for adapters of temperature sensor

DA1468x

4 months ago

Posted by nigelyang 40 points 3 replies
0 upvotes

hi Dialog

   I want to read a rough temperature value from DA14681.  As I know, there is a Temperature sensor adapter available to achieve it. I would like to know how to use the adapter.  Any example or tutorial available? 

   thanks for your help.

 Nigel  

4 months ago

PM_Dialog

Hi nigelyang,

Thanks for your question online.

Please visit the website, and you will find great variety of tutorial under “Tutorials” sections :

https://www.dialog-semiconductor.com/support-posts/how-get-temperature-adapters-temperature-sensor

If the sensor is using the I2C interface, I would suggest you to use the following tutorial :

http://lpccs-docs.dialog-semiconductor.com/tutorial_da1468x_adapters_concept_part_2/index.html

if it is using the SPI interface, follow this one :

http://lpccs-docs.dialog-semiconductor.com/tutorial_da1468x_adapters_concept_part_3/index.html

Thanks, PM_Dialog

4 months ago

nigelyang 40 points

hi Dialog,

     the first link is not valid.   Would you please paste the correct link again.

     by the way, your method seems to add an external temperature sensor (via I2C or SPI interface).

     I wonder that is there any available internal temperature sensor of DA14681/14683 for getting a rough temperature value?  

   thanks

 

     Nigel

4 months ago

PM_Dialog

Hi nigelyang,

Apologies for the first link – just wanted to post the link of DA14681 product page :

https://www.dialog-semiconductor.com/products/bluetooth-low-energy/da14680-and-da14681#tab-field_tab_content_resources

The DA14681 includes a built-in temperature sensor, please check chapter 17 from the datasheet :

https://www.dialog-semiconductor.com/sites/default/files/2021-03/DA14681-01_DS_3v1.pdf

Unfortunately, there isn’t any tutorial or SW example, but you could use it same as a general ADC source.

You will need to create the source in platform_devices.h. For instance :

GPADC_SOURCE(TEMP_SENSOR, HW_GPADC_CLOCK_INTERNAL, HW_GPADC_INPUT_MODE_SINGLE_ENDED, HW_GPADC_INPUT_SE_TEMPSENS, 5, false, HW_GPADC_OVERSAMPLING_1_SAMPLE, HW_GPADC_INPUT_VOLTAGE_UP_TO_1V2)

Use the Temperature sensor adapter ( ad_temp_sens.h / .c ) to interact with the build-in sensor.

For example, use the following APIs to open, read, and close the adapter from the application to get the value:

src = ad_tempsens_open();

temp_val = ad_tempsens_read(src);

ad_tempsens_close(src);

Thanks, PM_Dialog