DS2423 going crazy

Forum about 1-Wire devices.
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

DS2423 going crazy

Post by Digit »

Hi,

I am using a Dual Counter from Hobby Boards for monitoring my gas usage. (http://www.hobby-boards.com/catalog/pro ... ucts_id=42)

For a bit more info on how I do this see:http://www.domoticaforum.eu/topic.asp?TOPIC_ID=119

At first everything seemed to work just fine, but occasionally it seems like the DS2423 goes crazy, it just keeps incrementing its counter while nothing really happens!

The DS2423 is queried every 5 seconds to see if there is a change in 1 of the 2 counter-values and if so, both values are written to an SQL table.

The following table will show what i mean:

Code: Select all

<b>Time                 CntrA   CntrB</b>
7-7-2006 19:06:13 	495615	143850
7-7-2006 19:06:43 	495616	143850
7-7-2006 19:07:18 	495617	143850
7-7-2006 19:07:48 	495618	143850
7-7-2006 19:08:18 	495619	143850
7-7-2006 19:29:40 	495620	143850
7-7-2006 19:29:55 	495621	143850
7-7-2006 19:30:20 	495622	143850
7-7-2006 19:41:06 	495623	143850
8-7-2006 0:51:02  	496011	143851
8-7-2006 0:51:27  	496267	143851
8-7-2006 1:36:55  	496687	143851
8-7-2006 1:41:16  	496688	143851
8-7-2006 1:41:36  	496689	143851
8-7-2006 1:42:01  	496690	143851
8-7-2006 5:43:11  	496691	143851
8-7-2006 5:43:26  	496692	143851
8-7-2006 5:43:46  	496693	143851
FYI: Counter B (CntrB) is not connected to anything, so it shouldn't count anything! Counter A is used to monitor the gas usage.

As you can see above, everything works fine on 7-7-2006. Counter A is perfectly counting the gas usage, Counter B keeps the same value all the time. Perfect.

But then, suddenly, at 08-07-2006 00:51 both counters behave unexpectedly. Counter B increments and at the same time, Counter A increments far too much in a query-interval of just 5 seconds...the DS2423 is going crazy!

And then, as if nothing has happened, it goes back to "normal" at 8-7-2006 1:36:55...

You can imagine what this would do to my gas statistics...

What i've tried so far to eliminate this misbehavior is:

- use shielded cables for the CNY70;
- put everything (counter kit, LM741 etc.) in an aluminum case;
- use different algorithms to read the DS2423.

But i still haven't found any solution yet.
This "going crazy" just happens once every 1-3 weeks, and i still have no clue what causes this.

I recently added a screendump-routine to my program that is triggered whenever "strange" counter-values are encountered, but with no results yet. Maybe i can see something on these screendumps that will give me new information to work with. That's why i still have a datalogger monitoring some input-voltages that are going to the DS2423.

Another thing i have found out recently, is that when these strange behavior occurs, the time to establish a 1-Wire session (i'm using TMEX) is >5 times the normal value (>1000 ms vs. 180 ms). Why's that?

So, it's all still a big mystery to me what's going on with my DS2423, maybe someone can come up with some ideas...???
simplemind
Starting Member
Starting Member
Posts: 27
Joined: Wed Aug 16, 2006 8:31 pm
Location: Netherlands
Contact:

DS2423 going crazy

Post by simplemind »

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by Digit</i>
FYI: Counter B (CntrB) is not connected to anything, so it shouldn't count anything! Counter A is used to monitor the gas usage.<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
However, the 1-wire device has internal resistors on the counter inputs you could profide an external resistor to ground or +5V at channel B.

Did you decoupling the power supply with enough capacitors?

You have a correct value for pull-up resistor on the 1-wire line? 1k5 ~ 5k.

Power fluctuations on the devices?

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Another thing i have found out recently, is that when these strange behavior occurs, the time to establish a 1-Wire session (i'm using TMEX) is >5 times the normal value (>1000 ms vs. 180 ms). Why's that?<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
The 1-wire uses CRC. When this value is not correct it does a reread or rewrite on the device and that takes time.

Regards,

Marcel
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

DS2423 going crazy

Post by Digit »

Your questions suggest you're thinking it's an electrical problem. Well so do i, but i just don't know where to start. I <i>think</i> i connected everything right, but don't know for sure. I'm a real newbie for that matter.

If it's allright with you, i'll draw a complete schematic surrounding the 1-wire counter, from the 5V power supply up to the serial interface connected to the PC. Maybe you could take a look at it and find out what could be wrong with how i did things...?
simplemind
Starting Member
Starting Member
Posts: 27
Joined: Wed Aug 16, 2006 8:31 pm
Location: Netherlands
Contact:

DS2423 going crazy

Post by simplemind »

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by Digit</i>
<br />Your questions suggest you're thinking it's an electrical problem. Well so do i, but i just don't know where to start. I <i>think</i> i connected everything right, but don't know for sure. I'm a real newbie for that matter.
If it's allright with you, i'll draw a complete schematic surrounding the 1-wire counter, from the 5V power supply up to the serial interface connected to the PC. Maybe you could take a look at it and find out what could be wrong with how i did things...?
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">Ok draw the schematics, I'll take a look at it.
BTW, did you connect the counter on a clock circuit e.g. 1 khz and see if the problem occurs on a much faster scale?

Regards,

Marcel
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

DS2423 going crazy

Post by Digit »

Hi,

Here is the [img]images/icon_paperclip.gif[/img]Gas-schematic.jpg

As you can see it is similar to Pieter's schematic for his gas monitoring. Both the CNY70 and the LM741 are connected (not drawn in the picture) to the same +5V (5.4V actually) that comes from the AC-DC 5V adaptor in the lower left corner.
The parts surrounding the DS2423 are taken from a schematic from www.hobby-boards.com for their dual counter.

The DS2423 is the only 1-Wire device i have operational right now and i don't use any pull up resistors.

Any suggestions on improvements?

TIA,
Robert.
simplemind
Starting Member
Starting Member
Posts: 27
Joined: Wed Aug 16, 2006 8:31 pm
Location: Netherlands
Contact:

DS2423 going crazy

Post by simplemind »

I still suggests the pull up resistor on the 1-wire line, 1k5 ~ 5k This is information comming from DALLAS/MAXIM. If this doesn't do the job the problem is related to something else.
Good luck!

Regards,

Marcel
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

DS2423 going crazy

Post by Digit »

Thanks for taking the time to have a look at it. I think I'll add a pull up resistor and see what happens. Just checked: the last time the DS2423 went crazy was on 16-08-2006. So it can take a long, long time before I can give any conclusions whether things have improved... :-(

I found out some other strange thing just now:
Counter B, not actually counting anything (not connected to anything), gives false readings from time to time. This occurs at the same low frequency. This is a sequence of readings i just found:

143969
36856120
143969

Convert this to binary, you get:

100011001001100001
10001100100110000100111000
100011001001100001

So, where do these 8 additional bits suddenly come from?
They come and disappear...and the first 16 are identical!

This looks like something going wrong "on the wire" to me.

However, actually this seems to be just another problem; in this case, the counter returns to it's original value, while counter A really seems to count something and jumps to higher and higher values...

I'll keep you informed!

Regards,
Robert.
simplemind
Starting Member
Starting Member
Posts: 27
Joined: Wed Aug 16, 2006 8:31 pm
Location: Netherlands
Contact:

DS2423 going crazy

Post by simplemind »

Robert,

ImageFig 2.

This circuit comes from Dallas/Maxim and shows us that they connect counter A and B in parallel with an 1M resistor to ground. Further Maxim states:

<i>A circuit example using magnetically actuated reed switches is shown in Figure 2. In the circuit, an external 1M pull-down resistor is used from the inputs to ground to prevent generating spurious counts during turn-on and to minimize noise pick-up.</i>

However in an electronic driven situation this is might not be such a good idea because the 1M resistors are meant for reed switches. What will happen. If I look at your circuit counter A and B has a 1M resistor to ground. The opamp 741 has a 2M2 feedback resistor. If you simplify the schema the 1M and 2M2 resistor are placed parallel to each other. So the 1M resistor is lowering your gain of the 741.

I don't know if the resistors are smd types or normal types but maybe you could desolder these things and connect also counter B to A. Do a counter reset and drive both counters from the 741.

Just MHO and maybe has nothing to do with your problem but [...].

Regards,

Marcel
simplemind
Starting Member
Starting Member
Posts: 27
Joined: Wed Aug 16, 2006 8:31 pm
Location: Netherlands
Contact:

DS2423 going crazy

Post by simplemind »

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by Digit</i>
<br />Hi,

Here is the [img]images/icon_paperclip.gif[/img]Gas-schematic.jpg

As you can see it is similar to Pieter's schematic for his gas monitoring. Both the CNY70 and the LM741 are connected (not drawn in the picture) to the same +5V (5.4V actually) that comes from the AC-DC 5V adaptor in the lower left corner.
The parts surrounding the DS2423 are taken from a schematic from www.hobby-boards.com for their dual counter.

The DS2423 is the only 1-Wire device i have operational right now and i don't use any pull up resistors.

Any suggestions on improvements?

TIA,
Robert.
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">

I think this will not work. The phototransistor part of the CNY70 is reversed connected and + input of the opamp is grounded! People who'll use this schema will get problems.

Regards,

Marcel
simplemind
Starting Member
Starting Member
Posts: 27
Joined: Wed Aug 16, 2006 8:31 pm
Location: Netherlands
Contact:

DS2423 going crazy

Post by simplemind »

Robert, did you experiment with http://www.maxim-ic.com/products/ibutto ... Viewer.cfm

Regards,

Marcel
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

DS2423 going crazy

Post by Digit »

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by simplemind</i>
<br />
The phototransistor part of the CNY70 is reversed connected

Regards,

Marcel
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">

You are right. The drawing is false. It's connected right in real life.

Regards,
Robert.
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

DS2423 going crazy

Post by Digit »

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by simplemind</i>
<br />Robert, did you experiment with http://www.maxim-ic.com/products/ibutto ... Viewer.cfm

Regards,

Marcel
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">

Yes, I did in the past and just now (to be sure). No problems reading it the DS2423. But just for a short period, not for weeks and weeks...

Regards,
Robert.
simplemind
Starting Member
Starting Member
Posts: 27
Joined: Wed Aug 16, 2006 8:31 pm
Location: Netherlands
Contact:

DS2423 going crazy

Post by simplemind »

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by Digit</i>
<br /><blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by simplemind</i>
<br />
The phototransistor part of the CNY70 is reversed connected

Regards,

Marcel
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">

You are right. The drawing is false. It's connected right in real life.

Regards,
Robert.
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">

In that case you must ignore my comment of parallel placing resistors at the 741.

Still try connect, both counter A and Counter B in parallel. Reset them and both must count the same ticks.

Regards,

Marcel
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

DS2423 going crazy

Post by Digit »

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by simplemind</i>
<br />
and + input of the opamp is grounded!

Regards,

Marcel
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">

Oh no... Reading your comments and rereading http://www.uoguelph.ca/~antoon/gadgets/741/741.html (the main source from where i got my "knowledge" on how to use the opamp) shows me i am doing something wrong here... (Do not confuse the -V with ground...)

So, in other words, i think it's back to the drawing board for me...

Thanks very much for your input. I guess by now you'll understand i'm totally unfamiliar with this kind of stuff...

Regards,
Robert.
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

DS2423 going crazy

Post by Digit »

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by simplemind</i>
In that case you must ignore my comment of parallel placing resistors at the 741.

Still try connect, both counter A and Counter B in parallel. Reset them and both must count the same ticks.

Regards,

Marcel
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">

Marcel,

I think i'm gonna need some time to work things out.

Actually, it's pin 4 (-V or Vss) that is grounded. Again, false drawing. Sorry sorry for that. My schematic has messed up this whole topic i think. I think i've been too hasty producing it...

But, when you get as close as this:uploaded/Digit/20069804854_pcs10.jpg (Yellow= CNY70 output, Green=input for the DS2423), i'm not gonna give up on it!

So, allthough i still don't really understand why, i'll put both counters in parallel and see what happens then.

If you can come up with any more improvements, be my guest!

Regards,
Robert.
Post Reply

Return to “1-Wire Forum”