2 Pulsecounters, 1 working

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Ton_vN
Normal user
Posts: 300
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

2 Pulsecounters, 1 working

#1 Post by Ton_vN » 21 May 2021, 14:21

In my solar PV-configuration have 2 counters DDS238-1ZN
The S0-interfaces of these 2 counters interface to 1 WeMOS&ESPEasy_mega-20200310, pin D3/GPIO0 respectively pin D8/GPIO15
WeMOS reports to 2 identical Virtual Devices [Counter, General, Incremental] in Domoticz.
Worked OK till a few weeks ago, then both went haywire, and gave excessive values for some days.
Counter-Device at pin D3 'revived' and is acting normal again.
Counter-Device at pin D8 has Count2 at 0, Total2 is very low, Time2 very high => Domoticz behaves erratic with exceptionally high dayvalues.
On the other hand see the LED on WeMOS firmly flashing in rythm of S0-pulses [= sync with LED on DDS238-counter] which to me is sign that wiring of S0-interface to WeMOS is OK.
Device at WeMOS/ESPEasy
Device at WeMOS/ESPEasy
screenshot-192.168.0.130-Wemoscounter.png (13.18 KiB) Viewed 12540 times
Headscratching: Reason for problem, and how to remedy Counter-function at pin D8??
Have been modestly experimenting with debounce-value and with mode-setting, but does not seem to have effect.

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: 2 Pulsecounters, 1 working

#2 Post by Ath » 21 May 2021, 15:01

Has there been a lightning strike that has possibly damaged your ESP or sensor electronics?
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: 2 Pulsecounters, 1 working

#3 Post by TD-er » 21 May 2021, 15:15

GPIO-15 does have a pull-down resistor as its state should be low during boot.
This suggests the circuits should be slightly different or at least behave slightly different.
Indeed lightning strikes can also damage things.

Are the wires long enough to maybe pick up noise from some device?

Ton_vN
Normal user
Posts: 300
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: 2 Pulsecounters, 1 working

#4 Post by Ton_vN » 21 May 2021, 17:12

All other functions of the ESP/WeMOS without any problem.
ESP is in a (plastic) box just below the (plastic) box with dual counters:
cable-length between S0-interface and ESP is 30cm at most.
;-) Even a shielded cable, because the shield is the common ground for both counters.
Checked the circuit for D8: wiring is compliant with S0-interface's OpenCollector.
Much thunder&flashes lately, and obviously some effects may be possible.
Just wondering, because plenty of ESP/WeMOS here in positions much more susceptible to lightning effects, and all happily continuing operation.
[But agreed: all having other type of circuits]

Probably best to find another pin to connect that S0-interface (or just exchange the ESP/WeMOS).

Some more thinking and then ;-) ;-) the 'light' popped on.
Perhaps the argumentation is not completely correct, but the end-result seems OK:
- D4 = LED + 10k pullup resistor
- Integrated pull-up resistor and S0-interface is good match (better than pull-down of D8, latter needing separate, carefully selected pull-up for OC-operation)
- If the LED is flashing in the rythm of the S0-interface, it means that the functional connection between S0-interface and D4 already exists (in some way).
Shifted the counter to D4, setting of Wifi-LED to 'none' => 'success!'

Perhaps application of D4 has other risk (related to the boot-sequence, should avoid booting while PV is in operation), but it is a practical solution .......

Anno
New user
Posts: 8
Joined: 19 Mar 2021, 19:22

Re: 2 Pulsecounters, 1 working

#5 Post by Anno » 15 Jan 2022, 02:08

I have a simular behaviour. Only with 2 psi sensors, connected to a ADS1115. For the first time it was working great. Suddenly random high and low values for days (even without pressure) after that one did return to normal but the second never did. I am also thinking that the second sensor is broken, but i don't know for sure, and know i read this even less.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: 2 Pulsecounters, 1 working

#6 Post by TD-er » 15 Jan 2022, 11:04

Random values from an ADC is often a long wire not connected to anything other than the ADC. (or hardly making contact)
It then acts as an antenna picking up all kinds of random signals.
Another possibility is that there is some kind of short near the sensor (e.g. water) which makes both wires (ADC input and ground) into a loop, which also picks up noise.
Only difference there is that the picked up noise has to have more energy to create a significant output. (e.g. a mains power cable near the sensor cable)

Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests