Mimic a thermistor with a digital potentiometer?

rmeldo

Senior Member
Hi,

I need to find a way to digitally replicate the behaviour of a thermistor.

The Project:

I am working on creating a close loop control to optimise the heating system in my block of flats. The heating system has two large identical boilers controlled by a compensator (Datasheet attached). The compensator can adjust the boiler temperature set point according to information from an external temperature sensor (calibration curve shown on page 9 of the datasheet and also plotted in one of the attachments to this post) and two room temperature sensors. In our setup however only the external temperature sensor is present. Without the room temperature signal the compensator works in open loop only.

My idea is to install a number of room temperature sensors and upload the data to a web server which will do the averaging. In the boiler room a Picaxe would connect to the web server, read the average temperature and adjust a digital potentiometer through (I2C) which acts as a room temperature sensor. I will be working with the heating engineer from the company which looks after the building.

My question for the forum is whether a digital potentiometer is appropriate for this project.


Many Thanks
Riccardo

View attachment 19194View attachment 19195
 

Attachments

tracecom

Senior Member
My idea is to install a number of room temperature sensors and upload the data to a web server which will do the averaging. In the boiler room a Picaxe would connect to the web server, read the average temperature and adjust a digital potentiometer through (I2C) which acts as a room temperature sensor.
I am confused. Do you mean that the digital pot would act as a temperature sensor or as a temperature controller?
 

Technical

Technical Support
Staff member
You can often 'fake' a device like a thermistor by simply using pwmout onto a resistor to capacitor to ground, the connection between the resistor/capacitor is connected where the thermistor would have been.

Varying the pwmout frequency will alter the voltage measured at the r/c junction.
 

rmeldo

Senior Member
Sorry,
I realized I didn't explain this fully. The pot would be seen by the compensator (which is the controller) as a thermometer.

So the setup is as follows:

Room thermometer (#10 off) --> WiFi --> Website (average) --> Picaxe: download mean temperature --> digital pot (I2c) --> compensator (controller)

Please ask again if still not clear.

Thanks
Riccardo
 

fernando_g

Senior Member
I believe he wants to simulate a thermistor, without the hassle of actually changing the temperature.

Technical's suggestion is a good one.

But if you want to use an actual digital potentiometer, what I would do is employ an I2C digi pot where you can arbitrarily set the cursor value. Then by using a lookup table, access the digipot's cursor value that mimics the thermistor response.
 

rmeldo

Senior Member
That's exactly what I was thinking of doing.

Would I need any additional components (other than an inline fuse)?


Thanks
Riccardo
 

BeanieBots

Moderator
One concern that comes to mind is what potential might exist on the existing thermistor with reference to whatever might be your signal ground.
This would not be an issue if your circuit is battery powered or is powered via an isolated supply, but it is to be "wired in" to an existing circuit, it could be catastrophic.
This might sound tacky, but an option might be to replace the thermistor with an LDR and use PWM from the PICAXE to drive an LED optically coupled to it.
You might even be able to find a off-the-shelf opto-isolator with suitable characteristics to mimic the thermistor when driven with PWM.
 

rmeldo

Senior Member
That's interesting.

First, in regard to the digipot , I was thinking of using a 5v plug to charge phones and connect the 5v ground to the compensator board the thermistor would be connected to (if it was there). Would this be a problem? Is this too general a question?

For the ldr (I like it because it keeps everything separate), a question which springs to mind is stability over time, i.e. will it lose calibration?

Thanks for the advice
Riccardoy
 
Last edited:

AllyCat

Senior Member
Hi,

You certainly need to measure the voltages that might be applied to the "thermistor" terminals (particularly when it's high resistance).

But I agree that a LDR + LED/PWM is probably the way to go. It should be quite stable, but stability and/or linearity shouldn't be too much of an issue if you're planning to run truly "closed loop" (as said in #1).

Cheers, Alan.
 

BeanieBots

Moderator
LDRs are not the most accurate or stable of devices and they do age and change their characteristics over time. (dirt and moisture ingress).
I always use them as a pair in a bridge. You could do the same with one (permanently dark) as part of the other leg of a potential divider to mitigate some of the undesired characteristics.
However, I was under the impression that your system would be closed loop, so that should not be a problem (within reason).

In most cases, connecting the 0v lines of two isolated supplies should not be an issue. The only time things can go wrong are when there is a large differential voltage and/or there is noise sensitive circuitry involved.
If this might apply to your application depends on the details of how the thermistor is connected in the other equipment.
As AllyCat says, MEASURE it.
Also, whatever method you adopt to simulate the thermistor will be governed by how it is currently measured. For example, if the original controller was say a PICAXE, it very likely that the programmer used it in a simple potential divider configuration and used ReadADC to measure the potential. Thus, it would be easy to replace that potential divider with a simple voltage possibly derived from PWM. IF however, the original controller was say a BASIC_STAMP, then there is no ReadADC function available and voltages are measured by applying them to a capacitor and seeing how long it takes to discharge into a known load. This means that other characteristics and dynamics need to be considered.
Also, many digital POTs have very few steps. Often as few as 64. PWM offers 10-bit resolution. You've not mentioned (that I recall) how accurate or what resolution is required.
 

rmeldo

Senior Member
Thanks for the detailed explanation of the ldr option.

As long as I can go for a year without recalibration then it is good enough for me. I will start experimenting with what I have at home and go from there.

The 10 bits resolution is quite a good point. I was looking at a 129 steps linear pot (8 bits) as good enough, but if I found a ldr/led pair with exponential behaviour then that would be much more than I need.

With regards to the close loop I think you are right, I think.

My only reservation is that the device which would use the 'fake' thermistor (representing the room temperature measurement) to close the loop is a commercial product and from its control panel I can only specify the target room temperature.
So I need some accuracy, I think.

On the other hand because I am in control of the link between the real WiFi temperature sensors instalkedvin the various flats and the ldr/led then I can write code to correct errors in the ldr resistance (compared to the specs of the thermistor given in the manual for the commercial controller) and achieve the target room temperatures

Thanks for all the help. I will do some prototyping and testing.

Riccardo
 

tmfkam

Senior Member
Could the *original* room temperature sensor be placed in an enclosure in close proximity with a wirewound resistor, driven by PWM under control of the PicAxe, to heat the thermistor to simulate the required temperature?

That might minimise the modifications required to the original heating controller and (if enough distance was placed between resistor and thermistor) provide electrical isolation too. A second thermistor could be positioned inside the enclosure, near to the resistor, to provide feedback to the PicAxe for maintaining temperature control.
 

rmeldo

Senior Member
Could the *original* room temperature sensor be placed in an enclosure in close proximity with a wirewound resistor, driven by PWM under control of the PicAxe, to heat the thermistor to simulate the required temperature?

That might minimise the modifications required to the original heating controller and (if enough distance was placed between resistor and thermistor) provide electrical isolation too. A second thermistor could be positioned inside the enclosure, near to the resistor, to provide feedback to the PicAxe for maintaining temperature control.
Interesting idea. I was looking for something with faster reaction time. Also the device it would have to be housed in an environment with a temperature lower than, say, 17-18 degC to have the possibility of achieving the lower temperatures.

Many Thanks
Riccardo
 

tmfkam

Senior Member
Interesting idea. I was looking for something with faster reaction time.
It would provide some hysteresis...

Also the device it would have to be housed in an environment with a temperature lower than, say, 17-18 degC to have the possibility of achieving the lower temperatures.

Many Thanks
Riccardo
I did think that, but assuming the boilers were located in a basement or similar, I wondered if the temperature 'down there' would be less than the required room temperature. Insulate the boilers to prevent them from heating the room?

I thought it might be possible to compensate for a warm boiler room by either using a different temperature coefficient thermistor (that requires greater heating to reach the same resistance) and simply scaling the heating effect of the PicAxe/Wirewound resistor to suit. Such that for a target room temperature of 25oC the resistor/thermistor was heated to a temperature twenty degrees higher.
 

nekomatic

Member
If you really wanted to go down that route, you could use a small Peltier heat pump module to either heat or cool the thermistor above or below ambient. But I think that would only be worth doing if there was some overriding reason that you couldn't interfere with the electrical connection to the thermistor.

If you decide that you can't, or don't want to, common the ground of your Picaxe circuit with the low side of the thermistor, one option would be to supply the digital pot from an isolated DC-DC converter... but then you'd need to optically isolate the data lines to the digital pot as well.
 

rmeldo

Senior Member
Hi all,

a quick update:

I tested the PWM/LDR route and it all looks straightforward (he said naively). I got a nice resistance curve Vs PWM duty cycle using the LDR which came with the Picaxe datalogger. The problem was that the LDR didn't have the right resistance range for the thermistor I want to fake. (see the first post in this thread: http://www.picaxeforum.co.uk/showthread.php?28436-Mimic-a-thermistor-with-a-digital-potentiometer&p=293704&viewfull=1#post293704)

The book "the art of electronics, 3rd edition" mentioned the VTLxC optocouplers and the VTL6C seems to have the appropriate resistance range. The datasheet is too big to be attached but here is the link: http://pdf1.alldatasheet.com/datasheet-pdf/view/84394/PERKINELMER/VTL5C6/+5__95ULwPIpOhxRIXFdcuGxp+/datasheet.pdf.

Would it be suitable for this application? Any drawbacks?

Many Thanks
Riccardo
 

hippy

Technical Support
Staff member
The problem was that the LDR didn't have the right resistance range for the thermistor I want to fake
What results did you get ?

It appears you need a resistance between 20K and 60K; perhaps you could use multiple LDR's in parallel or serial or use them to modify a resistor circuit to give that ?
 

rmeldo

Senior Member
I will tidy up the results and post them.

From memory of the tests three LDRs in series might do the trick, although I would prefer to find a LDR with the right resistance range. I will keep looking

Thanks
Riccardo
 

nekomatic

Member
I don't know how their resistances compare to the VTL devices but you could also try looking at the Silonex / Advanced Photonix NSL32 / NSL32SR2 / NSL32SR3 optocouplers.

One thing to check with any device you're substituting for the thermistor is whether it can handle the power dissipation due to the measuring voltage/current - you would expect this to be small to eliminate self heating but it's best to be certain.
 

rmeldo

Senior Member
LED-LDR test-response to PWM.jpg VTL5C6 datasheet.png

See attached the test of the LDR lit by a red LED.

Although it responds to the PWM, the curve is very non linear and the resistance range is lower than the thermistor I want to replicate.

Attached is the datasheet of the VTL5C6. It seems to be quite appropriate.

Thanks
Riccardo
 

BillBWann

Member
Although it responds to the PWM, the curve is very non linear and the resistance range is lower than the thermistor I want to replicate.
I would think that you could improve the resistance range of the LDR by putting a resistor in series with the LED to reduce its brightness
 

rmeldo

Senior Member
So yesterday the VTL5C6 optocoupler arrived in the post. I took a bunch of measurements to characterise the component.

The data is summarised in the attached chart. VTL5C6 characterisation.jpg

Basically the component covers the same range as the thermistor I want to replicate. The resistance vs PWM% is also sufficiently gradual to allow for, hopefully, sufficient resolution. That also can be improved by adding a 14K resistor in series to the output side of the optocoupler.

One thing I noticed is that the component is quite sensitive to its own temperature. I can cause significant resistance shifts by holding it. It also requires some time for the reading to stabilise, when the PWM% is changed from low to high or viceversa. I guess it is mainly due to the current on the input side (up to 30 uA) causing internal temperature changes.

All in all I am quite pleased with the choice, but I was thinking that for better accuracy I should also place a temperature sensor near (or attached to?) the optocoupler to correct the PWM map. Any Suggestions?

Many Thanks
Riccardo
 

rmeldo

Senior Member
Hi,

I have hit a problem which stretches me beyond my basic knowledge and I could do with some advice.

I wired the LED side of the optocoupler (VTL5C6, datasheet found here) to the PWM pin (the other pin is connected to ground). I also have a resistor in series. to limit the current.

When I check the the resistance at the output side of the optocoupler using a multimeter I get the calibration curve as in the previous post. That is what I need.


However when I try to read the resistance with an ADC then the values fluctuates. Since in my application the resistance is read through an ADC then i am worried. I need a way to eliminate those fluctuations.


I used an oscilloscope to diagnose the problem and looking at the input to the ADC, where the optocoupler output side is one of the two resistors in the voltage divider, the signal looks like a saw tooth. I think it is because the optocoupler has fast turn on but slow turn off. So I found the reason for the fluctuation. (The PWM driving the input side of the optocoupler is a square wave of varying width, as it is meant to be).

The problem is that I haven't worked out how to fix it. I have tried to put a capacitor across the two pins of the optocoupler, on the LED side. This makes the voltage constant but the optocoupler shows its maximum resistance.

It is as if, with the capacitor, no current flows through the input stage of the optocoupler. could this be the case? Something to do with the fact that I have effectively implemented a low pass filter? Would this limit the current?

Thanks in advance
Riccardo
 

premelec

Senior Member
I'm not entirely sure of your circuit but it's evident if your output resistor [LDR] stays high then the LED isn't getting enough current... and voltage... if you can put a diode from the output to the filter capacitor that could help if your output pin goes on and off [discharging the capacitor when going off] - in any case a drawn actual circuit would help...
 

AllyCat

Senior Member
Hi,

Did you try a capacitor across the LDR (optocoupler output)? That should give the low-pass filtering action that you require, but might not be ideal because the time constant will vary with the voltage level.

The reason that what you have done doesn't work is because the LED (in the optocoupler) generates light proportional to the current flowing, and works at constant voltage (around 1.5 volts for that optocoupler). Normally, the resistor not only "limits" the current, but also converts the (variable) PWM output voltage into a variable current. But your capacitor filters the PWM to a dc voltage; if the PWM is less than about 30% duty cycle then there won't be enough voltage to turn on the LED at all. Above that PWM/voltage, the filter will be rather "rubbish" because it will be "shorted out" by the low impedance of the (now conducting) LED.

If you want/need to put the low-pass filter on the "PWM" side, then you must either use another resistor, between the capacitor and the LED (i.e. a "T" network) to convert the V to I, or use an inductor (in series with the resistor) to act as a (low pass) filter for the LED current.

Cheers, Alan.
 

rmeldo

Senior Member
Too much drift

Thanks for the advice and sorry for the delayed response.

I did take Alan's advice and put 50uF capacitance (two 100uF electrolitic capacitors in series and with inverted polarity with each other) in parallel with the output of the optocoupler. That made the voltage rock steady.

I have now connected the circuit to the commercial controller and it worked well. by changing the PWM duty cycle I can affect the reading of the temperature by the controller. Because of the capacitor it takes a few seconds for the temperature reading to change, when I change the PWM duty cycle, but this is a good thing.

I have however found another problem. When I started to calibrate the PWM duty Vs temperature read, I found that there is a constant drift. Several times I did run PWM sweep, noted down the temperature and work out a calibration curve to program into the microcontroller. That works well for a few minutes but then the drift continues. I have repeated the process a few times but I don't seem to reach a steady state. I attach a chart showing the calibration attempts. Beaniebots had mentioned drift, but I wasn't expecting this to happen in front of my eyes in a matter of minutes.

To give an idea of the rate of drift, it is about 0.3 degC / hour. I haven't left it run for more than an hour though so I don't know whether it is going to stabilise but I fear it wont.

This is going to be a BIG problem for controlling the heating.

I am left wondering whether the drift is due to the optocoupler (the datasheet talks about the resistance after 5 seconds being smaller than the steady state one) or it may due to other parts of the circuit.

Another piece of information: I have a temperature sensor sitting at 1 mm from the body of the optocoupler and the drift happens with the board temperature being almost constant (fractions of a degree C). Obviously this is not a measurement of the optocoupler internal temperature, but hopefully it quantifies the temperature variable.

Any advice on what I should do?

I am wondering whether I should look for other ways to fake the thermistor (digital pot? other?). I still haven't measured the voltage across the optocoupler when In situ. I will do it tonight.

Any more advice would be appreciated.


Thanks in advance
Riccardo

calibration_For_Forum.jpg
 
Last edited:

AllyCat

Senior Member
Hi,

I think we may need a summary/update of the present "state of play", in particular, is your power supply rock-stable and what is the PWM frequency? Have you tried a lower (or higher) PWM frequency? As I recall it, you are not actually using a Digital Pot. (as in the title) but an optocoupler which happens to use a LDR rather than the more normal phototransistor? Why are you using two electrolytics in series, is the "output" voltage ac, or of "unknown"/variable polarity? Two electrolytics connected like that might behave "strangely"; if you must use an electrolytic (with a reversing voltage), maybe put a diode across each capacitor (to conduct in the reversed direction).

Before jumping to conclusions, I'd want to see a plot of the actual voltage/current across the LDR for several hours to determine if the "drift" is linear or exponential. What is the power level in the LDR and how stable is the ambient temperature?

Cheers, Alan.
 

premelec

Senior Member
@rmeldo - I'm not seeing the actual circuit you have however I would never expect a lot of analog stability from an LED + LDR if you are using it in that way. [would be ok for slow digital transfer... or in circuit with corrective feedback]
 

rmeldo

Senior Member
Thanks for helping.

The answers to the questions above are:

Q: do you use an optocoupler which happens to use a LDR rather than the more normal phototransistor?
A: I do use the optocoupler VTL6C5 (performance curves in post #21 of this thread. This was advised by the forum because the output is a resistor. Reading the datasheet it talks about light history memory. This might be the problem. The circuit is here:


Circuit_small.jpg

Q: is your power supply rock-stable?
A: I am using a 3A max approved power supply for Raspberry pi. I haven't actually checked how stable is the power supply. I will do it tomorrow. Do you mean with a multimeter or with a oscilloscope? I presume that since we are debugging a drift then a multimeter should be sufficient


Q: what is the PWM frequency?
A: I am using an arduino Nano to drive a (8 bits) PWM at 500 kHz. I have tried a lower PWM frequency before (before I fitted the capacitor on the downstream optocoupler circuit), but I was debugging the oscillations so I did not pay attention on whether there was a drift.


Q: Why are you using two electrolytics in series, is the "output" voltage ac, or of "unknown"/variable polarity?
A: In order to not have to bother about the polarity and because I did not have suitable non polarised capacitors at home. Now I have a ceramic of about 10 uF and I could replace the two electrolytics.

Q: actual voltage/current across the LDR for several hours to determine if the "drift" is linear or exponential.
A: The circuit is currently on. I will check in the morning but the initial readings are:

- Open circuit voltage across the optocoupler output = 5V (very happy about this. Does it mean that I could also use digital pots if the optocoupler technique doesn't work out?)
- Optocoupler resistance with 0 PWM is larger than the multimeter can measure

Readings:
Time Voltage Equivalent Temperature (as displayed on the commercial controller)

20:25 3.573 24.9 C
20:30 3.663 23.1
20:32 3.677 22.7
20:36 3.690 22.4
20:38 3.694 22.0
20:44 3.712 21.8

Here is the data plotted in a chart:

forForum Eve 12Sep2016_small.png

The temperature measured by the DS18B20 on the board was about 30 C.

The system is operating through the night and in the morning I will take another measurement.

Thanks again
Riccardo
 

rmeldo

Senior Member
the morning reading was disappointing. Yet more drift.

Time, ---- Voltage ------ Equivalent Temperature (as displayed on the commercial controller)
13/09/2016 07:34 3.862 18.5

supply voltage 5.038V

Chart attached.

forForum Eve 13Sep2016 morning- small.png

I will take another measurements tonight after work.

Thanks
Riccardo

P.S.

As a backup I've bought a digital pot: (DS1801+, Digital Potentiometer 45kΩ 64-Position Log 2-channel Serial-3 Wire 14-Pin PDIP).I might also have to have a second potentiometer of smaller resistance in series to do the fine trimming.
This route should be viable now that I know that the potentiometers would be subject to 5 volts potential difference.
 
Last edited:

hippy

Technical Support
Staff member
This VTL6C5 seems to be a perfect component for the job, a pure resistance which can be varied by a completely isolated means.

The datasheet indicates the resistance is controlled by the current through the LED. But you are not doing that with PWM. With PWM you have the LED current alternating between fully on and fully off, the resistance will be continually alternating from a low value to a high value.

You are not emulating a variable value resistance but are using a rather odd capacitor setup and relying on whatever is in the 'black box' of the controller to tell it a temperature value.

The VTL6C5 is not being used as a variable resistor, it is being used as a high-speed solid state relay.

If you just varied the resistance, so it actually emulated the thermistor which it replaces, it might work out better.
 

rmeldo

Senior Member
Thanks Hippy.

Would it help if I drove the current in the VTL6C5 through a transistor? How do I vary the current? voltage? in the base of the transistor? How would I make sure that the base current/voltage is stable?

Thanks
Riccardo
 

AllyCat

Senior Member
Hi,

IMHO there are (still) so many "unknowns" that it's difficult to predict the fundamental cause (assuming there is only one):

I presume the 500 kHz "PWM" is the basic clock frequency and the "square wave" is around 2 kHz? The delays associated with switching the LED at 500 kHz, would probably be far too high/variable.

But my suspicion is excessive leakage current through those Electrolytic capacitors. Normally one doesn't use electrolytics where leakage current might be an issue. From what you've posted above, it appears that the LDR has a resistance around 30 - 40 kohms and is dropping about 1.3 volts, so the current is perhaps 40 uA. Typical data for an electrolytic capacitor is that the leakage current may be 0.01 x CV (where CV is the capacitance and voltage rating in uF and V) or 3uA (whichever is the larger) and I believe may be even more if the component has been "on the shelf" (without voltage applied) for some time. So the leakage current might be comparable to the current change that you're trying to measure.

But as premelec says above (and I believe I hinted at much earlier in the thread), one would normally use this arrangement "closed loop" (i.e. using negative feedback). Thus, if the temperature is (say) too high, then one increases the current in the LED, regardless of the actual (PWM/LDR) value, to make the control loop "think" the temperature is higher than it is. Of course the loop gain and time delay (in software) needs to optimised to avoid too much "overshoot" or even instability.

Cheers, Alan.
 

hippy

Technical Support
Staff member
Not sure what the best way to do it is, but I would imagine an RC to convert the PWM to a voltage, and then feed that voltage through a resistor to the LED. The current through the LED will then be proportional to the voltage, which is proportional to the PWM ...

Code:
        ___         ___    .----------------.
PWM >--|___|---.---|___|---|---.        .---|---
               |           |  _|_      .|.  |
             __|__         | _\ /_ ... | |  |
             ==.==         |   |       |_|  |
               |       .---|---'        |   |
              _|_     _|_  |            `---|---
                           `----------------'
You should also be able to use a DAC to create the current you need through the LED and you should be able to create that DAC using just the digital outputs of a PICAXE port -

Code:
         ___         ___    .----------------.
IO0 >---|___|---.---|___|---|---.        .---|---
IO1 >---|___|---{           |  _|_      .|.  |
IO2 >---|___|---{           | _\ /_ ... | |  |
  :             :           |   |       |_|  |
  :      ___    :       .---|---'        |   |
IOn >---|___|---'      _|_  |            `---|---
                            `----------------'
You might even be able to combine the two for coarse and fine control. I wouldn't have expected any transistor or op-amp buffering to be required though I am not a qualified electronics engineer.
 

rmeldo

Senior Member
Thanks for the suggestions.

I will replace those electrolytic capacitors with a single ceramic one (they were definitely vintage, not sitting on a shelf but in a box).
And I will have a go at sizing the RC. That will be interesting, I've never done it.

Hopefully this will do the trick. I might even be able to remove the capacitor on the output side altogether.

With regards to the close loop suggestion, while I do understand and agree that it would solve the issue I am struggling to see how to do it without making an electrical connection between my circuit and the commercial controller, which is why the VTL5C6 had been suggested in the first place. Am I missing something?

Thanks
Riccardo
 

AllyCat

Senior Member
Hi,

Yes, that's the "T network" that I mentioned in #26, but the resistor values may need to be chosen with some care. It appears from the optocoupler data sheet that you only need to put 1 or 2 mA through the LED to get the LDR value around 30 - 40 kohms, but you have written 30 mA in your diagram at #30. Actually, the PICaxe is very unlikley to source 30 mA (which is also above its Abs Max pin rating), but I suggest starting with 2 x 1k resistors across the top of the "T", with perhaps a single 100 uF filter capacitor.

Beware that the LED has a significant forward voltage drop (1 - 1.5 volts) which itself has a tempetature coefficient, so the voltage drop (and hence current and LDR resistance) will change as the diode "self-heats", or if the ambient (local) temperature varies. Thus the LDR value will not start to fall for the first 20% - 30% of the PWM duty cycle and then will be somewhat dependent on the actual LED temperature (among other things). The tempco is not large (~ -2 mV/degC) but if the LED is driven from too low a resistance (i.e. a few hundred ohms) then temperature changes (unrelated to the value measured by the DS18B20) may cause the LDR resistance to "drift" by a few percent.

Sorry, but I don't think that your 64-level (6-bit) Digital Pot or hippy's pseudo-DAC are really up to the job, unless you choose the analogue interface resistor values very carefully. You've been "complaining" about a "drift" of some tens of mV, which represents around 8 - 9 bits resolution (or 256 - 512 DAC levels) from a 5 volt rail.

Cheers, Alan.
 

rmeldo

Senior Member
Yes I was just doing the maths about the number of steps I would need in a digital pot to get the resolution and it led me to the need to have two in series, one for big steps and another for smalls.

I also was considering this DAC chip: 12 bits DAC from Microchip because of the need to trim the voltage accurately.

And you're probably right about the current not being 30 mA I wrote down 30 from memory.

It looks like I will have a lot of things to try in the next weeks.

Thanks again
Riccardo
 

AllyCat

Senior Member
Hi,

Overlapping posts (twice). Yes, I see that a full closed-loop system might be difficult. But you do know what voltage you want or appear across the "pseudo-thermistor", so you could read that with an ADC input. Not a fully "isolated" solution, of course (then neither is the Digital Pot, is it?), unless you introduce an opto-coupled digital interface (which may be getting unnecessarily complicated).

IMHO it should be possible to do it all with just a PICaxe and PWM output (plus a LP filter and optocoupler).

Cheers, Alan.
 

rmeldo

Senior Member
Yes I understand that.

And now that I have measured the voltage across the LDR (I couldn't do it a couple of months ago since I had no access to the commercial controller at the time) that is possible.

In fact once I replace the capacitor I should be ready to go. I will still look into the RC filter though.

Riccardo
 
Top