Ds18b20 node modification help

#1

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

0 Likes

#2

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.

0 Likes

#3

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.

0 Likes

#4

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

0 Likes

#5

Are there more accurate probes available that work the same?

0 Likes

#6

I’ll check it out, thanks.

0 Likes

#7

Why do you need more accuracy?

0 Likes

#8

Current lab standards and the current probes are within 0.2.

0 Likes

#9

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.

0 Likes

#10

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

0 Likes

#11

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.

0 Likes

#12

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?

0 Likes

#13

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

0 Likes

#14

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

0 Likes

#15

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

#16

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?

0 Likes

#17

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.

0 Likes