-2
\$\begingroup\$

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

\$\endgroup\$
  • 1
    \$\begingroup\$ What have you attempted thus far? You have a raw value from the ADC, convert it to voltage, and then convert that to temperature. Also, you have given no information about the XBee reference voltage, the humidity sensor, or the CO2 sensor (hint: datasheets are important). \$\endgroup\$ – uint128_t Jan 24 '16 at 19:05
  • \$\begingroup\$ I tried to convert the analog values using equation. But its incorrect temp = (5.0 * analogRead(tempPin) * 100.0) / 1024; Source Link \$\endgroup\$ – Vaibhavraj Roham Jan 24 '16 at 19:19
  • \$\begingroup\$ reference voltage is 3V3 \$\endgroup\$ – Vaibhavraj Roham Jan 24 '16 at 19:21
  • \$\begingroup\$ Then it might be a good idea to change the 5.0 to 3.3. \$\endgroup\$ – uint128_t Jan 24 '16 at 19:28
  • \$\begingroup\$ Isn't LM35 calibrated in degrees Celsius? Something like 10mV/∘C? \$\endgroup\$ – jippie Jan 24 '16 at 19:31
-1
\$\begingroup\$

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

\$\endgroup\$
  • \$\begingroup\$ You could have known that if you read the datasheet. \$\endgroup\$ – m.Alin Jan 24 '16 at 19:53
  • \$\begingroup\$ Yes @m.Alin it's also present in datasheet \$\endgroup\$ – Vaibhavraj Roham Jan 24 '16 at 20:00
  • \$\begingroup\$ Wrong. It depends on ADC Reference and resolution also. \$\endgroup\$ – ammar.cma Jan 24 '16 at 21:17
  • \$\begingroup\$ How? can you elaborate \$\endgroup\$ – Vaibhavraj Roham Jan 25 '16 at 15:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.