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.

ADC resolution increase?

Status
Not open for further replies.

MrDEB

Well-Known Member
using a 18F4520 and an RTD sensor. I want an increase in the ADC readings to indicate the status of the RTD sensor.
Using an RTD amplifier circuit but the results are dismal
The voltages at VF4 change according but can't get the same on the ADC readout.
Doing something wrong or need to change something.
The code is in Swordfish and using
Code:
Function sensor() As Word
        result = (ADC.Read(0)+1)*500/1024  //14 (RT) to 37 (melt) *30+22
    End Function
So the reference voltage is right
op amp 1 is a constant current source. That section seems to be working fine.
all I am after is better resolution on the LCD display. Presently it indicates .0081 regardless if the RTD is 50 ohms or 100 ohms.
 
Using an ADC ref as 5 volts you get a reading (raw) of 166 for your 50Ω and only 169 for your 100Ω the resolution is ~5mV so the figure won't move much

If you use a Vref on the ADC of 2.5v you'll get a raw value of 332 for 50Ω and 339 for 100Ω the resolution would be ~2.5mV

You may be better also amplifying the signal by increasing the 200k resistor to 270k.
 
Will give it a try. I have tried several different simulations even changed the 200k to a 1M (simulation only)
instead of multiplying the ADC by 500 will try 2.5 but I don't think I can multiply w/decimals. Going to try but may have to go with 2
Function sensor() As Word
result = (ADC.Read(0)+1)*2/1024
End Function
 
....will try 2.5 but I don't think I can multiply w/decimals....

Would you be able to use an equivalent?

Such as:

a *= 5;
a /= 2;


is the same as :

a *= 2.5;
 
Last edited:
The code is in Swordfish and using
Code:
Function sensor() As Word
        result = (ADC.Read(0)+1)*500/1024  //14 (RT) to 37 (melt) *30+22
    End Function

all I am after is better resolution on the LCD display. Presently it indicates .0081 regardless if the RTD is 50 ohms or 100 ohms.

Is the problem hardware or software?
How much does the voltage on ADC(0) change in volts? Measured with a volt meter.

You must be doing 16 bit int. math.
I don't know swordfish! Is the ADC.READ 8 bit or 10 bit?

I can not get from ADC.READ to .0081?
Please talk us though what you are doing.
Read analog input.
multiply by 500
divide by 1024 = shift
??
 
Is the problem hardware or software?

Both... His maximum is only 0.829v so amplification is really needed.

Also when multiplying and dividing you can "up the auntie" ADC *25 / 10240 is the same as.... ADC *2.5 / 1024
 
Here maybe a better picture

238.095 millvolts low side of the range 50 ohm
652.174 Millivolts high side of the range 150 ohm

opamp with gain set to 7

652.174 x 7 = 4565.218 whitch is 4.565 volts

divde that into 1024 let's you have a nice readable range
.2243millvolts per step
 
hi DEB,

Regarding your actual circuit, I would suggest that a LM317 is not a suitable reference source for accurate measurements.

Also is your RTD a PT100 or PT1000 type.???

What temperature range do you want to measure over.??
 
revised circuit

the RTD is being used in a soldering iron so the temp goes all the way to 400C + some.
at present the iron works BUT not much resolution.
For voltage reference I am using the 7805 regulator (did try using the LM317)
The Swordfish code is using 12 bit? if I recall rigfht.
I tried multiplying by 2.5 with dismal results.
I need a wider range between the readings. Using TINA I THINK I may have found a solution.
Using an example circuit that is used for a thermistor amp.
Will rework present circuit and come back with results.
 
Here's an amplifier suggestion, based on your simulation. The graph shows output as RTD resistance goes from 50Ω to 100Ω.
 
Alec can you attach the simulation to a post so I can simulate same.
The circuit I posted works good but open for improvement
 
I simuliated in TINA (can't figure out how to get parameter steping? in LTSPICE) and alec circuit looks even better. A wider gap between readings of say 50 ohms and 60 ohms.
 
The schematic I posted for the thermistor amp works rather well. The circuit Alec post would probaly work better? but the soldering iron seems pretty accurate seeing how I have no way to actually measure the temperature. Using 50 ohms as room temp of 70 degrees. Wrap a section of solder over the iron tip and when the solder melts quickly then its around 370C
using the LCD readouts rt = 21 solder melt at 48/49 or so. The LCD readout jumps from 47 to 48 and then 49. The desired temp is set at 376. I am using tip ADC reading < Desired temp = heater ON Then multiplying by 8 the tip ADC reading (works well)
At 47 the green lEDs indicates iron heating at 49 the RED led comes on indicating iron is hot enough. The difference between 47 to 49 is an ADC reading (the LCD readout) of 16. pretty close. With slight adjustment I got down to an ADC reading difference of 8 between 47 and 48.
I venture a guess if I used alec schematic it would be a finer adjustment. BUT as is is close enough for rock n roll.
 
Herewith the .asc file for an LTSpice sim
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top