Temperature value

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?

Did you reboot?

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

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

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

What value do you read at the Arduino serial monitor?

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

Each to their own.

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.

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.

1 Like

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

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]

2 Likes

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

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?

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.

1 Like