Resistance via digital control


#1

Hello everybody,
I haven’t been around much due to my new position.(I am now a full time design guy. Yay!) But I have run into an issue that I have been unable to figure out on my own with only the internet as my partner. So I thought I would give ol Contextual electronics a try. I would like to simulate a PT100 RTD output. Which for us comes down to basically needing to be able to control a resistance via a micro-controller from zero to 100ohm. So far I have tried a physical pot to verify I could control a pt100 amplifier in the way I thought it worked. And that did work well. Next I tried an optoisolator which also worked fairly well. Gave me good control and a decent resolution. But they are not very consistent from sensor to sensor. So not exactly ideal for outputting an accurate temp from device to device without a lot of calibration. Next i’m thinking of using a quad digital 1k potentiometer in a 4 way parallel configuration. That only gets me down to 250 ohms of adjustment in 256 steps. This would probably work decently well but still doesn’t give me the best resolution. I have read about a resistor network and digital switches\relays possibly working but I’m not sure what combination would work for this. Any other ideas how I can solve this are very welcome. Any input would be greatly appreciated. Please let me know if I am even logically close to being correct about how i’m approaching this. Thanks everyone! Brad


#2

Have you looked at the HCNR201/200 optocouplers?

They have dual matched photodiodes, so you can build a feedback circuit,


#3

Since a potentiometer output is basically a voltage divided by the resistors, could you not simply use a DAC output to feed a voltage as required?


#5

I’m not sure. The voltage used by the PT100 is only around .25 volts. So I don’t think a DAC will give me a usable resolution. Though I could be thinking about this wrong.


#6

I have not. Still a beginner. Not sure how exactly I would build a feedback circuit in this case. Thank you for the reply


#7

Thank you everybody for the replies. I am going to try and give the DAC idea a try as I alread have a particle photon bread boarded up with a adafruit max31865 to test with.


#8

By using a resistor divider on the DAC output, you can effectively “scale” the voltage to fall within the limits you require, while keeping the resolution reasonable.


#9

Hmm you’re absolutely right! I didn’t think about that. Ok I will breadboard this out and see what I get in the real world with my current setup. Thanks, no1089. Still open to other suggestions as well. I’ll let everyone know if I have success.


#10

What about putting a 120 ohm resistor in parallel with the A/B terminals on the 1k digital pot?


#11

PT100s are frequently used with current excitation and 3 or 4 wire configuration to compensate for wiring resistance, so that’s going to be a problem if the circuit you’re trying to similate a PT100 in works that way.


#12

I have been testing a voltage divider with a 3.3V 12 bit DAC and a 100ohm x 33ohm voltage divider. I can get the range I need 0-100C (actually a lot larger then I need from -171 to 165) with around .2C change per 1 count of change on the DAC output. Is there any downside to using the DAC and voltage divider?


#13

This doesn’t represent the signal you get from a PT100…? PT100 means 100 ohm at 0 degrees C. Here, a table from wikipedia :slight_smile:

The wikipedia page also suggests a typical circuit that uses a 1mA current source, from that you read voltage using a 4-terminal setup.

I would use a DAC or PWM plus LP filter if I needed to simulate this with a micro controller. But be sure that you know what range you are trying to simulate first :wink:


#14

Thank you for that, but I don’t need negative temperatures. So the first 100ohm will be a resistor. So I only need to control the upper 100 ohms.


#15

If you just need this as a one-off you can buy PT100 simulators that have 0-10V, 0-20mA, RS-485 etc control input…for less than $200…with a stated accuracy class of 0.1%. Could be a time saver.


#16

Unfortunately one off isn’t going to work in this case. Im trying to incorporate this into a sensor package that does several readings in place of a single pt100 temp sensor. (Our sensor won’t always be replacing a pt100 but this is the use case im attempting to solve. ) I am trying to incorporate this solution into an already designed micro board that controls the sensor system. So with the dac and resistor divider solution I only add a few resistor footprints and a connector footprint and connect them to an already existing DAC on the microprocessor on my board, which is a really attractive solution considering cost and board space.


#17

Hi Brad, just curious, did you manage to get this working?


#18

I did actually… I think?! So I ended up going with a voltage divider. The microprocessor I am using (Particle P1) has a Dac1 which is a 0 to 3.3 volt 12bit dac, not a PWM channel. By pumping that through the voltage divider I can control it to be 0-.8 volt. Now I use the 100 ohm resistor to set my temp to zero degrees. That’s with 0 volts from the dac. then I can change the resistance the MAX31865 sees by pumping additional voltage into the circuit via the DAC1. As the voltage rises the effective resistance the max312865 sees is going down because voltage and therefore current is going up. Gives me around .03 degree per DAC1 bit. Testing with the MAX31865 is how I verified most of this. So if anyone sees any glaring problems with this circuit please let me know.


#19

Also I’m pretty sure the solution I came up with was because of your comment. I think that was my eureka moment. So Thank you very Much! :tada::fireworks:


#20

I’m glad to hear it worked!
Always happy to help :slight_smile: