5) View It!
You will use the XBee Wi-Fi Cloud Kit’s web application to configure a widget for viewing the temperature readings from your sensor.
- Log in to the XBee Zigbee Cloud Kit web application: https://xbeegateway.herokuapp.com/#/login
- Use the Add Widget button to create a new display widget
- Choose Gauge Widget for the widget type.
- Add a label such as “Temperature.”
- Choose your XBee Zigbee device by its ID.
- Select ADC2 as the input stream and check the device configuration to make sure it is configured properly.
- Enter “((value/1023)*1200)*3/10-50” to transform the input from millivolts to degrees Celsius*.
- The calculation takes the input value, scales back by 1/3 from 3.3 volts to the 1.2 volt maximum that the ADC input on the XBee can handle
- (value/1023)*1200) takes the reading from the XBee radio and converts it back to the millivolt reading at the ADC pin.
- We then multiply this value by 3 to reverse the effect of the voltage divider and return the value to the millivolt reading at the center pin of the tmp36 sensor.
- We then take this product (the actual output in millivolts from the sensor) and divide by 10 and subtract 50 to convert to degrees Celsius as per the data sheet.
- The TMP36 data sheet is the source for this info.
- Add a name for the Units such as “°C“
- Set a low value of 0 and a high of 50 to see a reasonable Celsius temperature range displayed
- Save the changes to see your new Widget on the home screen.