Ds18b20 node modification help

Hey guys.

Currently using this node in my set up https://flows.nodered.org/node/node-red-contrib-sensor-ds18b20 I’m really happy with the results but it displays to 1 decimal point (e.g. 26.1).

Is there a way to modify the node to make it’s ready to 2 decimal points? If so, how would I do this?

I wanted to contact the guy who made it but I can’t see how to on the information page.

Thanks

Simon

You can follow the links through to his github page if you like, where you could raise an issue, but given that the manufacturers spec says its only accurate to ± 0.5 degrees you would do as well by just adding a random digit to the end.

Actually his node depends on another ds1820 library that hasn’t been touched in 3 years and has some open requests to added extra precision… So that’s unlikely to be fixed unless he moves to a different library.

I use node-red-contrib-owfs for access to my 1-wire devices and find it works very well.

Are there more accurate probes available that work the same?

I’ll check it out, thanks.

Why do you need more accuracy?

Current lab standards and the current probes are within 0.2.

OK, I don’t think there are any one wire probes with that sort of accuracy, you will probably have to move to I2C
https://www.sensirion.com/en/environmental-sensors/temperature-sensors/ looks to be the only ones I could find that meets your needs.

I’m guessing there are a little more difficult to get to work?

This is only the development stage of the project so perhaps this would be goof for mk2

You would probably have to write code in a function node to get the values. I2C is well documented and there is a good I2C node for getting the raw data. You might also consider calibrating DS18B20’s using your existing lab setup using an offset. It depends on the repeatability of the DS18B20 being up to your requirements.

This is the code for the probe node i’m using now.

var ds18b20 = require(‘ds18b20’);
ds18b20.sensors(function(err, ids) {
// got sensor IDs …
});

// … async call
ds18b20.temperature(‘10-00080283a977’, function(err, value) {
console.log(‘Current temperature is’, value);
});

// … or sync call
console.log(‘Current temperature is’ + ds18b20.temperatureSync(‘10-00080283a977’));

// default parser is the decimal one. You can use the hex one by setting an option
ds18b20.temperature(‘10-00080283a977’, {parser: ‘hex’}, function(err, value) {
console.log(‘Current temperature is’, value);
});

console.log(‘Current temperature is’ + ds18b20.temperatureSync(‘10-00080283a977’, {parser: ‘hex’}));

its says above:

// default parser is the decimal one. You can use the hex one by setting an option
ds18b20.temperature(‘10-00080283a977’, {parser: ‘hex’}, function(err, value) {
console.log(‘Current temperature is’, value);
});

Does this mean I can manually change it to give the 2 decimal’s I want?

I think it would be something to think about if the project got some more funding. For the first field tests, I’ll be using the conventional method with the lab prob alongside my new rig so I should get a good idea of whats happening.

If i could get my current flow to read to 2 points it would be good as we work to 2 points normally

Might be the way to go to get a reading to 2 points. I am not using this node, maybe Colin can help here.

The DS18B20 has a resolution of 0.0625C (12 bit) but an accuracy of ±0.5. This means that if you get the value to full resolution and plot it on a graph it will give you values changing in intervals of 0.0625 degrees so a nice smooth graph, but the actual temperature shown may be out by 0.5 degrees.
If you need better accuracy then you can calibrate the individual sensors.
node-red-contrib-owfs will give you the value to the full resolution.

1 Like

Hi Colin,

i’m trying out this node but it gives me Error: connect ECONNREFUSED 127.0.0.1:4304

Is this because the probes are currently being used on the flow?

That is saying it can’t connect to the one wire server.
Have you installed owserver? You probably want ow-shell too.
sudo apt-get install owserver ow-shell

I don’t know whether there will be a problem with another server trying to access the 1-wire bus, probably yes.