Electrical – python – How to connect LM35 Tempreture sensor to xbee

pythonxbee

I suppose to calculate actual temperature of remote location using lm35 temperature sensor and xbee sensor. I am getting analog input from sensor, but I am unable to calculate temperature. complete scenario is given below.

Scenario:

I have Connected LM35 Temperature sensor to XBee (Consider sensing node) pin0 which Analog (ADC) and sampling rate is 4 Seconds. Same I have another XBee as Coordinator which is accepting values from xbee sensing node. The coordinator is connected to UART-4 of BeagleBone via it's TX and RX pins. I have used python-xbee python library to read from serial port i.e. UART-4. I am successfully getting analog values from remote xbee. But I am not able to calculate temperature from received analog values.

Sample Frames Which I am Receiving

{'source_addr_long': '\x00\x13\xa2\x00@\xd6\xa58', 'source_addr': '\xaa\xf9', 'id': 'rx_io_data_long_addr', 'samples': [{'adc-0': 182, 'adc-1': 466, 'adc-2': 1023}], 'options': '\x01'}
{'source_addr_long': '\x00\x13\xa2\x00@\xd6\xa58', 'source_addr': '\xaa\xf9', 'id': 'rx_io_data_long_addr', 'samples': [{'adc-0': 182, 'adc-1': 469, 'adc-2': 1023}], 'options': '\x01'}
{'source_addr_long': '\x00\x13\xa2\x00@\xd6\xa58', 'source_addr': '\xaa\xf9', 'id': 'rx_io_data_long_addr', 'samples': [{'adc-0': 182, 'adc-1': 468, 'adc-2': 1023}], 'options': '\x01'}
{'source_addr_long': '\x00\x13\xa2\x00@\xd6\xa58', 'source_addr': '\xaa\xf9', 'id': 'rx_io_data_long_addr', 'samples': [{'adc-0': 182, 'adc-1': 470, 'adc-2': 1023}], 'options': '\x01'}
{'source_addr_long': '\x00\x13\xa2\x00@\xd6\xa58', 'source_addr': '\xaa\xf9', 'id': 'rx_io_data_long_addr', 'samples': [{'adc-0': 182, 'adc-1': 466, 'adc-2': 1023}], 'options': '\x01'}
{'source_addr_long': '\x00\x13\xa2\x00@\xd6\xa58', 'source_addr': '\xaa\xf9', 'id': 'rx_io_data_long_addr', 'samples': [{'adc-0': 183, 'adc-1': 466, 'adc-2': 1023}], 'options': '\x01'}
{'source_addr_long': '\x00\x13\xa2\x00@\xd6\xa58', 'source_addr': '\xaa\xf9', 'id': 'rx_io_data_long_addr', 'samples': [{'adc-0': 178, 'adc-1': 466, 'adc-2': 1023}], 'options': '\x01'}
{'source_addr_long': '\x00\x13\xa2\x00@\xd6\xa58', 'source_addr': '\xaa\xf9', 'id': 'rx_io_data_long_addr', 'samples': [{'adc-0': 180, 'adc-1': 466, 'adc-2': 1023}], 'options': '\x01'}
{'source_addr_long': '\x00\x13\xa2\x00@\xd6\xa58', 'source_addr': '\xaa\xf9', 'id': 'rx_io_data_long_addr', 'samples': [{'adc-0': 177, 'adc-1': 466, 'adc-2': 1023}], 'options': '\x01'}
{'source_addr_long': '\x00\x13\xa2\x00@\xd6\xa58', 'source_addr': '\xaa\xf9', 'id': 'rx_io_data_long_addr', 'samples': [{'adc-0': 182, 'adc-1': 466, 'adc-2': 1023}], 'options': '\x01'}
{'source_addr_long': '\x00\x13\xa2\x00@\xd6\xa58', 'source_addr': '\xaa\xf9', 'id': 'rx_io_data_long_addr', 'samples': [{'adc-0': 183, 'adc-1': 466, 'adc-2': 1023}], 'options': '\x01'}
{'source_addr_long': '\x00\x13\xa2\x00@\xd6\xa58', 'source_addr': '\xaa\xf9', 'id': 'rx_io_data_long_addr', 'samples': [{'adc-0': 182, 'adc-1': 466, 'adc-2': 1023}], 'options': '\x01'}
{'source_addr_long': '\x00\x13\xa2\x00@\xd6\xa58', 'source_addr': '\xaa\xf9', 'id': 'rx_io_data_long_addr', 'samples': [{'adc-0': 183, 'adc-1': 466, 'adc-2': 1023}], 'options': '\x01'}
{'source_addr_long': '\x00\x13\xa2\x00@\xd6\xa58', 'source_addr': '\xaa\xf9', 'id': 'rx_io_data_long_addr', 'samples': [{'adc-0': 166, 'adc-1': 466, 'adc-2': 1023}], 'options': '\x01'}
{'source_addr_long': '\x00\x13\xa2\x00@\xd6\xa58', 'source_addr': '\xaa\xf9', 'id': 'rx_io_data_long_addr', 'samples': [{'adc-0': 166, 'adc-1': 466, 'adc-2': 1023}], 'options': '\x01'}
{'source_addr_long': '\x00\x13\xa2\x00@\xd6\xa58', 'source_addr': '\xaa\xf9', 'id': 'rx_io_data_long_addr', 'samples': [{'adc-0': 166, 'adc-1': 466, 'adc-2': 1023}], 'options': '\x01'}

Note:

adc-0 is pin of remote xbee where I have connected tempreture sensor.

adc-1 is pin of remote xbee where I have connected Humidity sensor.

adc-2 is pin of remote xbee where I have connected CO2 sensor.

How should I calculate temperature. Current temperature is ~ 16 to ~ 18 C

Best Answer

Finally got the answer at source. The sensor has a sensitivity of 10mV / oC. Use a conversion factor that is the reciprocal, that is 100 oC/V.

Temperature ( oC) = Vout * (100 oC/V)

So if Vout is 1V , then, Temperature = 100 oC

Thanks @unit128_t for you hint