Author Topic: LDR vs Digipot for NTC "simulation"  (Read 4656 times)

0 Members and 1 Guest are viewing this topic.

Offline cyrix2000Topic starter

  • Contributor
  • Posts: 12
  • Country: gb
LDR vs Digipot for NTC "simulation"
« on: October 28, 2022, 05:59:41 pm »
Hi,
I'm trying to replace the NTC outside temperature sensor of my central heating system with a "simulated" NTC, which I can control from a Raspberry Pi (that's the only way to interfere with the modulation of my boiler, as it is quite "dumb").

The question is now, what is the best way to do that? As far as I can see the way the boiler controller reads in the NTC is by impressing a certain current and read back the voltage over the NTC and look up the associated temperature.

I'm thinking about either using a DigiPot controlled via I2C to simulate the resistance of the NTC or alternatively using a LDR with PWM controlled LED. I'm wondering what is more accurate? Or do you have a totally different (but better) idea to solve this task?

 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3838
  • Country: us
Re: LDR vs Digipot for NTC "simulation"
« Reply #1 on: October 28, 2022, 06:10:29 pm »
I don't think you need such fine-grained control.

The boiler uses the NTC to read the outside temperature, but usually this temp is just compared with the thermostat setting to determine if the boiler should run or not. So you only need to switch between two resistances -- one for "temp outside is hot, do not run the boiler" and another for "temp outside is cold, turn boiler on". You could probably just use a relay.
 

Offline cyrix2000Topic starter

  • Contributor
  • Posts: 12
  • Country: gb
Re: LDR vs Digipot for NTC "simulation"
« Reply #2 on: October 28, 2022, 06:18:10 pm »
Hi,
my boiler is using a modulation curve based on the outside temperature (e.g. the water will be heated to 30C if the outside temp is 15C but 70C if the outside temp is -10C, see attached diagram). This helps saving energy, as the heating system isn't "overshooting" so much when trying to reach a certain inside temperature. So it is necessary to hit at least a +/- 2C accuracy for the simulated sensor I would say.
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3838
  • Country: us
Re: LDR vs Digipot for NTC "simulation"
« Reply #3 on: October 28, 2022, 06:38:45 pm »
Ok, I see the problem now.

Just a month ago there was huge thread on the topic of creating a digital adjustable resistor:

https://www.eevblog.com/forum/beginners/digital-adjustable-resistor/

I think the best approach is to have a bunch of resistors in series controlled by relays -- like what you see in this post:

https://www.eevblog.com/forum/beginners/digital-adjustable-resistor/msg4439026/#msg4439026

but with relays switching in/out the resistors instead of MOSFETs.

Also consider using latching relays so your boiler doesn't go haywire if the RPi loses power or crashes.
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 16226
  • Country: de
Re: LDR vs Digipot for NTC "simulation"
« Reply #4 on: October 28, 2022, 07:07:07 pm »
An LDR with LED would have the advantag of isolation. However the LDRs are also somewhat temperature dependent. This is especilly the case for low light of the dark case, probabyl less when stronger illuminated.

A digital pot only works OK when inside the supply of the pot chip. The choices for more than 5V supply are somewhat limited. Usually the available resistor values are also more on the high side. So it depends on the resistance range if this is practical.

One may also get away with a DAC and adding some voltage to a resistor.
 

Online Gyro

  • Super Contributor
  • ***
  • Posts: 10766
  • Country: gb
Re: LDR vs Digipot for NTC "simulation"
« Reply #5 on: October 28, 2022, 08:18:02 pm »
A FET output optocoupler? Something like the old On-Semi The H11F3M. These can operate as effectively a variable resistance output. Adding a second one with the LEDs in series would allow reasonably accurate resistance feedback.

Maybe the same idea would work with  couple of LED - LDR pairs for temperature compensation.
« Last Edit: October 28, 2022, 08:20:14 pm by Gyro »
Best Regards, Chris
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 6921
  • Country: de
Re: LDR vs Digipot for NTC "simulation"
« Reply #6 on: October 28, 2022, 08:50:27 pm »
A FET output optocoupler? Something like the old On-Semi The H11F3M. These can operate as effectively a variable resistance output. Adding a second one with the LEDs in series would allow reasonably accurate resistance feedback.
That's technically a really nice idea, I like it. But I'm not sure that they are still available.
 

Offline cyrix2000Topic starter

  • Contributor
  • Posts: 12
  • Country: gb
Re: LDR vs Digipot for NTC "simulation"
« Reply #7 on: October 28, 2022, 08:55:57 pm »
Thanks for the feedback :) What speaks against Digipots? They seem to be quite inaccurate?
 

Online Gyro

  • Super Contributor
  • ***
  • Posts: 10766
  • Country: gb
Re: LDR vs Digipot for NTC "simulation"
« Reply #8 on: October 28, 2022, 09:11:49 pm »
A FET output optocoupler? Something like the old On-Semi The H11F3M. These can operate as effectively a variable resistance output. Adding a second one with the LEDs in series would allow reasonably accurate resistance feedback.
That's technically a really nice idea, I like it. But I'm not sure that they are still available.

Apparently they are, RS and Farnell still have them in stock. Depending on NTC resistance, there's a choice of H11F1M, H11F2M or H11F3M.
Best Regards, Chris
 

Online Gyro

  • Super Contributor
  • ***
  • Posts: 10766
  • Country: gb
Re: LDR vs Digipot for NTC "simulation"
« Reply #9 on: October 28, 2022, 09:29:38 pm »
Thanks for the feedback :) What speaks against Digipots? They seem to be quite inaccurate?

A Digipot isn't isolated, so you need to know the voltage applied to the NTC and whether it is ground referenced - it needs to be compatible with the supply and ground of your Pi / Digipot.
Best Regards, Chris
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 6921
  • Country: de
Re: LDR vs Digipot for NTC "simulation"
« Reply #10 on: October 28, 2022, 09:30:39 pm »
Thanks for the feedback :) What speaks against Digipots? They seem to be quite inaccurate?
The problem is, that they're not floating (as a simple NTC is). They need a power supply, and the signal voltage levels cannot go outside the supply voltage range.
Do you really mean "inaccurate?"
 

Offline cyrix2000Topic starter

  • Contributor
  • Posts: 12
  • Country: gb
Re: LDR vs Digipot for NTC "simulation"
« Reply #11 on: October 28, 2022, 09:39:37 pm »
I mean if I'm looking into the datasheets for Digipots they have quite high tolerances (+/-20%) for the resistance. The NTC I need to replace is a 12k (@25C) so I'd need a resistive range of ~4k to 100k Ohms.

But the H11F3M looks quite promising. I'll have a closer look at this one.
« Last Edit: October 28, 2022, 09:46:33 pm by cyrix2000 »
 

Online Gyro

  • Super Contributor
  • ***
  • Posts: 10766
  • Country: gb
Re: LDR vs Digipot for NTC "simulation"
« Reply #12 on: October 28, 2022, 09:45:16 pm »
If the minimum resistance is 4k then the H11F3M is fine. The difference between variants is the minimum resistance they can achieve (200 - 470R). The H11F3M is the highest at 470R and so the cheapest - still 10 times better than you need.
Best Regards, Chris
 

Offline cyrix2000Topic starter

  • Contributor
  • Posts: 12
  • Country: gb
Re: LDR vs Digipot for NTC "simulation"
« Reply #13 on: October 28, 2022, 09:53:30 pm »
Yes, I meant 4k to 100k, that is well within the specs of the H11F3M.

Looking at the attached circuit diagram, I assume I would connect it via Vin to the NTC input of my boiler controller and use the If inputs connected to a PWM out of the RPi (via a resistor to protect the LED)? Or do I need an analogue signal/filter the PWM out? (sorry I'm quite a Newbie in circuit design...)
« Last Edit: October 28, 2022, 09:58:16 pm by cyrix2000 »
 

Online Gyro

  • Super Contributor
  • ***
  • Posts: 10766
  • Country: gb
Re: LDR vs Digipot for NTC "simulation"
« Reply #14 on: October 28, 2022, 10:04:10 pm »
You just need to connect the output pins directly to the NTC input (either polarity, it's bidirectional). I think you would need to analogue filter your PWM output. Looking at the resistance vs input current curve in the datasheet, I think the LED would need less than a couple of mA to reach down to 4k.
Best Regards, Chris
 

Offline Sauli

  • Contributor
  • Posts: 48
  • Country: fi
Re: LDR vs Digipot for NTC "simulation"
« Reply #15 on: October 29, 2022, 12:17:37 pm »
I seriously doubt that you can make the H11F3M work with the accuracy you desire. It is highly unlinear and also sensitive to temperature variation. At least you should accurately control the led current, not just the voltage of the led + current limit resistor. Also you should calibrate the resulting resistance at several led currents and hope that aging does not change the calibration.  Personally I would seriously consider using a digital pot instead, powered from the same source as the NTC is.
 

Offline cyrix2000Topic starter

  • Contributor
  • Posts: 12
  • Country: gb
Re: LDR vs Digipot for NTC "simulation"
« Reply #16 on: October 29, 2022, 12:57:55 pm »
I guess I'll give both options a go and see which one works more reliably... components aren't too expensive, so worth playing around a bit :-)

Regarding DigiPots: any suggestions for the best type to use? Better 2x 100k in series or one 200k?
 

Online Gyro

  • Super Contributor
  • ***
  • Posts: 10766
  • Country: gb
Re: LDR vs Digipot for NTC "simulation"
« Reply #17 on: October 29, 2022, 01:50:39 pm »
...
Personally I would seriously consider using a digital pot instead, powered from the same source as the NTC is.

For all we know, the boiler might be using a capacitive dropper, non isolated power supply. Just a note of caution.

I agree on the linearity, that's why I suggested using two of them[Ed: H11F3Ms], with LEDs in series and one providing resistance feedback. Yes the PWM would need to be matched to resistance levels... which would also need to be matched to the existing NTC thermistor resistance, mapped at different temperatures.
« Last Edit: October 29, 2022, 02:03:26 pm by Gyro »
Best Regards, Chris
 

Offline sokoloff

  • Super Contributor
  • ***
  • Posts: 1803
  • Country: us
Re: LDR vs Digipot for NTC "simulation"
« Reply #18 on: October 29, 2022, 02:24:10 pm »
Depending on what you’re trying to accomplish, I’d also consider a simple relay to bias the existing NTC’s resistance (an added series resistor that you short out with a relay to lower the flow temp when the relay is on or a parallel resistance to be switched in to lower the flow temp.)

That, coupled with picking what is currently the “wrong” reset curve might get you close (and if the tweak is small, would also still work as stock when the RPi is not functioning).

I’m just about to install a non-stock (but probably the same performance) NTC for my own boiler this weekend. I characterized the boiler this week (resistance vs what boiler thinks the outdoor temp is) and found 6-for-$7 NTCs (10K/B3950) instead of the $150 Bosch part. I think they’ll work, but I’ll know in a few hours.
 

Offline sokoloff

  • Super Contributor
  • ***
  • Posts: 1803
  • Country: us
Re: LDR vs Digipot for NTC "simulation"
« Reply #19 on: October 29, 2022, 02:27:17 pm »
You could combine those ideas as well: get a different value NTC that’s biased one way and use resistors and relay to pull the curve as you need to.
 

Offline cyrix2000Topic starter

  • Contributor
  • Posts: 12
  • Country: gb
Re: LDR vs Digipot for NTC "simulation"
« Reply #20 on: October 29, 2022, 02:30:02 pm »
Maybe a bit more about the "why" I'm trying to do this: My Boiler is sitting in the south facing side of the house and the temperature sensor should be mounted in the north. I want to avoid adding a new wire through the whole building, so instead of using the "real" NTC I want to connect the simulated one controlled by temperature data from my own weather station. So in general I don't really need to change the temperature curves of the boiler, I just need to find a way to feed in the outside temperature. If the boiler was supporting Opentherm (or ebus, etc.) that would be easy, but as it is a quite "dumb" older system, I need to go this rather convoluted way...
 

Offline sokoloff

  • Super Contributor
  • ***
  • Posts: 1803
  • Country: us
Re: LDR vs Digipot for NTC "simulation"
« Reply #21 on: October 29, 2022, 02:33:26 pm »
For that, I bet that mounting it in a white enclosure mostly in the shade on the south side (or just around a nearby east or west corner) would work perfectly fine for that application and be <2% of the work.

Just tweak the water curves by a couple degrees if you have to (pick a different emitter tech's curve or use the custom curve and offset the left and right side down(edit) up a degree or two).

Hell, even just mounting it on the south side (so long as it's in the shade) and tweaking nothing I bet would work OK. If (and only if) that doesn't work, then you could add tweaking resistor (in your case, you'd want to add a small series resistor (maybe 2.2K or so) and see if that worked to bump the flow a couple degrees). Only if all that fails would I go to anything active. (KISS. Make sure you'll have heat if the WiFi is out or the SD card gets corrupted, etc.)
« Last Edit: October 29, 2022, 02:43:37 pm by sokoloff »
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2954
  • Country: gb
  • Recovering Electrical Engineer
Re: LDR vs Digipot for NTC "simulation"
« Reply #22 on: October 29, 2022, 09:33:53 pm »
Isnt that just a LUT and a DAC. You can measure and store or calculate the LUT.
 

Offline cyrix2000Topic starter

  • Contributor
  • Posts: 12
  • Country: gb
Re: LDR vs Digipot for NTC "simulation"
« Reply #23 on: October 29, 2022, 10:54:02 pm »
I don't think it works with just a voltage out as the boiler PCB is forcing a fixed current output (at least that is how it was explained to me) and then measuring the voltage over the NTC. The DAC wouldn't be able to sink this current I guess?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf