Hi!

I've been experimenting for a while to get good results with a DS2406
configured for input, utilizing the edge detector latch feature (this
would probably apply to DS2408 which also has this feature).
Since this haven't been as simple as "connect the switch between GND and
PIO", I'd thought I ask around to see what your successful solutions
look like?

Also, I thought I'd share my findings and schematics, and ask for any
advice or input on it. I'm no EE, just a hobbyist, so my know-how is
somewhat limited..

First some background (TLDR below):

I have a 1-Wire network with 26 temperature sensors (DS18B20, DS18S20),
and 4 inputs via DS2406. The master is a LinkUSB dongle, and 5V VCC is
provided by an external PSU.
The bus is ~80 meters (estimated), in a almost-perfect bus shape, i.e.
no stars and almost no stubs longer than 1 meter (I think there are 2 or
three exceptions). The devices are distributed along the bus at uneven
places.
All temperature sensors are powered, and temperature conversions are
executed using simultaneous convert every minute.

Two of the DS2406's have been on the net for a while, both configured
with a pull-up resistor, and a push-button switch which shorts to
ground. I have a script which scans the alarm directory a few times per
second,
and if anything is found, reads the status of the latches. Most of the
time this gives acceptable delay. When executing temperature
conversions, there naturally is a bit of delay, but usually not more
than a second or so.

Mostly this has been working good, with reliable triggering of the
latch. However, one problem with pull-up based circuit is that I get
erroneous triggers if VCC disappears, for example due to a bus
disconnect, either unintentionally or intentionally (me adding/removing
devices or rerouting, or something). My first thought was that this
should be easily avoided by using pull-down resistors instead, and
bringing the input high by closing the input to VCC.

I do have a circuit which seems to be working fine now, but let me guide
you through my experimental steps/thoughts:
During this experimentation I added another two DS2406, one powered and
one unpowered. The rest of the ones in the net are unpowered.

At first I just tried with a simple resistor pull-down (PIO<->GND),
quite high though, 60k.. In one location, with short leads between PIO
and switch, this was quite successful, but some random triggers too. In
another setup, with a ~50cm cable between the PIO and the switch, the
latch triggered all the time. Tried to lower the pull-down resistor
value, and at 12k it still fired of all the time.
Removing the cable from the PIO immediately removed the invalid
triggers, at least the constant ones.. Every now and then it decided to
trigger anyway..
Why the cable? Mainly for serviceability.. Also, tried a shielded cable
and connecting shield to GND it; no effect at all.

To avoid this, I tried to connect a 100nF ceramic capacitor (C1) between
GND and PIO, that is parallel with the pull-down resistor. Immediately
this resolved the above problems, even with the cable connected.
However, this introduced another problem.. On the powered DS2406 (lets
call it IC2) which was a few meters of cable away, I now started to get
random latch triggers, when I pressed the button on IC1. My guess is
that when C1 is charged, this gives a small bump in the 5V VCC power
line, enough to fool the powered DS2406.. I have not scoped this on this
exact circuit, but in a separate lab setup (same circuit but other
PSU/no long power cable), this was easily seen.
Simple mitigation was to add a 10uF electrolyte cap between 5V and GND.
With this in place, none of the sensors have triggered without me
pressing a button, and none have missed any real inputs.

I do have some further experimentation to do, mainly trying to use a
larger resistor to lower the amount of power used when button is
pressed.. This is not so important for a push-button, but for switches
which are NC it might be more important.
>From the data-sheet, which I'm not really sure I'm reading correct, I
read that logic 0 is max 0.3V (0.4 on PIOB), and with a input leakage
current of 1.9uA, that would mean ~150k would be OK (0.3v / 1.9uA =
150k)... Totally wrong or correct?

TLDR:
The current version of the circuit, which seems to work, is now a
unpowered DS2406, with a 12k resistor and a 100nF cap between PIO and
GND, and then a piece of cable to the switch connecting to VCC.
Schematic:
http://www2.stromnet.se/~johan/schematics/1wire/ds2406-input-v3.png
This has worked perfectly for 2 days or so now (the previous ones
triggered wrongly of a few times per day).


So.. my questions would be:
a) what does your DS2406/08-setup look like, and have you had any
similar problems?
b) any ideas for improvements on the schematic described above? Any
flaws or common EE practice which I've missed?
c) Any comments on data-sheet based guesses?

Thank you!
Johan

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to