Temperature value

Tags: #<Tag:0x00007f13f55f3678> #<Tag:0x00007f13f55f34e8> #<Tag:0x00007f13f55f33a8>

(Tony Brindle) #1

I’m just purchased a RJ45 Encapsulated DS18B20 for my emonTx (running the 3-phase sketch) I plugged it in and it’s generally giving weird high values. The room it is in is warm, about 24, but the sensor is reporting aroud the 210 mark :slight_smile:

Anyone have any ideas?

(ian) #2

Did you reboot?

(Tony Brindle) #3

I have and also unplugged and re-plugged a few times.

(Robert Wall) #4

Are you aware that the value transmitted is the temperature × 100? So if you are dividing by 10, that could explain something.

(Tony Brindle) #5

That’s a good point, but I’m not actually doing anything with it.

(Robert Wall) #6

What value do you read at the Arduino serial monitor?

(Brian Orpin) #7

That is interesting. My (old) EmonTX transmits such that I x 0.1.

(Robert Wall) #8

Each to their own.

(Brian Orpin) #9

I am pretty sure that used to be the method. Has the TX script changed such that the temperature sensors are set to a different resolution now? I had a look, but failed to find the relevant section in the Guide.

(Paul) #10

Decimals have never been sent over RFM, whether it’s x10 or x100 for temp or voltage etc, it will never have been anything but an integer, to be scaled in emonhub or emoncms depending on your setup.

(Brian Orpin) #11

Mmm, I though so. How then could they be appearing in the inputs on the first post? MQTT?

(Paul) #12

Seems the scales have been incorrectly set in emonhub.conf

The raw (x100) temp reading are being divided by 10 in emonhub so they land in emoncms x10 (all 4 templates are apparently wrong)

The sketch source seems correct

[edit - PR for corrections done]

(Robert Wall) #13

The “temperature × 100” derives from MartinR’s original PLL sketch dated December, 2012.

(Brian Orpin) #14

Just so I am clear (as I run a really old EmonHub that is in ‘ain’t broke don’t fix’ mode), is there now no need to do any multiplying at the EmonCMS end?

(Paul) #15

Me too!

The old original emonhub only has datacodes, scaling wasn’t implemented. The “emonpi” variant of emonhub on the emonSD does the scaling before sending/publishing so then no additional scaling is required in emoncms.

As a side note, the scaling, as it is in the emonpi variant has been used for clibration and IMO now I have clocked up a fair bit of time using Modbus, I believe a “scaling factor” is a better method.