Community
OpenEnergyMonitor

Community

EmonTx with Pulse count and temperature

Hello everyone, in my emontx configuration I am counting the pulses through the optical sensor on the rj45 and reading the temperature through the probe connected to pins 3, 5 and 6 of the terminal board.
Unfortunately I have verified that the optical reading interferes with the temperature reading, I imagine both signals travel on the same channel, at this point.
Did I do something wrong with the connection? How can I fix it?
Thank you

That should not be the case, exactly how do they interfere?

I don’t think you’ve done anything wrong. You don’t have a whisker of wire going to pin 4, which is the alternative pulse input pin? On your photo, I can’t see anything wrong there.

I can believe an optical pulse might upset the timing on the One-wire bus, but in that case the temperature reading should be invalid and it should be ignored.

Thanks for your answer!
The anomaly consists of an increase in temperature at an increase in pulse frequency. If there are no pulses the temperature is apparently correct, around 23°C, if pulses are very frequent it reaches 80°C or more.
In the attached photos there is a detail of the connection:
black on 3 (GND), red on 5 (PWR) and white on 6 (date).

Everything looks good in those photos.

I have checked the “default” sketch for the emonTx, and there is actually no error checking present in the sketch. Why, I do not know.

A temperature of 85 °C is a known error condition. It is the value to which the memory inside the temperature sensor is initialised at power-on (which happens each time the emonTx asks for a reading), and it will return that number if the emonTx asks for the temperature reading but has not asked the sensor to read the temperature (so it has not put the actual temperature into that memory).

I cannot do any tests for a few days, because my emonTx is being used for another test. I will try to replicate the problem, and I’ll post what I find here. It will be possibly a week or more before I can do that.

Thank you, for any help.
The 85°C is just one of the unreasonably high values i get (58, 73, …).
Each time there is an high frequency of pulses the “apparent” temperature rises.
I found a workaround for this by taking the minimum value of the measured temperature in a 5min interval, so that at least a reasonable value is “hopefully” found in any given interval.
I will test this during the week as well and post the results.
Thanks again for your help, please let me know about your tests,

If you have set email notifications in your profile, you should receive an email if anyone posts on this thread.

Which sketch are you using in the emonTx? Alternatively, if it is the one supplied with the emonTx, when did you buy the emonTx?

It’s the Emontx v3.4.3, bought last september

:+1: That means it’s the Discrete Sample sketch using emonLib.

@TrystanLea for you?

I’m working on the theory that the pulse interrupts are corrupting the One-wire decoding of the temperatures. If the pulse rate is high, as @lmssdd has noted, the chance that it will get corrupted is so much greater.

What I am thinking is: trigger the emonTx’s on-board LED and point the pulse sensor at it, that way the optical pulse timing is under software control. We know the timing of the temperature sensor, so by requesting a reading and then pulsing the LED, I think I can generate an interrupt mid-way through the One-wire data stream. If it gives a wrong value, it’s proven. But there’s no solution to that - the sketch cannot anticipate an optical pulse and avoid asking for a temperature when one is expected.

There might be a work-around - there’s a CRC on the data, so why it’s apparently never been used is beyond my comprehension. If it’s corrupt, then the reading should be tried again (up to a limit).

[I’ve stepped through a month’s data from my emonTx running emonLibCM and can’t see a single wrong temperature, though my optical pulse rate is normally very slow.]