Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

how to stabilize the lcd display reading???

Status
Not open for further replies.

haowhaow

New Member
May u know how to stabilize the lcd display reading???
im using 16 x 2 lcd and pic18f4520....
im using thermocouple type K and ad595 to measurement temperature....but my temperature reading keep fluctuating +- 4 degree so much....
any idea can i to stabilize the reading??
hope anyone here can help me.....appreciated it much~
 
Average out the readings. A thermocouple probably isn't changing temperature all that fast anyway. Just read it 10 or 20 or whatever number of times is appropriate, storing the results as a running total. Then divide by the number of readings. Then display.

Someone else will probably post something more elegant, but that's my first thought. :D

EDIT: If you're programming in asm then you'd want to keep the number of readings to something like 8, 16, 32, 64 or whatever so you can divide by just shifting, rather than writing "difficult" division code.
 
Last edited:
ReadMedian Purpose : Takes 64 ADC samples and returns the median average.

Although computationally expensive, this routine is quite useful as the

result is not influenced by extreme high and low sample values
 
ReadMedian Purpose : Takes 64 ADC samples and returns the median average.

Although computationally expensive, this routine is quite useful as the

result is not influenced by extreme high and low sample values
is there have other way to solve it??
 
Take less samples Like futz said. Maybe 8 to 16 and divide them like

103 104 102 103 107 102 105 103 = 829 / 8 = 103 you will stay at 103 for 8 loops more loops more stable.
 
Take less samples Like futz said. Maybe 8 to 16 and divide them like

103 104 102 103 107 102 105 103 = 829 / 8 = 103 you will stay at 103 for 8 loops more loops more stable.

if using average method, it may take some time to stable down right for example temperature increasing from 0 to 100 degree c???
 
if using average method, it may take some time to stable down right for example temperature increasing from 0 to 100 degree c???

hi,
One method is to use an analog technique of Differential control, using a digital approach within the PIC's program.

eg, take your '0 to 100Cdeg' jump as an example.
Compare the 'current latest' adc reading and compare it with the 'previous' stored value, if the absolute difference is greater than say 10% then use less samples in the averaging loop.

As the readings approach the final value start to increase the number of samples in the averaging.

OK.?
 
hi,
One method is to use an analog technique of Differential control, using a digital approach within the PIC's program.

eg, take your '0 to 100Cdeg' jump as an example.
Compare the 'current latest' adc reading and compare it with the 'previous' stored value, if the absolute difference is greater than say 10% then use less samples in the averaging loop.

As the readings approach the final value start to increase the number of samples in the averaging.

OK.?

sorry im newbie...i not really understand what u mean.....and how to write the code?
 
Hi,
What programming language do you use, 'C' or asm,,,etc.?
 
hi,
One method is to use an analog technique of Differential control, using a digital approach within the PIC's program.

eg, take your '0 to 100Cdeg' jump as an example.
Compare the 'current latest' adc reading and compare it with the 'previous' stored value, if the absolute difference is greater than say 10% then use less samples in the averaging loop.

As the readings approach the final value start to increase the number of samples in the averaging.
Ah! Like PID, right? That would work nicely. Not wicked hard to code for something like that either.
 
Ah! Like PID, right? That would work nicely. Not wicked hard to code for something like that either.

hi futz,
The method works for me, I don't know the language the OP is using.??

If he wants to get a closer approximation to the D in PID, then he could use window values, say the number of windows equal to his maximum samples in an averaged number
 
Last edited:
Haow all you need to to do is some thing like this

If oldTemp less then newTemp by 10% count = 64 and loop 64 times and divide that for update of LCD

If oldTemp less then newTemp by 20% count = 32 and loop 32 times and divide that for update of LCD

If oldTemp less then newTemp by 30% count = 16 and loop 16 times and divide that for u date of LCD

If oldTemp less then newTemp by 40% count = 8 and loop 8 times and divide that for update of LCD

Some thing on that oder would work
 
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top