Discussion in 'Microcontrollers' started by slepax, Jul 2, 2009.

1. ### slepaxNew Member

Joined:
Feb 15, 2009
Messages:
10
Likes:
0
Hello all,

I want to use a PT100 to read temperatures using an ADC. I understand the basics [and more] on both sides, the PT100 and the ADC, however joining both for optimum result seems a bit tough:
• My ADC (ATmega8 to be exact) has 10bit input, which gives me 1024 sampling values.
• The input for the whole circuit is 5v (Vin).
• My temperature range is zero to 300deg, which means PT100 resistance of 100ohm at minimum and 217.25ohm at maximum.
• Theoretically, with 1024 sampling values in this temperature range I should be able to sample at 1/3 deg.
• Ideally, I would like to have 0v input when the temperature is 0deg and 5v input when the temperature is 300deg.
My calculations showed it would be impossible to get the full range of 1024 sampling values, the maximum I could get is 2-3deg accuracy.

I used a voltage divider to make my calculations but I am wondering if there is any better approach for this. I would love some feedbacks/opinions.

Thanks,
Ronen

2. ### ericgibbsWell-Known MemberMost Helpful Member

Joined:
Jan 4, 2007
Messages:
21,235
Likes:
645
Location:
Ex Yorks' Hants UK
hi,
Are you planning to use an amplifier for the PT100 RTD, so that you can span the 0 to 300C range and apply any required offset.?
or
just a resistive potential divider.?

Do you have a type number or datasheet.?

Last edited: Jul 2, 2009
3. ### slepaxNew Member

Joined:
Feb 15, 2009
Messages:
10
Likes:
0
Hey Eric, thanks for the prompt reply!

Not too sure about what you meant by amplifier and offset (I am kinda new to this), but the best results (only in calculations) I managed to get where using a voltage divider and 1200ohm resistor as R1 is:
• Mininum - 0.453v
• Maximum - 0.766v

Then using a x6 voltage multiplier it will give me 2.7v to 4.6v

And no, sorry, no datasheet.

Joined:
Jan 12, 1997
Messages:
-
Likes:
0

5. ### ericgibbsWell-Known MemberMost Helpful Member

Joined:
Jan 4, 2007
Messages:
21,235
Likes:
645
Location:
Ex Yorks' Hants UK

hi,
Looking at your figures show 0.453V at 0Cdeg and 0.766V at 300Cdeg.
Which is a range of 0.313V for 300C change

So for a 10bit ADC 1023, using a +5Vref, would give [0.453/5] *1023 =92 decimal.
and [0.766/5] * 1023 = 156 decimal.

Whats ideally needed is an amplifier with offset.
The offset voltage of 0.453V nulled to 0V and the 'range' of 0.313V multiplied by the amp to give +5V, a gain of 15.9

This would give the best resolution and span.

Do you follow.?

6. ### slepaxNew Member

Joined:
Feb 15, 2009
Messages:
10
Likes:
0
Loud and clear

Just to summarise. Having an offset of 0.453v to 0, would make:

0.453v -> 0v
0.766v -> 0.313v

That's great, because then I can multiply by 16 and get:
Code (text):

0.453v [offset 0.453v]   ->   0v [x 15]     -> 0v
0.766v [offset 0.453v]   ->   0.313v [x 15] -> 4.7v

This is great because it will almost give me the full range of 0v to 5v.

I know how to make the voltage amplifications (LM386 and co.), but how do you make the offset?

7. ### ericgibbsWell-Known MemberMost Helpful Member

Joined:
Jan 4, 2007
Messages:
21,235
Likes:
645
Location:
Ex Yorks' Hants UK
hi,
As you dont have any data on the PT100, I have posted a page from a text book that may help guide you.

I would suggest you consider driving the PT with a constant current in order to get the voltage output for the amplifier.

File size:
2.2 MB
Views:
2,320
8. ### ericgibbsWell-Known MemberMost Helpful Member

Joined:
Jan 4, 2007
Messages:
21,235
Likes:
645
Location:
Ex Yorks' Hants UK
hi,
Multiplying in software will not give you the resolution you are expecting.

The base value of the ADC will have a range of 64 decimal, so thats
300/64 = 4.6, say 5C/bit.

Is that resolution acceptable.?

With amplification 300/1023 = 0.29C/bit

EDIT:
The LM386 is an audio amp..

Last edited: Jul 3, 2009
9. ### slepaxNew Member

Joined:
Feb 15, 2009
Messages:
10
Likes:
0
I am familiar with that. I have managed to calculate the various PT100 resistance values using the widely available linearisation equation:

Rt = R0 * (1 + A* t + B*t2 + C*(t-100)* t3)

Also see the attached snapshot from my Excel file.

The questions is how do I reduce the 0.453v of the voltage divider Vout to be 0v?

File size:
53.9 KB
Views:
1,381
10. ### slepaxNew Member

Joined:
Feb 15, 2009
Messages:
10
Likes:
0
For the application I am using 5C/bit is acceptable, but I still want to reach the maximum resolution possible, merely for learning purposes.

0.3C/bin is just superb! but the question is how to I reduce (offset) 0.453v to 0v?

11. ### ericgibbsWell-Known MemberMost Helpful Member

Joined:
Jan 4, 2007
Messages:
21,235
Likes:
645
Location:
Ex Yorks' Hants UK
The OPA that amplifies the signal also removes the offset voltage.

Do you have any OPA's in your spares box.?

12. ### slepaxNew Member

Joined:
Feb 15, 2009
Messages:
10
Likes:
0
Actually yes

I have a couple of LM386 I played with to learn how to amplify (multiply) voltage. I started searching the net and it seems OP amps can also do voltage offset. Such handy little things they are...

I forgot to thank you for your help so far - thank you so much!

13. ### ericgibbsWell-Known MemberMost Helpful Member

Joined:
Jan 4, 2007
Messages:
21,235
Likes:
645
Location:
Ex Yorks' Hants UK
hi,
As I said earlier, these are audio amps..

EDIT:
A circuit like this would do the job.
Note the OPA type, the LM386 isnt suitable for your application.

#### Attached Files:

• ###### AAAimage01.gif
File size:
28.9 KB
Views:
2,582
Last edited: Jul 3, 2009
14. ### slepaxNew Member

Joined:
Feb 15, 2009
Messages:
10
Likes:
0
Hey,

Sorry for the late reply, but the circuit you posted threw me off a little bit. I searched some info about CA3140 on the net, but I still find it hard reading your circuit.

My electronic knowledge is very basic but I am eager to learn. Could you please explain the circuit a little bit? What makes the offset? What makes the amplification?

For the LM386 I played with, the ratio of two resistors defined the voltage amplification, it looks a bit different with your circuit.

Thanks, Ronen.

15. ### ericgibbsWell-Known MemberMost Helpful Member

Joined:
Jan 4, 2007
Messages:
21,235
Likes:
645
Location:
Ex Yorks' Hants UK
hi,
I'll post a schematic, that first circuit is from the simulation program.

Look for a LM358 that should be close enough for your project.

16. ### ericgibbsWell-Known MemberMost Helpful Member

Joined:
Jan 4, 2007
Messages:
21,235
Likes:
645
Location:
Ex Yorks' Hants UK
hi,
Look at this simplified drawing.

File size:
17.3 KB
Views:
4,915
17. ### slepaxNew Member

Joined:
Feb 15, 2009
Messages:
10
Likes:
0

So in a sense the amplification for this OP AMP is quite similar to how the LM386 works, it is set by the ratio of R5 and R1+SPAN. Am I right?

And as for the offset, if I understand this right, it is a simple resistor (pot in this case) reducing the voltage by 0.453?

Other than, I just have a few more questions (sorry for all the questions):

• What is the purpose of R3?
• What is the purpose of everything before R4? (the diode, capacitors, extra resistors)

You said the LM386 is not suitable, but why? It seems to be doing the same thing as the CA3140.

Many thank!

18. ### ericgibbsWell-Known MemberMost Helpful Member

Joined:
Jan 4, 2007
Messages:
21,235
Likes:
645
Location:
Ex Yorks' Hants UK