0

i want to read all temperature range of the LM34(-50 to +300) but i only can program single ended like this one, and i only can read from 0 to 50 F enter image description here

but i can't program one like this(can't read two pins and get the temperature from them),

enter image description here

i can't deal with two pins of ADC, i only can deal with one pin. so could any one teach me how this circuit work?, how to program these two pins ?and what happens inside the ports when i deal with two pins instead of one?, and how to measure the value of the sensor?. BTW, i'm studying from a book but the book didn't say any thing about this, i searched a lot but i need direct help. thank you.

  • You use *two* ADC inputs (the ATmega32 has several inputs), sample both right after another and then subtract the results. As temperatures are not going to change super-fast, this should give you accurate results. – Janka Jun 14 '17 at 02:05
  • i know that i should do that, but how? should i do a conversion for the first one then start the conversion again for the second one? – Ahmed Rifaat Jun 14 '17 at 02:31
  • the problem, is that i don't know how to do it.i can't write the code the book i'm studying from didn't talk about using more than one pin – Ahmed Rifaat Jun 14 '17 at 02:36
  • From your other question, you have a line of code that says: ADMUX |= 0xE6; // [...] select ADC6 [...] After you run your first conversion, you may want to consider changing ADMUX to another ADC input, and re-running the conversion. That's how you'd read from two different pins. – Jay Carlson Jun 14 '17 at 05:42
  • i'll try to write it's code. – Ahmed Rifaat Jun 14 '17 at 20:19

1 Answers1

0

The second circuit that you are referencing is only necessary if you need the minus degrees F range of the sensor. For an application where you do not need negative temperature sensing, eliminate the two diodes and directly ground that pin. The single output of the LM34 can then directly go to the input of your ADC. The voltage will be 10 mV per degree F.

If you do require negative temperature sensing, you will need to either power the LM34 from a source with an independent ground or you will need to use an op amp or equivalent to offset the output voltage. If the former, use the second diagram and connect pin 3 to the independent ground of your uP supply.

Glenn W9IQ
  • 5,526
  • 11
  • 17