![voltage to temperature conversion voltage to temperature conversion](https://www.brightwinelectronics.com/wp-content/uploads/2017/03/Thermocouple-to-voltage-converter.jpg)
Translating this number directly to a decimal value results in a value of 55200, which translates to 5.52V when multiplied by the 100µV scaling factor.Īnalog Input (B in, P in, R in) Translations V CC bit weights and masking 62h (V CC MSB)Īs an example, the values read from 62h and 63h are found to be D7A0h. With the lower 4 bits masked, the maximum range is 65520, which translates to a voltage range of 0V to 6.552V when it is multiplied by the LSB (scaling factor) of 100µV (factory default). Table 4 shows the bit weights of the V CC data and the masking of the 4 lower bits. When reading 62h and 63h, the lower 4 bits should be masked with 0s. The voltage data is read as an unsigned 16-bit value, however the lower 4 bits are ignored. The V CC value is stored in address locations 62h and 63h. So, the decimal value 11424 is divided by -256, resulting in a decimal temperature value of -44.625☌. Like in the positive temperature example, the translated decimal value is divided by 256, but is also made negative because the temperature is negative as indicated by the MSB. This binary number is equal to the decimal number 11424. Adding 1 to the LSB results in the binary number 0010 1100 1010 0000. This is done by first inverting the masked binary data and then adding 1 to the LSB. The next step is to take the 2's complement of the masked binary value. Negative number (MSB = 1) translation HEXIDECIMAL DATA Table 3 shows the translation from hex to binary and the masking of the 4 lower bits. Again, the lower 4 bits are ignored, so they will be masked with 0s. The first step would be to convert the hex values into binary. An example is if addresses 60h and 61h contained the data D3h and 60h. Dividing the decimal value 15440 by 256 results in a decimal temperature value of 60.3125☌.Ĭonverting a negative temperature value (MSB = 1) is a little more involved. The decimal value must be divided by 256 (or multiplied by 2 -8) to calculate the correct decimal temperature value. The binary number 0011 1100 0101 0000 is equal to the decimal value of 15440. Therefore, the value can be translated directly into a decimal number using a calculator. Since the MSB sign bit is 0, the temperature is positive and requires no 2's complement transformation. Positive number (MSB = 0) translation HEXIDECIMAL DATA Table 2 shows the translation from hex to binary and the masking of the lower 4 bits. The lower 4 bits of the binary data are ignored so they are masked with 0s. Since the MSB is 0, the temperature is positive. Next, translate the hex data into binary. Combine these two bytes to get the hex value of 3C50h. In this example, the values in addresses 60h and 61h are read to be 3Ch and 50h, respectively.
Voltage to temperature conversion how to#
The following is an example of how to translate a positive temperature value from hex to decimal. The next 11 bits contain the value of the temperature and are translated into decimal differently for positive and negative values. If the MSB is 1, then the temperature is negative. If the MSB is 0, then the temperature is positive. The MSB is the sign bit and indicates whether or not the 2's complement binary number is positive or negative. The temperature is stored in the 12 MSBs of the binary data. Bit weight of digital temperature and masking 60h (Temperature MSB) The bit weights and masking of the 4 lower bits are shown in Table 1. Once the two bytes have been read, translate the hex values into binary. These two bytes contain the most recent temperature reading, however the lower 4 bits are ignored and should be masked with 0's when read. The procedure for converting temperature values for the DS1852 begins with reading the hex values stored in bytes 60h (the MSB of the temperature) and 61h (the LSB of the temperature).
![voltage to temperature conversion voltage to temperature conversion](http://blogfiles.naver.net/20161011_80/novatest_1476153214033cYxgG_PNG/%B1%D7%B8%B217.png)
Translating Temperature from Hex to Decimal
![voltage to temperature conversion voltage to temperature conversion](http://www.oocities.org/tech4tdi/pages/pictures/COOL_ECU.png)
This application note assumes the factory default scaling values are used. This application note explains how to interpret the digital values for temperature, V CC, and analog input data and translate them into temperature and voltages.Įach analog input (V CC, B in, P in, R in) has a 16-bit scaling value for calibration in table 03h EEPROM. The analog-to-digital converter (ADC) of the DS1852 reads five analog inputs.