Analog to digital temperature sensor

In summary, the hexadecimal number that needs to be ANDed with port B in order to isolate bit 7 is 0x3F.
  • #1
orangeincup
123
0

Homework Statement


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?


Homework Equations


ADC resolution = voltage measurement range / number of discrete quantization levels

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
 
Physics news on Phys.org
  • #2
orangeincup said:

Homework Statement


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?


Homework Equations


ADC resolution = voltage measurement range / number of discrete quantization levels

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

ADCs do not have output voltages. Can you clarify the question? Was that a typo?
 
  • Like
Likes 1 person
  • #3
I copied the question exactly as it was stated, it's asking for the output in a decimal number
 
  • #4
orangeincup said:
I copied the question exactly as it was stated, it's asking for the output in a decimal number

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
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
orangeincup said:
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 .

Your 2nd answer is correct.

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. :smile:
 
  • #7
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
orangeincup said:
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

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
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?
 
  • Like
Likes 1 person
  • #10
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
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.
 

Attachments

  • anss.png
    anss.png
    71 KB · Views: 410

Related to Analog to digital temperature sensor

1. What is an analog to digital temperature sensor?

An analog to digital temperature sensor is a type of sensor that measures the temperature of its surroundings and converts it into digital data that can be read and interpreted by a computer or other digital device.

2. How does an analog to digital temperature sensor work?

An analog to digital temperature sensor works by using a thermistor, which is a type of electrical resistor that changes its resistance in response to temperature. The sensor measures the resistance of the thermistor and then converts it into a digital value using an analog-to-digital converter (ADC).

3. What are the benefits of using an analog to digital temperature sensor?

Some of the benefits of using an analog to digital temperature sensor include high accuracy and precision, low power consumption, and the ability to easily integrate with digital systems and devices. They also tend to be smaller in size, making them suitable for a variety of applications.

4. What are some common applications of analog to digital temperature sensors?

Analog to digital temperature sensors are commonly used in a wide range of applications, including weather monitoring, industrial control systems, medical devices, and consumer electronics. They are also used in home automation systems for temperature control and energy efficiency.

5. How do I choose the right analog to digital temperature sensor for my project?

When choosing an analog to digital temperature sensor, some important factors to consider include the temperature range, accuracy and precision, response time, power consumption, and interface compatibility with your system. It is also important to research and compare different sensor options to find the best fit for your specific project needs.

Similar threads

  • Electrical Engineering
Replies
5
Views
1K
  • Introductory Physics Homework Help
Replies
11
Views
1K
  • Introductory Physics Homework Help
Replies
9
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
9
Views
3K
  • Electrical Engineering
Replies
4
Views
6K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
2K
Replies
9
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
10
Views
4K
  • Introductory Physics Homework Help
Replies
15
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
3K
Back
Top