Hi,
I’m using a WiFly as a standalone temperature transmitter. In the simplest setup, I’m using the default web client mode on the WiFly to send sensor pin readings to a page on a web server. It all works except that I’m having trouble deciphering the values it’s sending. I have a TMP36 temperature sensor on a voltage divider network connected to pin 17 (sensor 5) on the WiFly. BTW, I’ve also tried pins 19 and 20, which are WiFly sensor 3 and 2 respectively, with the same results.
Right now, the reading from the divider network is about 230 millivolts. If I use “show q 5” in command mode I get a reading of 8102BF. The manual states that the data returned from this command is microvolts and that the “8” is a marker digit. 1046A = 66239 decimal. 66239 microvolts is 66 millivolts, right? Nowhere close to the actual temp sensor output. Am I doing an incorrect conversion (hex to dec)?
Looking at the HTML output, it reports a different value for that sensor. In the same conditions as above, the HTML query going out has “104A” as the value for sensor 5 (4,170 decimal). Huh? Well, the least significant sensor bit represents 12microvolts, maybe 4170 * 12? That’s 50,040 uV, not in the ballpark either.
Regarding the HTML output, the manual states "WiFly module can send the value of the GPIO and sensor pins: The data will come as 18 bytes of ASCII HEX: <2 bytes GPIO><channel 0 thru 7 sensor data> " Elsewhere it says the HTML query will contain data that is “Sample [from the] the GPIO and ADC pins and format to ASCII hex” It doesn’t really say what the data represents (millivolts, microvolts, bitcount).
I must be missing something basic. Any ideas how I can get to a number within 5% of 230 (or 230000) from 2 bytes of ascii hex that are “104A”?