Shop OBEX P1 Docs P2 Docs Learn Events
Dallas 1-wire Weather station & Propeller ... reinventing the wheel? — Parallax Forums

Dallas 1-wire Weather station & Propeller ... reinventing the wheel?

K6MLEK6MLE Posts: 106
edited 2012-12-28 18:18 in Propeller 1
I've just gotten my first Propeller and thought it would be a perfect candidate to resurrect my old (original) Dallas 1-wire weather station. Has this been done successfully by anyone here? Last night I figured out how to output text to a small composite video display ... this is what I'd like to use to display information from the weather station. Will I be reinventing 'the wheel'?

Thanks,

Michael
K6MLE

Comments

  • PliersPliers Posts: 280
    edited 2012-12-08 17:00
    Hey Dallas.
    Welcome to the forum.
    I see that no one has replied to your question. I guess that nobody has worked with the Dallas 1 wire weather station.
    I have thought about weather station applications with the propeller, but never attempted any.
    Sounds like fun.
  • zoopydogsitzoopydogsit Posts: 174
    edited 2012-12-08 17:33
    Michael,
    Welcome to the forum!
    It shouldn't be too hard, have a look in the OBEX and search the forum, you should find a number of examples of folks reading data from other Dalas Semi devices like the DS18B20. Though read past posts in the forum for the most up to date working code. From memory Dallas published a lot of information on their 1 wire sensors.
    When searching the forum, you may find you can only search a few weeks, you can adjust this in your Profile, under Settings, General Settings, called "Default Thread Age Cut Off:"

    If you get stuck, post your sample code in the forum and ask for help.

    Regards,
    Dave
  • K6MLEK6MLE Posts: 106
    edited 2012-12-08 21:06
    Thank you for the input!

    Since the Spin language is new to me, I will probably work my way through the 'Help' tutorial and get a feel for how the syntax works. Just for starters, it would appear the various functions could be assigned to different cogs: TV out, 1-wire comm, etc. Once through the tutorial, the next step will be to grab a few 1-wire devices I have around here and see that I can talk to them and have their data display on the video monitor.

    Once that 'proof-of-concept' is working, it might be prudent to scan the weather station and see that I can still read it. I did come across an article in Sensors Magazine (from years back) that talked about interfacing/communicating with the weather station. That looks like it might be a useful source.

    Then ... having 'mastered' Spin ... I'd like to take a look at one of the Forth dialects (a language loved by us old hardware types) and see what sort of projects I can dream up using Forth.

    So many cogs; so little time!!

    Regards,


    Michael
    K6MLE
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-12-09 01:31
    OBEX does have a Dallas 1-wire object that should get you data from your existing weather station. Most of th 1-wire chips are easy to comply with, but a few of the more ambitious ones may not follow the original timing that Dallas envisioned.

    It seems at this point you are trying to determine your 'cog budget'

    Some video requires two cogs to perform. I believe that is VGA
    If you want to do something fancy, you might add a mouse to your video screen.

    How many cogs for 1-wire? I really don't know. Some of this would depend on what you have for the weather station. Are humidity and temerature separate chips. Are all the chips on truly 1-wire and require addressing? And so on.

    I most significant issue may be that 1-wire is expecting +5 volts and the Propeller is +3.3 volt i/o. You may have to insert and active bi-directional level shifter (can be done with one 2N7000 Moset and a few resistors) in order to get the communications right. As I recall, the Dallas 1-wire may have difficulty with a purely 3.3 v interface.
  • K6MLEK6MLE Posts: 106
    edited 2012-12-28 18:18
    Can someone show me the errors of my ways with the DS1820? I'm using the code for the DS1822 (Demo1.spin) and understand that the part defaults to 12-bit resolution. The DS1820 uses only 9-bit resolution. I've tried a few combinations of shifting bits around, but to no avail. My understanding is that the line reading:
    temp := ow.readByte + ow.readByte << 8
    is taking the lowest bit in the MSB of the temperature register and moving it to the highest bit position, then adding them together.
    If I'm correct, the first ow.readByte command grabs the LSB of the temperature register; the second grabs the MSB. I've tried the code (unchanged) with a DS1822 and it works just fine! It seems that a shift of more than 7 bits will push bits into oblivion, therefore the code, as written, should not work.

    Clearly I'm missing something quite simple! If someone can steer me back on track, I'd greatly appreciate it!

    Thanks,

    Michael
    K6MLE
Sign In or Register to comment.