Author Topic: Erratic One-Wire Counter issue  (Read 2870 times)

0 Members and 1 Guest are viewing this topic.

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 2837
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Erratic One-Wire Counter issue
« on: August 14, 2011, 08:42:23 AM »
I was experiencing bizarre counter behavior on my Hobby-Boards lightning detector. When I started posting my station data to PWS Weather, I could see that my rain gauge was also showing huge counts in the precipitation chart.

The tip-off was the frequent lightning detector counts of 4294967295 which corresponds to xFFFFFFFF. This is the blank page in the DS2423 counter used in the rain gauge and lightning detector. I also found from various application information on One-Wire that negative voltage transients on the One-Wire bus can cause disruption to the chips via the substrate.

The DS2423 data sheet says:
When applying the Read Memory + Counter command to a page that does
not have a counter associated, the master will read FFFFFFFFH instead of a valid count.


There were several recommendations in the application notes, including using a hub (already was doing that) and various ramp rates. The one that caught my eye was the recommendation to add a Schottky diode to the most distant node of the One-Wire bus. This clamps the negative transient to -0.3V.

I placed the diode at my hub just to test it because if it was the wrong polarity it would short out the bus. Immediately, I started seeing massive continuous errors on the lightning detector. Since the diode was at the opposite end of where it is supposed to be, I wasn't surprised that this could make it worse.

I installed the Schottky diode a few days ago and it seems to have cured the problem. I went through a major lightning storm last night without any false counts. Time will tell, but so far so good.

I read about this in "Springbok Diagnostics 1-Wire Design Guide v1.0" (pg. 36) and the "OneWire Design App Note" from Dallas Semiconductor (Maxim).

The Springbok paper is at www.1wire.org/Files/Articles/1-Wire-Design%20Guide%20v1.0.pdf

It is critical that the diode be placed at the far end of the One-Wire microLAN and that the cathode (banded end of a leaded device) is on the "data" line not the ground. Otherwise you will have a shorted bus. (it doesn't hurt anything permanently, it just won't work).

Springbok recommends a 1N5817 or BAT54S. A standard rectifier diode will be slower and allow 0.6V reverse voltage, so they are not suitable.

Greg

---------------------------
Update: I did get a count indicating a read error late this morning. It still seems much better behaved now.


Hmmm... I see in the schematic for the lightning detector that there is already a BAT54S Schottky diode. Not sure if this means that it was open circuit, or something else is going on now.
----------------------------
OK, the xFFFFFFFF count happened only twice since I put the Schottky diode at the end of the net (about a week). I now think that the first one was a power transient. The other one was at start-up OWW after a power-off (power failure). Otherwise, both the xFFFFFFFF and the crazy count issue seems to be gone.

The explanation I believe lies in the datasheet for the BAT54S and the 1N5819 that I used.

The 1N5819 is 400mV @100mA.
The BAT54S is 800mV @100mA.

Hence, the BAT54S, while being a Schottky diode, isn't as effective as a clamp as the 1N5819. The BAT54S could allow enough negative voltage below -0.3V that the substrate issue could occur, whereas the 1N5819 has a better chance of clamping it. It all depends on the current that the diode is absorbing during the negative transient.

« Last Edit: August 20, 2011, 09:29:14 AM by miraculon »




Blitzortung Stations 668, 706 - CWOP CW4114 -  CoCoRaHS MI-PI-1

Offline graibeard

  • rorpi - read only raspberry pi
  • Member
  • *
  • Posts: 4
    • Weather at Messmate Farm
Re: Erratic One-Wire Counter issue
« Reply #1 on: March 21, 2017, 12:15:23 AM »
Probably bad form to Necro this six year old post, but it's on the money with its description, and while hobby boards are long gone their gear lives on. Besides  does it really matter when you get to our age?

I've had a similar, ongoing  issue with my hobby-boards rain gauge - using Eric's counter module. Every now and then it would emit crazy rainfall levels, anywhere from 10mm to 3 metres. I know they are crazy because I'm sitting here with dry feet, plus I'm well south of the tropics.

The last one happened a couple of hours ago, under beautiful sunshine. Admittedly, a night of rain, with one 80mm odd event to make me curse again - removing that and it will tally with the analog gauge though (if I squint just right!)


Okay, some background:
Using weewx software and the owfs.py driver. 20 metre cable run, outdoor grade (silicon gel) cat 5, no hub (Bugger, fried it, still miss it.)

Bizarre readings will, would happen during actual rainfall events.
During the muggy - high humidity times immediately afterwards.
During high humidity days.

Often a series of counter rolls in one LOOP event (one read at a 20 second interval)
Or a series of consecutive LOOP reads, and then all will go quiet - crickets....

It use to be a lot worse than this but I fixed most (98%) of it by pulling the high end of the reed switch, high, by connecting it to the 5volt line. (That switching circuit consists of a 100 ohm resistor in series with the reed switch, resistor to ground and reed to counterA terminal) . Prior to that the voltage tended to float and drop to as low as 2-3 volts during some of these weird counts.

The counter module shematic on archive org...
https://web.archive.org/web/20081113060625/http://www.hobby-boards.com/catalog/links/dc2.5-r1/Dual%20Counter%20v2.6%20Schematic.pdf

Long story short I still get them, even after smothering the reed switch, 100 ohm resistor, daughter board in protective lacquer - thinking it might have been a moisture issue given the high humidity clue and the fact that they were never water/moisture proofed.

I'm lucky I guess, in that I've still got hair left to pull out, but I am getting tired of chasing shadows.

Quote
The explanation I believe lies in the datasheet for the BAT54S and the 1N5819 that I used.

The 1N5819 is 400mV @100mA.
The BAT54S is 800mV @100mA.

Hence, the BAT54S, while being a Schottky diode, isn't as effective as a clamp as the 1N5819. The BAT54S could allow enough negative voltage below -0.3V that the substrate issue could occur, whereas the 1N5819 has a better chance of clamping it. It all depends on the current that the diode is absorbing during the negative transient.

That's interesting, very interesting. Could it be as simple as that I wonder. I probably need to get some and try it out I guess. I'm curious though as this isn't at the end of the line - and they are on one long line - 7 sensors with 2 counter modules scattered along its length. Should I move the counters all to the furtherest end?
Anyone got a hobby-boards 4 port hub to spare (promise I won't fry this one) - Sigh....

So, I'll get some 1N5819 diodes; but while I'm here. Any-one out there got any other suggestions?

A better switching circuit perhaps? Rather than the simple 100ohm , reed switch,  in series combo.  Would bounce be a problem with a reed switch? But then the counter rolls can happen when no rain is around, meaning the bucket shouldn't have tipped, ergo - no switch to bounce?

How does the value of 100 ohm sit - electronic design speaking ? Considering I'm hooked into the 5volt line now, should that be changed? The 5 volt is not the data (DQ) line, it's seperate power reseved for just this situation. (I believe it is anyway.)




Offline Bushman

  • Forecaster
  • *****
  • Posts: 6540
    • Eagle Bay Weather
Re: Erratic One-Wire Counter issue
« Reply #2 on: March 21, 2017, 01:26:04 AM »
Can't help technically, but I do have a bunch of 1-wire stuff I would love to sell.  A couple of counters IIRC, too.

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 2837
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: Erratic One-Wire Counter issue
« Reply #3 on: March 21, 2017, 07:00:58 AM »
I have an appointment that is almost a two-hour drive, so I don't have time to ponder this now. I'll get back to you later.

Greg H.




Blitzortung Stations 668, 706 - CWOP CW4114 -  CoCoRaHS MI-PI-1

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 2837
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: Erratic One-Wire Counter issue
« Reply #4 on: March 21, 2017, 05:45:37 PM »
What is your microLan (1-wire) topology? Do you have multiple branches that head off into different directions?
Your mention of a "fried hub" makes me wonder if you have multiple branches all wired together. This gave me nothing but problems and I would recommend the hub for sure.
On the reed switch input to the counter:
Quote
That switching circuit consists of a 100 ohm resistor in series with the reed switch, resistor to ground and reed to counterA terminal

5V ---- reed --- 100Ohm ---CounterA, where is the resistor to ground? Is this the 1M already on the counter board, or something you added? If so what is the value?

I guess that it would be good to sort out whether this is a corrupted 1-wire data issue, or contact bounce causing the excessive counts.

Have you tried disconnecting the reed switch and monitoring it for a few days? If the crazy counts stop, that would point to the reed switch (input side). If they continue, it would indicate a 1-Wire kind of issue.

My involvement with 1-Wire is waning. Back when I posted this, the DalSemi/AAG equipment was my weather station. About 2012 I got a Davis VP2. The only thing I still have running is my AAG barometer. I just took down the Hobby-Boards lightning detector to free mast space for the TOA Systems detector.

On the software side, I always used "One Wire Weather" (Linux) by Simon Melhuish. I had a bunch of bash scripts that would ingest the data from OWWLOG for plotting purposes. I never tried weewx with the one-wire stuff (did run Davis for a while though).

If you have access to an oscilloscope, you might be able to see what the waveforms look like on both the counter interface side and the MicroLAN side.

I wish I could be more helpful, but that's all I have right now.

Greg H.





Blitzortung Stations 668, 706 - CWOP CW4114 -  CoCoRaHS MI-PI-1

Offline graibeard

  • rorpi - read only raspberry pi
  • Member
  • *
  • Posts: 4
    • Weather at Messmate Farm
Re: Erratic One-Wire Counter issue
« Reply #5 on: March 21, 2017, 07:49:54 PM »
What is your microLan (1-wire) topology? Do you have multiple branches that head off into different directions?
Your mention of a "fried hub" makes me wonder if you have multiple branches all wired together. This gave me nothing but problems and I would recommend the hub for sure.

Nope, since the hub started smoking it's all in the one long run, no branches. Daisy chained.
Agreed, a hub would be the best but I was too slow in getting a replacement from hobby-boards, it was shut by the time I got back to it.  The inclusion of the hub was possibly the reason why I never had a problem in the original setup, at its old location, pre major move.

Quote
On the reed switch input to the counter:
That switching circuit consists of a 100 ohm resistor in series with the reed switch, resistor to ground and reed to counterA terminal
5V ---- reed --- 100Ohm ---CounterA, where is the resistor to ground? Is this the 1M already on the counter board, or something you added? If so what is the value?

Sadly, I muffed my description.  There is no ground connection .  It's exactly as you describe  ( 5V ---- reed --- 100Ohm ---CounterA )
The optional 5 volts is now supplied to the circuit and that must have the same affect.  I don't recall where it was connected too before (Gnd would be my best guess) but it was wired as it was originally supplied.

Quote
Have you tried disconnecting the reed switch and monitoring it for a few days? If the crazy counts stop, that would point to the reed switch (input side). If they continue, it would indicate a 1-Wire kind of issue.

That's now on the list...

I was lucky enough to win an ebay auction for an original but old, 8", ex MET bureau? rain gauge, complete with dual reed switches. That's now wired up to another dual  counter (using one counter per switch) and it's all ready to go. With that,  I'll be able to come at this from a couple of directions.

As you say,  I'll  remove the reed switch from the original and leave it in circuit, it just won't be able to count.
In addition I'll put this 2nd rain gauge in the long chain and see how it responds with the one magnet, 2 switches -> 2 counters
That's 3 counters with the opportunity to play up, 1 won't be able to count - it can be the canary, the other 2 should be in sync at the best.

Quote
My involvement with 1-Wire is waning. Back when I posted this, the DalSemi/AAG equipment was my weather station. About 2012 I got a Davis VP2. The only thing I still have running is my AAG barometer. I just took down the Hobby-Boards lightning detector to free mast space for the TOA Systems detector.

How's your hub ??? :-)) Is it looking for a good home? Nudge. Nudge. Wink. Wink.( The resident now has new glasses and doesn't go cross eyed when wiring terminals; and is somewhat more careful!)

Quote
On the software side, I always used "One Wire Weather" (Linux) by Simon Melhuish. I had a bunch of bash scripts that would ingest the data from OWWLOG for plotting purposes. I never tried weewx with the one-wire stuff (did run Davis for a while though).

Yes. I had a very good run with his software - even sent him the making of a patch for the inspeed weather vane that hobby-boards offered later. My original AAG suffered from the harsh UV here in Oz - it crumpled somewhat and started to turn into dust. (I saved the internals though - 1 day...) The Inspeed gear has been flawless - still glistens in the sun after 6+ (?) years. Now that's good UV protection.
Weewx has been, and still is, excellent.
Quote
If you have access to an oscilloscope, you might be able to see what the waveforms look like on both the counter interface side and the MicroLAN side.
I wish I could be more helpful, but that's all I have right now.
I do have access to one. We'll see.

Thanks for that, it's pretty helpful as it is. And especially thanks for your original informative post.
It might have sat there alone for a while, but it bore visible fruit in the end.
I'd better go now - and take my pseudo lyrical with me...


Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 2837
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: Erratic One-Wire Counter issue
« Reply #6 on: March 22, 2017, 08:52:59 AM »
Quote
How's your hub?

I found the old AAG hub, but I can't find the power supply for it. I may have used it for something else.

I think that I also have a H-B hub, but it might be packed in boxes from the move three years ago  :oops:

Try Bushman, maybe he has one. If not, I could look some more, but it will take some effort.

Greg H.





Blitzortung Stations 668, 706 - CWOP CW4114 -  CoCoRaHS MI-PI-1

Offline nellyt

  • Member
  • *
  • Posts: 2
Re: Erratic One-Wire Counter issue
« Reply #7 on: August 13, 2017, 04:52:09 AM »
I am having similar issues with my inspeed anemometer on OWS via a Hobby boards counter.
(Interfaced to Weewx and OWS driver)

Its values go very high in high humidity and rain.

There is an old discussion here on the same problem : http://www.weather-watch.com/smf/index.php/topic,40769.45.html

I have just today connected up my Bitscope onto the lines. I need to tidy the wiring, but it seems to show a lot of 50Hz interference that changes amplitude in rain.
I dont understand why this changes in rain but the numbers correlate with the values I am seeing in Weewx and the raw counter values.
The inspeed pulls the line hard to 5V for a period and lets it float at the mercy of the wires and 1M pull down resistor(or maybe 500k if the shorting resistor is there). During the 'floating period' there is 50Hz interference. The number of these 50Hz cycles along with the correct +'ve edge directly correlates with the numbers I am seeing.
At different wind speeds the 5V period changes duration as does the number of 50Hz pulses. The numbers still correlate with the silly values I get.
This mains interference theory correlates with the values in the thread above (which is 8 years old)

i will investigate further.
Maybe your rain issue is similar. Can you look at your raw counter values in Weewx by running it with
sudo ./bin/weewxd weewx.conf
and see if the counts happen to be increasing at 50 or 60Hz ?

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 2837
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: Erratic One-Wire Counter issue
« Reply #8 on: August 13, 2017, 08:20:27 AM »
I am having similar issues with my inspeed anemometer on OWS via a Hobby boards counter.
(Interfaced to Weewx and OWS driver)

Its values go very high in high humidity and rain.

There is an old discussion here on the same problem : http://www.weather-watch.com/smf/index.php/topic,40769.45.html

I have just today connected up my Bitscope onto the lines. I need to tidy the wiring, but it seems to show a lot of 50Hz interference that changes amplitude in rain.
I dont understand why this changes in rain but the numbers correlate with the values I am seeing in Weewx and the raw counter values.
The inspeed pulls the line hard to 5V for a period and lets it float at the mercy of the wires and 1M pull down resistor(or maybe 500k if the shorting resistor is there). During the 'floating period' there is 50Hz interference. The number of these 50Hz cycles along with the correct +'ve edge directly correlates with the numbers I am seeing.
At different wind speeds the 5V period changes duration as does the number of 50Hz pulses. The numbers still correlate with the silly values I get.
This mains interference theory correlates with the values in the thread above (which is 8 years old)

i will investigate further.
Maybe your rain issue is similar. Can you look at your raw counter values in Weewx by running it with
sudo ./bin/weewxd weewx.conf
and see if the counts happen to be increasing at 50 or 60Hz ?

I would recommend that you check your system for the following:
  • Ground loop, check computer grounding and power supply for hub (if used). Check for a ground at the "far end" and the interface end causing a loop.
  • One-Wire wiring run parallel to 50Hz wiring. Do you have twisted-pair wires?
  • Poor filtering in 5V feed to one-wire (check hub supply or PC interface (DS9490R) 5V USB voltage ripple)

Greg H.




Blitzortung Stations 668, 706 - CWOP CW4114 -  CoCoRaHS MI-PI-1

Offline graibeard

  • rorpi - read only raspberry pi
  • Member
  • *
  • Posts: 4
    • Weather at Messmate Farm
Re: Erratic One-Wire Counter issue
« Reply #9 on: August 13, 2017, 08:49:14 AM »
Hmm, Seems to be a theme here - humidity, rain, runaway values.

Since Greg was generous enough to make his Hub available (Thanks again Greg) and with it now in circuit, I've had absolutely no problems with erratic values.  In fact since a hub has been re-introduced the whole system has settled down; I used to get occasional spike values in various other sensors (barometer, outHumidity) but they've been absent for months. (Darryns qc.py mod dealt with those spike values when they occured)

I have an Inspeed anenometer and windvane attached to the matching HB anenometer counter A/D board (the one supplied with it). I've had no problems with that, it's performed without any of the issues the other counters have. It has a 4 metre wire run (non twisted, as supplied) to the HB controller.
Going by your other post, you have the same board? ( you called it "Hobby Boards ACM/control board ")
Has it been coated, waterproofed?
Is your 14 volt supply clean (ripple free)?

Interesting about the 50 cycle hum. Is that your mains frequency? If so, look for mains wire proximity

It's certainly that floating voltage that sets off the counter.  A nice high, or corresponding low are fine - that hazy, indecisive 2-3volts just sets it off.

With weewx you can read the VDD voltage from any plain counter using the VDD page...
eg; rainBatteryStatus = /uncached/1F.455805000000/aux/26.AB79BC000000/VDD
With the anenometer board there's probably not much point though as VDD is used in the calcs so it's self correcting/negating.

I've set weewx to record and plot the actual rain counter values, 50 Hz is too quick to catch in those charts and I suspect it wasn't that in my setup. I could have one LOOP reading that would increase by the tens of thousands. The next just  a couple of hundred.