Shop OBEX P1 Docs P2 Docs Learn Events
Dallas Weather Station WS-1 — Parallax Forums

Dallas Weather Station WS-1

JonathanJonathan Posts: 1,023
edited 2013-04-01 10:43 in Propeller 1
Hi All,

I am working on a data logger for weather using a Dallas Experimenter's Kit WS-1. I have found a fair amount of data, but can't seem to find connection info. The kits came with an adapter for PC use, but I want to use it with a Prop, of course. The cable that came with it is a phone cord, with only two wires, red and green, connected to the plugs.

Any help as to how to hook it up? I have DL'd the one-wire object, and just need to figger out how to hook the dang thing up.

Thanks!

Jonathan

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
«1

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-08-31 20:11
    This document should help you: http://davidbray.org/onewire/Owstd.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • deSilvadeSilva Posts: 2,967
    edited 2007-08-31 20:14
    To my knowledge there is not yet a 1-Wire driver for the Propeller.
    DALLAS has a wealth of information for it www.maxim-ic.com/appnotes10.cfm/ac_pk/1

    There exist drivers for many other microcontrollers (e.g. AVR -> see BASCOM)

    BTW: Here is a nice descripotion ofthe "Wheather Station":
    oww.sourceforge.net/oww.html
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-08-31 20:15
    deSilva, it is here: http://obex.parallax.com/objects/18/

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • deSilvadeSilva Posts: 2,967
    edited 2007-08-31 20:20
    Paul Baker (Parallax) said...
    This document should help you
    Paul, don't you think your link was a little bit too economical?

    Speaking of economics and marketing.. Funny that they call a thing that works fine with three wires, a 1-Wire...
  • JonathanJonathan Posts: 1,023
    edited 2007-08-31 20:21
    Thanks for the help!

    The trouble is that the connectors that came with the kit only use the green and red wires. The pinout you so kindly linked shows green as HOT and red as RETURN. I'm still left puzzling as to how to hook this up. Green = +5VDD? Red = data?

    Thanks,

    Jonathan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • deSilvadeSilva Posts: 2,967
    edited 2007-08-31 20:23
    Paul Baker (Parallax) said...
    deSilva, it is here
    Thank you! Sorry I missed it; but I had never an application for it smile.gif
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-08-31 20:45
    Jonathan, Green is data and Red is the return (GND), one wire gets it's power from the data line by requiring periodic transitions on the data line to charge a local capacitor it derives it's power from.

    DeSilva, Ive never worked with one wire, but in my previous job I was a professional searcher, so I quickly found the information. Since it's information was spartan, so was mine.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • deSilvadeSilva Posts: 2,967
    edited 2007-08-31 20:49
    Paul Baker (Parallax) said...
    Ive never worked with one wire, but in my previous job I was a professional searcher

    So Google sent you into redundancy? Just kidding smile.gif

    I think the Dallas way is extremely interesting, but it is also expensive, and hardly known in Europe..
  • JonathanJonathan Posts: 1,023
    edited 2007-08-31 20:49
    Paul,

    Many thanks for the help. I still don't get how to hook it up- looking at the example for the DS1820 in the Stamp manual, I don't see how I can acheive this configuration using only 2 wires- I see the need for 3.

    Thanks, I'll keep puzzling,

    Jonathan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-08-31 21:00
    deSilva said...
    Paul Baker (Parallax) said...
    Ive never worked with one wire, but in my previous job I was a professional searcher

    So Google sent you into redundancy? Just kidding smile.gif

    I think the Dallas way is extremely interesting, but it is also expensive, and hardly known in Europe..
    I was a patent examiner, half of my job consisted of looking for prior art. Thier search engine puts Google to shame, there were no unsearchable characters, infinitely nestable booleans, range searchs,·wildcard and n wildcharacter,·proximity searches both ordered and unordered (words apart, same sentance, same paragraph, adjacent paragraphs, same heading), any sub field is searchable (title, abstact, body, claims, author, assignee, filed date, examiner, assistant examiner), and Im sure Im forgetting some features.

    I did internet searches, but we were only permited to background searches, no searching of inventive concepts because inventive concepts are confidential information.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • deSilvadeSilva Posts: 2,967
    edited 2007-08-31 21:09
    Here are two extraordinary good descriptions:
    en.wikipedia.org/wiki/1-Wire
    pdfserv.maxim-ic.com/en/an/onewirebus.pdf

    I do not know whether your devices need any power, but for data only you should just connect the green line through a 1k resistor to a Propeller Pin (RED to GND).

    Then start Cam's demo program...
  • Tom WyckoffTom Wyckoff Posts: 26
    edited 2007-09-01 01:27
    I did a lot with the one-wire devices a few years ago. One-wire refers to the communications mode, one bi-directional wire & ground. Most of the devices run on parasitic power from the 5 volt pull-up on the commmunication line. The timing requirements are nasty. Dallas also sells (sold?) a DS9097U serial port adapter that could connect a standard RS232 port to a one-wire line.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2007-09-01 03:42
    They still do...

    www.maxim-ic.com/quick_view2.cfm/qv_pk/2983

    Oldbitcollector

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Buttons . . . check. Dials . . . check. Switches . . . check. Little colored lights . . . check.

    — Calvin, of 'Cavin and Hobbes.
  • Ken PetersonKen Peterson Posts: 806
    edited 2007-09-01 04:07
    I find 1-wire interesting...certainly applicable for situations where you want to use an existing phone line (for example) to do something else. 2 wires are all you need. I think the 1-wire name is misleading....anyone who has electrical background knows you need 2 wires to complete a circuit.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    The more I know, the more I know I don't know.· Is this what they call Wisdom?
  • deSilvadeSilva Posts: 2,967
    edited 2007-09-01 07:36
    O.k. I think I had a blackout last night (It's morning now in Europe!). But reading the documentations I pointed to helped smile.gif
    The 1-wire bus is best considered as an "open-collector" bus, same as I2E is.
    So the voltage is controlled by Vcc only!
    As the devices drag current from this supply, the collector resistor ("pull-up" is not the absolutely correct term in this connection... I have also read: "strong pull-up" smile.gif ) must be selected carefully. I should recommend 1k, but 470R or 2k2 will do as well, depending on the size of the "micro lan".

    A series resistor is neither necessary nor useful!!

    And - as I already said - Cam's test program and driver should work immediately


    However: I also found remarks as to certain needed voltage ... Maybe some devices will not work from a 3V3 supply. But due to the nature of open-collector circuits, you can connect this "strong pull-up" to 5V without any fear for your Prop

    Post Edited (deSilva) : 9/1/2007 7:45:44 AM GMT
  • BradCBradC Posts: 2,601
    edited 2007-09-01 10:16
    I'm using the DS18S20 in 3 wire mode here. I have the VDD pins connected to the 5V rail and just use a 3.3V pullup on the data line connected directly to the prop IO pin.

    I had already written my own one wire driver before I spotted Cam's (which is far superior to mine) but they will reliably communicate with 3.3v on the data line. Not sure about powering them from 3.3v over long distances though. It works locally on the breadboard however.

    I used cheap-o 4 core telephone cable to the sensors and put a 103 cap across the power pins of each sensor at the end of their cables. Seems to be reliable (read as 0 data errors, polling 3 units per second for about 3 weeks continuously). I have 3 sensors and each one has its own data pin, so I can poll them in parallel.
  • deSilvadeSilva Posts: 2,967
    edited 2007-09-01 11:00
    Quite interesting reading.... What DALLAS calls "parasitic power supply" is not just that easy... I post the recommended "strong pull-up".

    At the moment I can see no reason why a - say - 470R collector resistor, rather than a transistor should not fulfil all requirements, wasting 7 mA all the time of course...
    But 3V3 Vcc is certainly on the low side - connecting to 5V seems quite appropriate

    Post Edited (deSilva) : 9/1/2007 11:27:29 AM GMT
    800 x 250 - 9K
  • Ken PetersonKen Peterson Posts: 806
    edited 2007-09-01 13:40
    @deSilva: The circuit you show won't work will it? You have a pull-up resistor and a transistor connected to V-pu. There's nothing to pull the line down. The transistor should be connected to ground (return).

    Most of those 1-wire devices have very low power requirements, so pulling them up with a resistor should be sufficient.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    The more I know, the more I know I don't know.· Is this what they call Wisdom?
  • deSilvadeSilva Posts: 2,967
    edited 2007-09-01 14:43
    Ken Peterson said...
    ... and a transistor connected to V-pu. There's nothing to pull the line down.
    The device will do that. That is one of the many tricky things in the 1-wire protocol. The "master" must not switch the transistor unless it detects this situation - in fact exactly when a slave pulls the line down.
  • JonathanJonathan Posts: 1,023
    edited 2007-09-01 15:21
    Still no luck getting it to work.

    Desilva, using your schematic, I take it the base of the transistor is connected to another Prop pin. Looking at the one wire object, I don't see this pin in use.

    All of the other methods I have tried so far have failed. I have a one wire temp. sensor around here, I'm going to try that later and see if I can get it to work.

    Thanks for all the help, folks!

    Jonathan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • Ken PetersonKen Peterson Posts: 806
    edited 2007-09-01 15:25
    @deSilva: My understanding of the 1-wire protocol is that it is simply a wired-or bus with a pull-up resistor. Either the master or the slave can pull the line down. The device will only pull down on the line when instructed by the master to send data. The device gets its power from the bus because the average voltage on the bus is high and the device has an internal cap to keep it powered during the brief periods when the line goes low.

    The Dallas/Maxim data sheets show the device connected to a microcontroller with a pull-up resistor...that's it.

    http://www.maxim-ic.com/appnotes.cfm/appnote_number/3989

    The only tricky thing about 1-wire is the protocol itself - like device discovery, etc.

    Ken

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    The more I know, the more I know I don't know.· Is this what they call Wisdom?
  • Ken PetersonKen Peterson Posts: 806
    edited 2007-09-01 16:06
    OK...I read the DS18S20 data sheet...NOW I get what you're trying to do. The 1-wire object on OBEX may not support parasitic power, but I didnt' look at it that closely.

    Perhaps you could put a button battery on Vdd of your temperature sensor.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    The more I know, the more I know I don't know.· Is this what they call Wisdom?
  • deSilvadeSilva Posts: 2,967
    edited 2007-09-01 16:11
    As I am totally lacking practical experience I cannot say when to use strong pull-up and when a simple resistor suffices.
  • Ken PetersonKen Peterson Posts: 806
    edited 2007-09-01 16:49
    I think in this case - use strong pullup or local supply when indicated by the datasheet for the device. Not all devices require that much power, but the DS18S20 apparently does. I guess I incorrectly assumed all 1-wire devices were very low power.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    The more I know, the more I know I don't know.· Is this what they call Wisdom?
  • Ken PetersonKen Peterson Posts: 806
    edited 2007-09-05 14:26
    Thought this might be handy for anyone thinking of using 1-wire devices.

    http://www.maxim-ic.com/quick_view2.cfm/qv_pk/4382

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    The more I know, the more I know I don't know.· Is this what they call Wisdom?
  • Goran (Sweden)Goran (Sweden) Posts: 68
    edited 2007-09-05 19:25
    Jonathan

    Reading the Datasheet it seems 1 Wire mean it use only 1·PIN to communicate!!!
    But it still need Power and ground.

    It seems this 1 wire (DS1820) needs a bit more power then other 1 wire chips which take the power from the dataline.

    I have used the DS1820 in a project·with a SD card for logging long time

    I simply connected the VDD to 3,3V on the Prop
    and used one i/o pin for communication.
    GND was also connected to the prop.

    I used the 1 wire demo found in the http://obex.parallax.com/
    and it works fine. I change it a bit to fit in my project but it's mainly the same function.

    Goran Sweden

    [font=Arial,Bold size=4]Pasted from the datasheet:
    FEATURES
    [/font]Unique 1-Wire® interface requires only one port pin for communication
    Can be powered from data line. Power supply range is 3.0V to 5.5V
    [font=Arial,Bold size=4]PIN DESCRIPTION
    [/font]GND - Ground
    DQ - Data In/Out
    VDD - Power Supply Voltage
  • ahanktcdahanktcd Posts: 8
    edited 2007-09-10 17:47
    Hi all,

    Thanks for the discussion on the DS18s20. I've got quite a collection of these and am just getting into the Propeller. I'll be hooking up a bus of these devices and testing the OW routines. Thanks for the insight!
  • FranklinFranklin Posts: 4,747
    edited 2007-09-11 04:10
    Circuit Cellar magazine August and September have an article on building a leading edge de-icing system using one wire devices to communicate between themselves. It addresses the pullup problem and has some great ideas on making a OW network robust.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • JonathanJonathan Posts: 1,023
    edited 2007-09-11 15:14
    J found a one-wire temp sensor (forget # ATM) in my parts bin yesterday, so I will try playing with that.

    However, I still don't get how I can possibly hook the weather station up with only 2 wires. However, that is obvioulsy what the manufacturer intended, so I have to think it's possible.

    Grrr.

    Thanks for all the help folks!

    Jonathan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • Paul Sr.Paul Sr. Posts: 435
    edited 2007-09-11 15:54
    Professor Peter Anderson has done quite a bit with "one wire" and sells products that facilitate easy use of these devices. I have purchased some of his items and they are very good quality.

    This is a good and relevant example www.phanderson.com/onewire/owc190.html
Sign In or Register to comment.