Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Multi Pt100 for Pic18 with unstable power

Status
Not open for further replies.

OrdosDeviator

Member level 1
Joined
Jan 6, 2016
Messages
34
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
274
Starting point:
Power +5V (now it is taken from +24V by MC34063A output ripple 40-400mVpp).
8 Pt100 RTD channels, required range 0C - 300C.
Desirable measure accuracy is not less 1C. (0.5C or 0.1C would be awesome also :) )

Objective: to build up to 8 temperature measure channels based on PIC18F46K22.

I have built Pt100 channel as you can see at the picture.
ScreenShot1329.png
Proteus simulation tells me the biggest voltage span is reached with R1=~150 Ohm.
For temperature range 0-300C the voltages are from 2V to 3V so the span is about 1V.
Real implementation gave me 2.1V for 20C so I consider Proteus quit trustworthy.

PIC18 ADC VREF+ was connected to power.
I collided with the situation ADC gaves me ripple up to 4 bits wich is unacceptable.
Also 1024 bits ADC gives resolution 204 bits/1V, in my case it would be 204bit/300C
so I cant reach accuracy 1C.

PIC18F46K22 has stable VOLTAGE REFERENCE setable 1.024/2.048/4.096V and I can switch it to out pin,
bit it can't supply 8 Pt100 cahnnels. Now every channel eats ~20mA.

So, I need advice in which direction should I dig.
- May be/how to get stable 500-1000mA 5V power (from 24V) stable enough to feed temperature sensors and all my scheme.
- May be/how to get independent stable power for Pt100 feeding.
- How to expand voltage range for Pt100 0-300C to reach ADC accuracy about 1bit/1C.

Restrictables:
Pt100 cant be changed.
Additional individual chip for every pt100 is unacceptable (but common chip for all channels is acceptable).
Part replacement cant be very expensive.
 

If R1 = 330 Ohm and ADC VREF = 2.048V, then:
ScreenShot1333.png
Pt100 (0C)=1.17V=584bit
Pt100(300C)=1.96V=979bit
___________
300C RANGE = 395 bit / 1 bit accuracy = 0.75C which is acceptable.

Max current would be 12mA/channel.
Suppose I put reference 2.048V on pic out pin.
Than I need one chip buffer 2.048V with max input 20mA (pic pin restriction) and 2.048V with 12*8=96mA guaranteed output.
Though I havent checked PIC VREF stability for my case.... I will be able to do it on Monday.

- - - Updated - - -

Same calculation for R1 = 1kOhm ADC VREF 1.024V:
Pt100 (0C)=0.46V=459bit
Pt100(300C)=0.88V=879bit
300C RANGE = 420 bit / 1 bit accuracy = 0.71C.
Max current 5mA/channel.
The buffer needed 1.024V 20mA max input 5*8=40mA guaranteed output.
Looks like it consumes less current but it is more noise sensitive. Isn't it?
 

As PIC ADC is 1024 bits
so
0V = 0 bit (as I have no another Vref-)
VREF+ = 1023 bit

X= (our voltage*1023)/Vref+= (1.17*1023)/2.048

o, sorry my language. ADC is 10 bit so it can be 1024 points.
 
Last edited:

Now every channel eats ~20mA.

You cannot feed each thermometer with 20mA; it should be 1-2mA.

Last bit after the ADC conversion is noise-limited and hence unreliable.

What do you mean by 1024 bits ADC? PIC ADC will typically be 10bits (max reading 1023). That will give a resolution of 1mV.

You need to feed each thermometer with a const current 1-2mA and measure the voltage directly. Do you have differential input for ADC channels?
 

Yes, 10bits ADC.
Yes, every different channel will be connected to individual analog input.
 

Let us see the approx values first. The thermometer has R(0)=100R; R(400)=200R # this is not a real value
1mA via 100R will give 100mV; not enough resolution; 5mA via 100R will 500mV and 1000mV at the highest temp.

The heat produced will be 5mA*5mA*200=5mW # acceptable

Set Vref at 1024 so that you will save on some calculation. One bit change will be 1 mV

Now you can decide how to set the volts and currents.
 

Are the PT100 devices two terminal or four terminal?
 

You can increase R1 to 330R and shift R2 on the other side of C1. You need to compute current every time to get the resistance (in the software). Rest are fine.
 

hello

If you use a voltage divider to power on the Pt100, you will not have
a constant current for 0°C and 400°C value , not linear behavior...
and if you use Internal +VREF of the PIC, you will not have ratiometrique compensation
if your +5V change of value ( + big Ripple 400mV).
Better is to use one Current generaror to deliver 5mA for each PT100
and use a 18F PIC with 12bits ADC like 18F2553 or 18F47J53 .

**broken link removed**
and ratiometrique calibration to compensate drift for C condensator value f(Temper).
maybe you can use this principle ( after adaptation with more rescent devices / solution) .
 

10 bits looks quite enough to get accuracy 1C.
I dont really care about some non linear line, i can correct it in software. Or I ll be able to build correct calibration table voltage <-> temperature.
My general issue now is not stable power in the input.
I need chip and beatiful solution how connect not very good general power, but maybe local stable power for 8 temperature channels.
Tomorrrow I try to put out inner PIC Vref+ 2.048V and do some experimrnts...

Dont you have samples of using current generators? Can I use 1 common source for all 8 channels?
 

10 bit resolution is sufficient in theory, but you should also look on specified absolute accuracy and linearity.

A common current source is surely possible, using a second multiplexer with sufficient current capability.
 

To follow on from FvM, 10 bits is what you can get theoretically. However in practice you will be lucky to get 8 bits of actual resolution - the other 2 bits will be noise.
You might be able to use an ADC wit more bits resolution but that will require you stabilise EVERYTHING else better as well.
You really need to make sure your design takes the practical limitations of the devices into account.
Susan
 

Hi,

To follow on from FvM, 10 bits is what you can get theoretically. However in practice you will be lucky to get 8 bits of actual resolution - the other 2 bits will be noise.
Noise will not influence resolution, it influences ENOB. Maybe precision.

True noise may be reduced with filtering. But often it is not "noise" but influence if some foreign frequencies.
Some of the foreign frequencies may be filtered out, some not. It depends on frequency, sample frequency and stability of both.

Often the signal is influenced by mains frequency. This usually us easy to filter out, because it is a known and srable frequency.

****
"Pt100 and unstable power."
I assume with unstable power you mean unstable power supply.
In this case there are two solutions*
1) build a circuit for stable PT100 supply AND build a circuit for stable VRef of the ADC.
2) or - because PT100 can work as ratiometric measurement - just don't care about the instability. (Simple solution.)

Imagine Rv = 300 Ohms and PT100 = 100 Ohms. Vcc is used as VRef of the ADC and for the Pt100 supply.
Now if VCC = 5.00V the PT100 voltage is 1.25V --> ADC reading is 256
If VCC = 4.8V, then PT100 voltage is 1.2V, but ADC reading will still be 256.

If you use analog filters, then be sure to use the same characteristic on VRef and PT100 signal.

***
Rv calculation for biggest span:
Rv = sqrt( Rmin x Rmax)
Where Rmin and Rmax are the PT100 values for minimum and maximum temperatures.

With a Rmin = 100ohms and Rmax = 300 ohms --> Rv opt = 173 ohms.
The usable ADC range is just 274 LSBs.
Therefore consider to use an Opamp to extend the usable ADC range.

Klaus
 

Today's experiments showed that software filtering would be OK.
Preliminary:
R1 1k. (current~4mA) Vref+ internal 1.024V. (to get better resolution at 300C. Voltage on Pt100 is very close to 1V)
I just fixed min and max every 2 seconds and averaged it. Noise dissappeared.
Later I think it out better filtering, but even now it looks fine.

;) R(300C)=~200Ohm

V(300C)=0.878116V=877
V(0C)=0.458677V=458
so span=419 wich is acceptable for 300C.

R1 is about 900 Ohm would have given better span but 1k is more common.
 
Last edited:

If you can get 1% R1, go ahead with the design. There are excellent software tools to reduce noise.
 

I am a person to reinsure.
Real operation range is about 200C. I put it 300 just in case.
(Anyway I keep every variable in 2 bytes. Its comfortable to transfer them by MODBUS in touchscreen. Just bragging.)
So I don't care about resistor toleranse.
Also temperature measuring channel shouldn't be very calibrated.
Operator always can adjust preset temperature up and down. No matter real temperature 180C but 190C represented.
The point is to keep it stable.
 

Hi,

V(300C)=0.878116V=877
V(0C)=0.458677V=458

You want best accuracy:
then correct is:
* V(300C)=0.878116V=878
* V(0C)=0.458677V=459
I know the error is marginal, but maybe you need that little piece of accuracy.

because ADC_out = 1024 * V_In / V_Ref (With the most ADCs, so I assume this is the same with PIC)
1024mV VRef:
0mV --> 0 LSB
1mV --> 1 LSB
..
1023 mV --> 1023 LSB
1024 mV --> 1023 = out of range

Klaus
 

It is just an example.
The real parameters will be checked and changed many times.
Also I need to put some calibration ranges, bias and so on.
There will be a formula to convert ADC result into temperature.
Yes, 1023 is the maximum value, also ADC gives 1023 in case of broken wire to Pt100 for this case.
As I told, operation temperatures hardly ever exceed 250C.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top