0
Fixed

Wireless Energy meter: Is high count values handled correct?

Niclas Forslund 10 years ago updated by Pål Andreassen (CTO) 10 years ago 2
Hi Pål!

I just realized that I might have forgot to give you one piece of information regarding the counter value.

The data-field that I use in the fineoffset protocol to carry the amount of detected blinks have 12 bits. The msb is used on the receiving side to indicate if the temperature is positive or negative. Since I use all bits for only positive numbers, this will give a fault if the blink count is more than 2047 i.e. 204.7C

This is however very easy to fix.
if ( temp < 0.1 ) { temp = 204.7 - (temp); }

The reason for the (temp<0.1)-test is that if the counter counts 2048 pulses this will show up on the receiving side as -0.0C. The test (temp<0) is thus not correct. It is perfectly safe to use this test since the Energy meter will never send 0.0C.
Thank you. That would explain why some users have asked about it working with high numbers or not.
Sorry for forgetting to mention this "feature" earlier.

Another good thing to know is that since the data field is 12-bits long the maximum number that the Wireless Energy meter can transmit is 4095.

However, I think this will be enough in most cases.