Continue to Site

# Pic 18F2420 A2D V ref

Status
Not open for further replies.

##### Member
Hi,

Best wishes to everyone.

I’ve built a little circuit with an LM35 temperature sensing I.C. The LM35 has a linear output = 10mV/Deg C

When I first built the circuit I used a 1.023V reference for my 18F2420 so every mV increase from the LM35 would increase the A/D conversion result by 1. This could give me 0.1 Deg C resolution for my LCD display. It appeared to work ok apart from the gltiches caused by not having a proper averaging routine although I was going to attend to that later. Anyway, reading another thread on this board I saw somebody point out that the minimum Vref should be 3V but , I think it was Futz, said he used 2.55 successfully so I’ve done that, but tweaked to give 2.56V. But it messed up my conversion resolution.

With 2.56 Vref I can only get 2.5mV resolution – 2.56/1024 = 0.0025v and I can’t properly display any conversions that are not a multiple of 0.0025 because they result in a fractional part.

Any suggestions as to how I can achieve 0.1 Deg resolution using a 2.56V reference and 10 bit conversion?

Hope what I’ve written makes sense!

Thanks in advance for any help.

Hmm...well I think what I meant was not getting 0.1 deg resolution but being able to convert / display a result that has a fractional part.

Hmm...well I think what I meant was not getting 0.1 deg resolution but being able to convert / display a result that has a fractional part.

hi AB,
What is the tempr range that you need to measure.?

Hello Eric,

The LM35 has a temperature range of 0 to 100 Deg C so I would like my circuit to be able to measure that range even if I cannot actually apply a temperature that high. Maybe you're thinking that I should accept a lower temperarture span and get the resolution that way? I might have to do that although it seems like a bit of a kop out.

Hello Eric,

The LM35 has a temperature range of 0 to 100 Deg C so I would like my circuit to be able to measure that range even if I cannot actually apply a temperature that high. Maybe you're thinking that I should accept a lower temperarture span and get the resolution that way? I might have to do that although it seems like a bit of a kop out.

hi AB,
The point to remember about the LM35 is its accuracy its only about +/-0.5Cdeg, so there isnnt much point in resolving to 0.01Cdeg.

If you used a Vref ic to give 2.5Vref, then 100Cdeg the output from the LM35 would be +1V, which is [1/2.56) *1023 =400 counts, which is equal to 0.25C resolution.

If you multiplied the 400 by say 10, to give 4000 and then divided by 4 [ 2 right shifts] you would have 100.0C.

Another way is to amplify the output voltage of the LM35 , say to 5V for 100 degrees, giving 1000 counts = 100.0C.[ 0.25]

Last edited:
Ok, thx Eric. Some good points for me to ponder.

I've always found it easier to use a digital temperature sensor, such as an LM74.

The accuracy is no better, but you don't get any additional errors from A/D conversion or voltage errors.

Hello Diver,

Thx for the suggestion. I've been perusing the RS catalogue and there are quite a few interesting temp' sensing chips there, many using two wire serial connections. Had a quick look at the LM74 data sheet. Something I might try playing with when I finish this little project.

I managed to resolve my 'resolution' / 'fraction' problem by simply amplifying the LM35 o/p by 2.5 (thanks for the suggestion Eric) - so obviously the way to go but I'm such a doofus I never see the obvoius solutions.

There is still a bit of a problem with the displayed temperature glitching a little but my crappy plugblock setup may have something to do with that. Maybe I need to work out a little software 'damping' or averaging routine.

hi,
Nice looking LCD display layout.
With the LT1014 you dont really need the -5V dual supply in order to get close to 0V out.

You could add some Res/Cap signal filters to the LT1014.

Status
Not open for further replies.

Replies
27
Views
3K
Replies
11
Views
3K
Replies
9
Views
2K
Replies
22
Views
4K
Replies
7
Views
1K