AXE133 C.0, C.1, C.2 output not working

VicEccles

New member
I am new to the forum, but have been using Picaxe chip for about a year. My current project is a tool to adjust central heating radiators so they have a 10C temp drop.
I have a 08M2 driving a 16 x 2 OLED (or 16 x 2 LED) with two DS18B20, the basic display works fine, but I would like to use the C.0, C.1, C.2 outputs to drive led's which would indicate "red = to high", "green = 10c +/- 2", or something like that.

I have used:-
serout C.1,N2400,(255,%00000111)
pause 500
serout C.1,N2400,(255,%00000000

to test the function but this just corrupts the display, and cannot get %00000101 or %00000001 etc to work

Here is my rough code so far:-
;************* Radiator Tool **************
init:
#picaxe 08M2
pause 500

serout c.1,N2400,(254,1) ; Clear screen
pause 500
serout C.1,N2400,(254,128)
serout C.1,N2400,("LHS")
serout C.1,N2400,(254,136)
serout C.1,N2400,("RHS")
serout C.1,N2400,(254,192)
serout C.1,N2400,("Tempdrop")
main:
debug
serout C.1,N2400,(254,133)
readtemp C.2,b0
serout C.1,N2400,(#b0)


serout C.1,N2400,(254,142)
readtemp C.4,b1
serout C.1,N2400,(#b1)
debug

pause 500

serout C.1,N2400,(254,201)
if b0 > b1 then
let b2 = b0-b1
else
let b2 = b1-b0
endif
serout C.1,N2400,(#b2)

pause 10

;serout C.1,N2400,(255,%00000111)
;pause 500
;serout C.1,N2400,(255,%00000000)
goto main

I am using the standard AXE133 firmware and tested with both OLED and LED displays, can anybody help.
 

hippy

Technical Support
Staff member
This may be an issue of the firmware timing of the AXE133. To check if it is you can try changing -
Code:
serout C.1, N2400, (255, %00000111)
to -
Code:
serout C.1, N2400, (255)
serout C.1, N2400, (%00000111)
That will increase the time between the 255 and the data you want the 'C.x' pins set to.
 

PhilHornby

Senior Member
My current project is a tool to adjust central heating radiators so they have a 10C temp drop.
This is quite timely. I moved into my current (new-build) house two years ago and it became obvious that the (oil-fired) C/H was never 'commissioned'. It only maintained pressure for three days and a 'dip-test' revealed there was absolutely zero inhibitor in there. It seems highly unlikely that any of the radiators were ever 'balanced'. (The previous owner apparently only used the log burner.)

My question is, what arrangement have you come up with, for attaching the DS18B20s to the radiators?

Apparently, the primary sensing component of the DS18B20 is the "GND" lead - rather than its body. I was thinking of some type of Spring Clip that I can solder the DS18B20 to, perhaps with a small back box to support the wiring.

What have you come up with?
 

Aries

New Member
I used two small neodymium magnets taped in line with the DS18B20 - two for each radiator (to give flow and return values). On the underfloor heating system, at the manifold, I put the DS18B20 in a Velcro tape which wrapped around the pipe.
 

VicEccles

New member
This may be an issue of the firmware timing of the AXE133. To check if it is you can try changing -
Code:
serout C.1, N2400, (255, %00000111)
to -
Code:
serout C.1, N2400, (255)
serout C.1, N2400, (%00000111)
That will increase the time between the 255 and the data you want the 'C.x' pins set to.
Many thanks that is the solution, I can now controll the OP's

Thanks again
 

hippy

Technical Support
Staff member
Apparently, the primary sensing component of the DS18B20 is the "GND" lead - rather than its body. I was thinking of some type of Spring Clip that I can solder the DS18B20 to, perhaps with a small back box to support the wiring.
Be wary about connecting GND or any leg of a sensor directly to a radiator. The radiator may be 'earthed' in some manner and that could cause all sorts of problems.

Heat transfer through the body of the DS18B0 should be good enough for a central heating system.

You might be able to cut down an old plastic pen or marker, insert a DS18B20 one end and a spring in the other, be able to wedge that behind between the radiator and the wall -

Code:
/|                                    __
/|                                   /  \
/|        ======================.   |    |
/| oooooooooooooooo |  .-----.__|_  |    |
/| \\\\\\\\\\\\\\\  |  |.----|____| |    |
/| oooooooooooooooo |  ||.---'  |   |    |
/|        ============ ||| ====='   |    |
/|                     |||          |    |
/|                     |||          |    |
 

VicEccles

New member
This is quite timely. I moved into my current (new-build) house two years ago and it became obvious that the (oil-fired) C/H was never 'commissioned'. It only maintained pressure for three days and a 'dip-test' revealed there was absolutely zero inhibitor in there. It seems highly unlikely that any of the radiators were ever 'balanced'. (The previous owner apparently only used the log burner.)

My question is, what arrangement have you come up with, for attaching the DS18B20s to the radiators?

Apparently, the primary sensing component of the DS18B20 is the "GND" lead - rather than its body. I was thinking of some type of Spring Clip that I can solder the DS18B20 to, perhaps with a small back box to support the wiring.

What have you come up with?
I was planning to mount the DS18B20 on some glass strip board with a couple of neodym magnet and connecting them to meter with Servo 3 core, but haven't got that far yet.
I did balance my system a few years ago, and noticed a significant increase in comfort, and reduction in energy.
 

PhilHornby

Senior Member
I used two small neodymium magnets taped in line with the DS18B20 - two for each radiator (to give flow and return values).
I was planning to mount the DS18B20 on some glass strip board with a couple of neodym magnet...
Magnets ... that sounds like a good idea (y)

The radiator may be 'earthed' in some manner and that could cause all sorts of problems.
Well yes, I think it's a Wiring Regs requirement that radiators (at least in bathrooms) are earthed. Of course, in these days of plastic plumbing pipes, it doesn't necessarily follow that the entire system is earthed - and in any case, I suppose there could be potential differences between radiators.

What sort of issue are you envisaging?

Heat transfer through the body of the DS18B20 should be good enough for a central heating system.
I agree that whichever bit of the DS18B20 is in contact, it will eventually come up to something close to the actual temperature.

However, the object of this exercise, is to monitor the difference in temperature across the radiator, while adjusting the lockshield valve. While there will be presumably be a lag caused by the retention of heat in the radiator and valve bodies, I'd like the sensor to respond in as timely manner as it can. It could be, that a DS18B20 isn't the best choice for the job?

One other thing that struck me, is that there can be considerable differences between DS18B20s (or maybe I've bought some dodgy ones!?!). Some sort of initial 'nulling' might be required? (Currently I use the DS18B20 Serial No. and a 'correction table' to adjust to match my 'reference' DS18B20)
 

AllyCat

Senior Member
Hi,
Be wary about connecting GND or any leg of a sensor directly to a radiator. The radiator may be 'earthed' in some manner and that could cause all sorts of problems. ..... Heat transfer through the body of the DS18B0 should be good enough for a central heating system.
Agreed. Most people don't even consider the "leads" of electronic components to give significant thermal conduction (inwards or outwards), and in most cases I think it's only a "second order" effect. It depends if you're attempting to attach the sensors to the radiator or the pipes (which I'd expect to respond more quickly) but I'd just touch the body onto the metal surface and cover each with a small, thin, thermally-insulating "bandage" or "pad" to equalise the sensor and surface temperatures. There are also the DS18B20 (waterproof) "sensor probes" (with wires attached), which are more convenient to use and not necessarily much more expensive, particularly if bought in a batch.

There are now numerous other (I2C) sensors, sometimes with temperature being only a "secondary" function (e.g. BMP280), which have an even higher resolution (typically 0.01 degree C), but the vast majority still don't claim any better absolute accuracy than about +/- one degree. So you may indeed want to calibrate all yours against a "reference" sample (or their median :) ).

As for ALL my radiators, I just routinely fit Thermostatic Radiator Valves, which work remarkably well, at a ridiculously low price, and give the further benefit of a "calibrated" scale (to better than 1 degree) for any additional "fine tuning". Now, there are even electronic versions that allow a temperature profile to be set for different periods of each day, which can run for several years on a pair of alkaline AA cells. Their main disadvantages being that some can be "noisy" (e.g. in a bedroom) and they normally display the "target" temperature, rather than the "actual" temperature (under transient conditions when the two are not the same).

Cheers, Alan.
 

PhilHornby

Senior Member
Apparently, the primary sensing component of the DS18B20 is the "GND" lead - rather than its body.
Most people don't even consider the "leads" of electronic components to give significant thermal conduction (inwards or outwards), and in most cases I think it's only a "second order" effect.
If you recall this has come up before - See Post #6 of this thread

The relevant section of the Maxim website (which has now been archived, so is only available here (slowly!) says:-
Where physically on the device does the temperature measurement take place?

The DS18B20 does not sense temperature directly through the package. For all package types, the DS18B20 senses temperature
primarily through the GND pin. Ensuring a good thermal connection between the GND pin of the device and the heat source you wish to measure will provide the best results.
I'd just touch the body onto the metal surface and cover each with a small, thin, thermally-insulating "bandage" or "pad" to equalise the sensor and surface temperatures.
I've got sixteen seventeen radiators to 'balance', so I'm looking the quickest method possible.
There are also the DS18B20 (waterproof) "sensor probes" (with wires attached), which are more convenient to use
It would be very interesting to open one of those up and look at the internal arrangements...
Now, there are even electronic versions that allow a temperature profile to be set for different periods of each day, which can run for several years on a pair of alkaline AA cells. Their main disadvantages being that some can be "noisy" (e.g. in a bedroom) and they normally display the "target" temperature, rather than the "actual" temperature (under transient conditions when the two are not the same).
My house - as built - had a wall thermostat on two of the floors, in the most unrepresentative places possible. It did at least have TRVs on all the radiators. I'm now using the Drayton Wiser system - there are quite a few other, similar systems out there.

The Drayton system cost an 'arm-and-a-leg' but works well. You could buy quite a lot of Heating Oil for the cost involved (£1000+ @ full retail), but I took advantage of offers on Amazon and bought a few 'starter' kits and sold on parts I didn't need. I purchased some items on eBay from other folk doing the same :)

I started with just the Smart Radiator valves, but all the living areas now have the Wall Stats as well. Drayton are quite approachable and the API is documented, so I have quite a few additional functions of my own!

You'd think that with all that - or even just simple TRVs - that 'balancing' the system (i.e. getting that specific temperature drop across each radiator) would be unimportant (since they are unlikely to be all operating at the same time anyway).

It turns out the Temperature Drop is indicative of the water flow-rate, which manufacturers apparently specify for their radiators. (That does of course, raise the question of "why is a particular flow rate important"? (I don't know the answer to that one!)
 
Last edited:

papaof2

Senior Member
Perhaps water "flow rate" depends on the thermal characteristics of water-to-radiator plus radiator-to-air and there's no need for a water flow greater than the amount of heat that can be transferred to the surrounding air? It would appear that adding even a small fan would disperse the heat better but that would be limited by both the water-to-radiator and radiator-to-air thermal transfer characteristics. Perhaps something to investigate when you have several days of unplanned free time? ;-)

I've lived in one house with hot water radiator heat and it had the advantages of silent and even heat but was very slow to respond to changes in the outside temperature. It was an old and poorly insulated house (by even 1960 standards) and the fireplace saw a good bit of use.
 

AllyCat

Senior Member
Hi,

If the water flow is too low then the average surface temperature of the radiator will be lower (due to the lower exit temperature) and it won't meet its specification. Conversely, too high a flow rate may create noise, "steal" heat flowing to other radiators, or just be running the pump less efficiently. But generally for the latter case, slowing down the (variable speed) pump would be a better solution than "throttling" the water flow with the lockshield valves. ;) To be topical, ten degrees is probably a good "round" figure for a "combustion-based" heating system, but is far too high for a Heat Pump.
" Ensuring a good thermal connection between the GND pin of the device and the heat source you wish to measure will provide the best results. "
I wouldn't disagree with the manufacturers, except perhaps by using the word "better" rather than "best". As it's the Earth connection and if you're using a battery-powered (i.e. isolated) system, then there shouldn't be any harm in connecting directly to the radiator; It's probably insulated by paint anyway (but the copper pipe might not be).

However, I wondered what the practical difference could be. Normally the TO92 package thermal resistance is specified for dissipating heat, but we can use the same figures for estimating heat conduction into the chip. The package is rated at about 200 degrees/watt to ambient (i.e. air), about 80 degrees/watt between chip and package, or around 140 degrees/watt if connected "via a plated through hole to a PCB track of 0.25 square inch" (1.5 square cms). Thus, coupling the heat directly to the body is likely to be as good as connecting to the Earth wire. More specifically, the thermal conductivity of copper is 4 watts per cm cube and the "diameter" of the wire lead is between 0.4 and 0.5 mm, so say 0.2 mm2, or 0.002 cm2 cross sectional area. Thus, I make the thermal resistance of a 1cm lead to be about 500 / 4 = 125 degrees/watt, so hardly likely to dominate the conduction of heat to the chip.

Having rather hijacked this thread, in reply to the OP, when I looked at "Improving" the AXE133 firmware some time ago, I came to a conclusion that the firmware could be significantly improved by "pairing" the reading of the parameter (i.e. the %00000xxx) with the "255" command in a faster path. However, by post #21 I had come to the conclusion that the only "safe" method was to include an additional delay into the transmitting software, as you have found.

Cheers, Alan.
 

PhilHornby

Senior Member
Most sites on the web, go through the mechanics of balancing a Radiator, but this one describes the theory in detail. o_O
(Fortunately for me, Oil-fired boilers don't modulate and I don't think I've got an intelligent pump...)

How about this for a DS18B20 ---> Radiator adaptor?

Neodymium magnet glued to top of PCB holds board in place on pipework or valve.

24997

large copper pad transmits heat to DS18B20 'GND' pin.

24998
 
Last edited:

oracacle

Senior Member
I would suggest rapping the pins in kapton tape. its electrically insulative, is uneffected by anything but the highest of tempuratures while still allowing heat through. It is often used for jerry rigging hot end sensors on 3D printers which noramlly get to 200+ degrees.
The tape is thin enough for its heat insulative properties to not really be an issue for getting the radiator in contace with the groud pin of the sensor, but electrically insulted enough for a single layer to stop any conduction between the 2.
 

PhilHornby

Senior Member
I would suggest wrapping the pins in kapton tape. it's electrically insulative
At the very least, I've not allowed for shorting +5V and GND accidentally, if I mis-position the board. Maybe I'll feed the DS18B20 via a resistor (or even have a play with the parasitic-power configuration) and handle it that way!
 

AllyCat

Senior Member
Hi,

I don't believe PICaxe supports the parasitic powering mode, but you could put a lowish valued "safety" resistor in series with the supply pin. Also, I think the parasitic mode actually requires drive pulses of a much higher current than for normal operation.

If my calculation in #12 is correct, I don't believe that the conductivity of even copper (let alone Kapton foil) would give sufficient thermal conduction through the thin lead wire, for accurate measurements. I think you would have a thermal "potential divider" (electrical equivalent) with typically a 125 degrees/watt "top resistance" to the sensing element (18B20 internal chip) and then a 200 degrees/watt "leakage to Earth" (c.f. ambient air temperature) through the body/air interface of the TO92 package. IMHO you need to either put thermal insulation around the package, or in view of the electrical conduction issues, make good thermal contact via the body of the package (perhaps using a heat sinking flag) and use relatively long, thin, insulated connecting wires to avoid too much heat draining away.

Incidentally, will even a Neodymium magnet "stick" to copper (pipe) or (brass) compression fittings, etc.?

Cheers, Alan.
 

PhilHornby

Senior Member
I don't believe PICaxe supports the parasitic powering mode, but you could put a lowish valued "safety" resistor in series with the supply pin.
Yes .. I was reading the datasheet; it looks simpler just to add a resistor.
... IMHO you need to either put thermal insulation around the package, or in view of the electrical conduction issues, make good thermal contact via the body of the package (perhaps using a heat sinking flag) and use relatively long, thin, insulated connecting wires to avoid too much heat draining away.
I couldn't decide if I needed the biggest board (i.e. amount of copper) that will fit in the space ... or the exact opposite; just the bare minimum. I could position the DS18B20 as close as possible to the magnet and 'bend over' its GND leg ensuring that it is trapped between board and valve body...

I'll experiment!

I've made a prototype board, but I'm waiting for the magnets to arrive.

Incidentally, will even a Neodymium magnet "stick" to copper (pipe) or (brass) compression fittings, etc.?
I'm aiming for a 'flat' on one of the 19mm nuts. Failing that, the bottom corner of the radiator!
 

Goeytex

Senior Member
While the DS18B20 is convenient and rather easy to use with a Picaxe, I might consider using a K type thermocouple or even a Thermistor instead if I wanted fast response. Some thermal compound and a clamp of kind for mounting might work well, Or even some Arctic Silver thermal epoxy might work ok.
 

PhilHornby

Senior Member
However, I wondered what the practical difference could be...
I did a comparison of my "GND lead" sensor vs "the top of the T092" vs an "encapsulated" DS18B20 (the 'can' is isolated from GND).

This was the test arrangement :-
25018

(I discovered that trying to position things using loose Neodymium magnets is like trying to herd cats - they keep shooting off and forming one big pile!)

The plots of the three sensors (Temperature vs Time) were obtained simultaneously, while the radiator heated and cooled. The difference in absolute temperatures could be just different positions in the radiator, or differences between sensors. The lumps and bumps in the graph are presumably caused by the inner workings of the heating system.

25021

I'm not entirely sure what I proved by this experiment; other than that my custom PCB 'GND Lead' sensor does make life easier!
 

Attachments

Last edited:

papaof2

Senior Member
Small magnets work well IF you can control most of their directional movement. I have a pair mounted one on a doorstop and one on the wall the doorstop contacts so they can hold the door open when needed. If you get them within 3/8" inch of each other, they come together securely and they are limited to only one direction of travel by epoxy to the wall tile and Sugru to the brass doorstop itself. It's all been in place more than 10 years so it's a functional - if not pretty - solution. But then my grandmother said "Pretty is as pretty does" so perhaps looks aren't everything ;-)

Don't have any immediate plans for DS18B20s but the graph is "nice to know" info about different ways to get the sensor in contact with the temperature to be sensed and the differences in reported temperature over time.
 

AllyCat

Senior Member
Hi,
The difference in absolute temperatures could be just different positions in the radiator, or differences between sensors.
It shouldn't be the differences between the sensors and they do all seem to eventually converge to the same point/temperature. The indeterminate position on the radiator is why I would mount the sensor on the pipe (which should also give a more accurate and faster indication of the water flow rate/temperature). But it depends what you want to measure, the heat transfer into the room will presumably be a function of the average temperature of the radiator surface (between entry and exit points) and the ambient (low level) air temperature.

Otherwise, I assume that the commercial waterproof sensor is the "best" because a sensor can't "boost" the temperature, it can only loose (under-read) the temperature by some heat "leaking away" to a lower (air?) temperature (i.e. my thermal "potential divider" analogue above). That suggests that the designers of the waterproof sensor have done a good job, or in practical terms, the metal encapsulation spreads the heat all around the package to give a large interface area and relatively small transfer distance to the sensing element. Probably, an encapsulation material with good thermal conductivity (there are a few with also good electrical insulation properties) and perhaps measures to prevent too much heat leaking away through the connecting leads. But the length of the leads and their covering with electrical/thermal insulation may be sufficient.

Then, coupling the heat to the "body" would appear next best, which doesn't surprise me as I would expect conduction through the whole body, to be higher than (only) through the fine lead(s). In a normal "heat sink" application the two paths are in parallel (i.e. we don't care how the heat escapes from the package) but here, if the body and leads are at different temperatures, then there is the "potential divider" error I've outlined above. The way that you minimise the "loss" (attenuation) in a potential divider (thermal or electrical) is to minimise the "top" resistance, maximise the lower restance (e.g. thermally insulate this path) and/or make the zero/ground/reference (i.e. lower end) voltage or temperature as close to the "target" temperature as possible. As for the "transient" effects, then again the electrical/heat analogue concept could be helpful (i.e. temperature = voltage , heat flow = current , thermal mass = capacitance , etc.).

Cheers, Alan.
 

PhilHornby

Senior Member
It shouldn't be the differences between the sensors and they do all seem to eventually converge to the same point/temperature. The indeterminate position on the radiator is why I would mount the sensor on the pipe (which should also give a more accurate and faster indication of the water flow rate/temperature).
There's an interesting bit of footage in this Youtube video (@17:20) :-


An intriguing insight into the way a central heating 'radiator' works!

But it depends what you want to measure, the heat transfer into the room will presumably be a function of the average temperature of the radiator surface (between entry and exit points) and the ambient (low level) air temperature.
That's actually an interesting question - there are a zillion 'how to balance radiators' web sites out there, but the majority seem to be clueless as to why they are doing what they're doing.

I think (much) more research is required - not least because the temperature differential across a radiator is a far from static metric.

This is with two identical (magnetically attached, 'GND' lead sensors) on the pipe 'bosses' underneath the rad, which feed the front and back panels. The system was fired up from cold (with the 'TRV' removed) and the temperature measured at each end. (The green trace at the bottom is the difference between the two).

Screenshot 2021-11-21 004441.jpg

The differential is far from constant, even with no manual interventions.

That suggests that the designers of the waterproof sensor have done a good job, or in practical terms, the metal encapsulation spreads the heat all around the package to give a large interface area and relatively small transfer distance to the sensing element. Probably, an encapsulation material with good thermal conductivity (there are a few with also good electrical insulation properties) and perhaps measures to prevent too much heat leaking away through the connecting leads.
There seems to be a huge variability in the quality of waterproof sensors out there.
Take a look at some of the horrors documented on this web site :( Of course, until you've bought 'em, you really don't know what you've got.

I found another study, into the behaviour of 'clone' DS18B20's. From information presented there, I know for a fact that I have deployed some in the past :(
 
Last edited:

PhilHornby

Senior Member
While the DS18B20 is convenient and rather easy to use with a Picaxe, I might consider using a K type thermocouple or even a Thermistor instead if I wanted fast response.
I was getting numbers out of my DS18B20s that were far lower than I expected, so I though I'd compare them against my Brymen DMM, which uses a thermistor 'Type K' thermocouple probe to provide a temperature readout.

25034

Not only did the thermistor thermocouple respond far faster, it gave an answer that was far more believable than my DS18B20 probe.

This was the test configuration - with the DS18B20 sensing the temperature via its GND lead underneath the PCB. Turning the PCB over and holding the body of the DS18B20 in contact with the 'pipe' made very little, if any, difference.
25035
I think you would have a thermal "potential divider" (electrical equivalent) with typically a 125 degrees/watt "top resistance" to the sensing element (18B20 internal chip) and then a 200 degrees/watt "leakage to Earth" (c.f. ambient air temperature) through the body/air interface of the TO92 package.
I think you might well be right :)

My current project is a tool to adjust central heating radiators so they have a 10C temp drop.
How are you doing, with your efforts?
 
Last edited:

thunderace7

New Member
I made one of these a while ago. I fixed the sensors into large crocodile clips with JB Weld. I just clip them on to the pipes.
 

AllyCat

Senior Member
Hi,
This was the test configuration - with the DS18B20 was sensing the temperature via its GND lead underneath the PCB.
If available, I would have added a block of expanded polystyrene, the size of the PCB and the height of the header plug, with cut/melted recesses for the TO92 package and magnets, to prevent heat escaping from the package.

All the links in post #24 are interesting, particularly to thecavepearlproject.org/ which demonstrates how difficult it is to measure a genuine absolute temperature much better than 1 degree C. His work with Oversampling (ADCs) is quite reminiscent of mine using the PICaxe DAC (in place of his ramp generator), perhaps only because we used the same Excel/OO graphing. :)

IMHO a problem with thermistors in general is that the maths/calibration is horrible, particularly for a PICaxe, if you want a reasonable scale range. :( However, I have posted several code snippets to interpolate between reference points of a Lookup table, if you can measure or calculate suitable calibration points (e.g. every 5 - 10 degrees).

Cheers, Alan.
 

Solar Mike

New Member
... IMHO a problem with thermistors in general is that the maths/calibration is horrible, particularly for a PICaxe, if you want a reasonable scale range. :( However, I have posted several code snippets to interpolate between reference points of a Lookup table, if you can measure or calculate suitable calibration points (e.g. every 5 - 10 degrees).

Cheers, Alan.
I use the MCP9701 linear active thermistor ic's now for all temperature measurements; the DS18B20 are OK if you can find a genuine one, however generally use blocking code and too slow. The calibration tables are not required for the MCP9701 Link.

Cheers
Mike
 

PhilHornby

Senior Member
I amended post #25, because it turns out that my Brymen DMM uses a thermocouple, not a thermistor! (I had absolutely no idea thermocouples looked like that - the one in my old gas boiler certainly didn't :) )

I have a sneaking suspicion that the MCP9701 might have the same issues as the DS18B20 in this application - namely that TO92 package. (The maths and voltage levels don't look good matches for Picaxe either at first glance - though I've not investigated in detail).

It's worth pointing out, that I have eight DS18B20's 'in the field' successfully measuring air temperature, which all work without any issues whatsoever.

I have struggled with them in the past though, in a similar 'contact application'.
That project (about 6 years ago) was to demonstrate the amount of hot water stored in the cylinder, so my daughter could gauge if there was enough for one of her lengthy showers. (In the old days, you could just feel down the tank, but the modern ones are covered in foam insulation.)

I made six holes in the foam at various heights and inserted a DS18B20 into each hole, 'head first'. I added a blob of thermal grease to each one, but none of them ever read the actual temperature of the water in the tank! (They did vary though, so that was enough to turn into a ladder of LEDS to indicate the state of the tank.)

I've had one final attempt at getting some sensible response out of my home-brew DS18B20 'GND-lead' sensor vs a waterproof DS18B20 and the Brymen's thermocouple. (You can't see it, but I added an insulating collar to the 'GND-lead DS18B20)

Attached to the return pipe of a radiator like this:
25039

The DS18B20's really could not get close to the thermocouple, either in response time or actual reading :(

A short video (it's only a minute :D ) shows the results.
The meter shows the thermocouple recorded temperature and is being updated very fast.

On the LCD, Sensor #1 is the Waterproof DS18B20 and Sensor #2 is 'GND-lead' version. They are read every five seconds.


Sadly, I think I might just send the Chinese some more money towards their next aircraft carrier, and buy one of these:

https://www.ebay.co.uk/itm/403223403403

and maybe a pair of these:

https://www.ebay.co.uk/itm/393176052258
 
Last edited:

Solar Mike

New Member
Re the MCP9701, I use the SOT-23 versions, their solder mounting points are sensitive to heat and when mounted on a tiny pcb the pcb traces conduct heat into the chip via the pads.

Have used the DS18B20 in the past for sensing hot water temperatures on my solar hot water panels, I soldered fine flex silicon rubber wires to their leads and glued the case + leads into a larger copper crimp lug filled with JB Weld; then clamped the lug flat area to the pipes with a hose clamp; seems to work well, the temperatures move quite quickly as water passes through the pipes.

Mike
 

hippy

Technical Support
Staff member
The DS18B20's really could not get close to the thermocouple, either in response time or actual reading :(
I can understand thermal lag but it surprises me they don't read accurate temperatures when they are specified as +/-0.5C device up to 85C, 185F.

It is intriguing as to what's going on, why they don't seem to perform well in contact applications, but I have no idea for an explanation. It would be interesting to see how they perform in free air at elevated temperatures.
 

AllyCat

Senior Member
Hi,

I really can't explain the "Potential Divider" thermal analogue any better than in #16, but if heat is flowing through the package, e.g. into the body from its surface and out through its leads to a cable, then the internal chip/sensor will not see the full "hot" temperature, in the same way that current flowing in a resistor-divider network produces an "attenuated" output. "Measurement Technique" can be an important factor; in the same way that you must be "careful" when using a 20 kohm/volt analogue meter on high impedance circuitry. Or particularly, measuring current with an "ammeter" which nearly always now takes the form of a voltmeter measuring the voltage drop across a resistor of sometimes NOT insignificant value.

A lot of the surface area of your 18B20(s) seems to be in contact with the ambient air, but I've always been surprised how well that thermostatic radiator valves actually work! They are usually connected directly onto (and above) the inflow pipe (at say 70 degrees) yet they "measure" the room air temperature, not the water or radiator temperatures. I did consider mounting them on the (cooler) outlet pipe, but I'm not sure it would make much difference and the Danfoss valve in the video of post #24 is specifically marked to be used only at the inflow.

All sensors have their own particular "weaknesses"; thermocouples give a low output voltage (per degree C change) and you need to be careful to avoid (voltage drops across) other metallic junctions in the circuit. The MCP9701 has only a claimed accuracy of 2 - 4 degrees C and is (also) highly dependent on the availability of a high resolution ADC and a precise external reference voltage. "Normal" thermistors are often built into a simple RC oscillator configuration, the period of which can be measured easily with a (microcontroller's) 16-bit timer/counter, rather than rely on, or need, a high resolution/accuracy ADC. A precision "reference" voltage is not needed if the oscillator threshold levels are arranged to "track" the charge/discharge currents (e.g. by being fed from the same supply rail).

Cheers, Alan.
 

PhilHornby

Senior Member
I can understand thermal lag but it surprises me they don't read accurate temperatures when they are specified as +/-0.5C device up to 85C, 185F.

It would be interesting to see how they perform in free air at elevated temperatures.
Same here, so I've tried a quick test, in the oven (Set to 60°C).

Test 'rig' :-

Waterproof DS18B20 = Sensor #1
DS18B20 (with its insulating cap removed) = Sensor #2
Thermocouple is the blue wire

The heating element was a fair way above the shelf and glowed cherry-red throughout.

25040

This time the DS18B20 (presumably measuring via its case) was the clear 'winner'. The waterproof DS18B20 was a poor second and the thermocouple way back in third. At one point the thermocouple's reading went down instead of up ... I think it moved slightly.

The free-air DS18B20 responded in a timely manner and gave a credible reading. The other two didn't!

25041

I suppose it is possible that convection currents were affecting the temperature the thermocouple was actually 'seeing'? ...
 

PhilHornby

Senior Member
A lot of the surface area of your 18B20(s) seems to be in contact with the ambient air,
In the test in Post #29, the body of the DS18B20 was insulated (as best as I could manage).
but I've always been surprised how well that thermostatic radiator valves actually work! They are usually connected directly onto (and above) the inflow pipe (at say 70 degrees) yet they "measure" the room air temperature, not the water or radiator temperatures.
As it happens, I have a butchered TRV to hand :-

25042

The expanding wax capsule bit engages with a plastic pin, inside a sort of plastic cup - so it's not in direct metal-to-metal contact with the radiator valve.

Out of interest, here is some data out of my Wiser system, which illustrates the issue with measuring the 'room' temperature at the side of a radiator.

The room in question doesn't make use of the temperatures reported by the electronic TRVs, because there is a Roomstat present, but their data can still be extracted. (Without a roomstat, Wiser would have averaged the two TRV temperatures and then applied some sort of correction algorithm to actually control them.)

I can't comment on how well ordinary TRVs fare, since I've never measured them.

25044
 
Top