This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Get the value of a temperature sensor

 Hello,

I would like to get the value of a temperature sensor, convert it from A -> D, send it to a server and then get it with a client (mobile application)

I need a sensor server, any idea of how to do it ? does it already exist ?

Thank you for your help

Parents
  • In the softdevice header file nrf_soc.h you can find the call to sd_temp_get(). The temperature can be obtained that way.

    Note that the TemperatureSensor (TEMP) is a resource that the softdevice needs to own, and attempting to access it directly will reward you with a Noridc Assert Error. You have to use this function.

    I would like to hear from Nordic on this: The temperature value returned via the uint32_t pointer p_temp, has that value been adjusted by the on-chip temperature calibration data found in FICR->TEMP.x0 , where x = A, B, T. or not.

    I have not found any documentation stating this is the case or not.

    Thanks,

  • Hey thank you for your answer, 

    The client send a sensor get message to the sensor server and the sensor server return a sensor status message (which contain the value of the temperature sensor and other informations) to the client, is that it ?

    If yes, is "sd_temp_get()" used as sensor get message or to get the sensor value in the sensor server ?

    Is the sensor server already coded in nrf5SDKforMeshv300src/examples/experimmental_dimming (i can't find it) ?

    Thanks

  • Well, perhaps I misunderstood your question. I thought you merely wanted to read the temperature of the nrf52 device. It appears you really want a set of ADC readings and perhaps one of those readings is temperature.

    You might look in the SDK example

    nRF5_SDK_15.2.0_9412b96/examples/ble_peripheral/ble_app_hts

    In main.c you can see this function:

    hts_sim_measurement()

    This would be where you substitute the "sensor simulation" with real temperature data.

    The temperature service and characteristics are set up in this example.

    I have not yet looked into any of the mesh SDK at this point.

Reply
  • Well, perhaps I misunderstood your question. I thought you merely wanted to read the temperature of the nrf52 device. It appears you really want a set of ADC readings and perhaps one of those readings is temperature.

    You might look in the SDK example

    nRF5_SDK_15.2.0_9412b96/examples/ble_peripheral/ble_app_hts

    In main.c you can see this function:

    hts_sim_measurement()

    This would be where you substitute the "sensor simulation" with real temperature data.

    The temperature service and characteristics are set up in this example.

    I have not yet looked into any of the mesh SDK at this point.

Children
Related