# Homework Help: Analog to digital temperature sensor

1. Sep 12, 2014

### orangeincup

1. The problem statement, all variables and given/known data
A temperature sensor has a full scale output of 0 to 5 volts which corresponds to a temperature range of 0 to 100ºC. If the sensor is interfaced to a 12 bit Analog‐to‐Digital
Converter (ADC) with a full‐scale output range of 0 to 10.0 volts, what decimal value will the
ADC provide for a temperature of 39.1 ºC?

2. Relevant equations
ADC resolution = voltage measurement range / number of discrete quantization levels

3. The attempt at a solution
So usually when I have this kind of problem I'm only given one voltage. Here is my attempt at a solution, the answer is suppose to be 200(which doesn't seem to make sense to me right now either.)

4096 resolution / 100ºC = 0.02441 (temperature per bit)

39.1/100 * 4096 = 1601 bit

2. Sep 12, 2014

### Staff: Mentor

ADCs do not have output voltages. Can you clarify the question? Was that a typo?

3. Sep 12, 2014

### orangeincup

I copied the question exactly as it was stated, it's asking for the output in a decimal number

4. Sep 12, 2014

### Staff: Mentor

Then the question has a simple typo in it. The ADC must have an *input* voltage range of 0-10V then.

So you are using the bottom half of a 12-bit ADC then. Does that change your calculations?

5. Sep 12, 2014

### orangeincup

Does that mean I can only use 0-5 volts?

Would the resolution be halved from what I originally calculated, or is 5 volts always equal to a specific bit size?

If I use 39.1/100 * 256 for 8 bits, I get an answer of 100.
If I just use my original resolution halved, I get 4096/2 * 39.1/100 = 800 .

6. Sep 12, 2014

### Staff: Mentor

For a 10V input, the ADC output code is 0xFFF = 4095. (range is 0-4095).

For a 5V input, the ADC output code is 2047 (corresponding to 100C out of the 5V sensor).

For a temperature of 39.1C, your output code is (39.1/100)*2047 = 800.38, which rounds down to 800.

7. Sep 12, 2014

### orangeincup

Is there any reason the answer is 200? Is that a typo?

I was thinking 512* 39.1/100 would be one way to get that answer, or if they divided by 4 somewhere

8. Sep 12, 2014

### Staff: Mentor

Weird. I'm not seeing how it could be 200, unless there are more typos or tricks in the problem statement. I'll ping some other Engineering Homework Helpers to have a look...

9. Sep 12, 2014

### Staff: Mentor

A couple other Homework Helpers agree with our answer of 800, given the problem statement. Is there any chance that the problem meant to specify a 10-bit ADC?

10. Sep 12, 2014

### orangeincup

It was part c) of a three part practice problem, but I don't think they have anything to do with it. Part a was a 10 bit ADC.

Questions a) and b)
a) A 10 bit Analog‐to‐Digital Converter (ADC) has a full‐scale output range of 0 to 5.0 V. What
decimal number will the ADC return if the input voltage is 2.2 volts?
b) A push button is connected to bit 7 (the most significant bit) of port B on the microcontroller
board. The button is connected in such a way that bit 7 will read a logic “1” when the button is
pressed and a logic “0” when the button is released. What hexadecimal number must be
“ANDed” with port B in order to isolate bit 7; i.e., to read only bit 7 and ignore bits 0 to 6?

11. Sep 12, 2014

### orangeincup

I was looking at a similar problem, and the solution used voltage.

If I calculated the problem below, using the method I used above, I would have had... 307/1023 * 90 = 0.27, so it wouldn't be correct according to that.

File size:
147.1 KB
Views:
133