Shop OBEX P1 Docs P2 Docs Learn Events
temperature sensor — Parallax Forums

temperature sensor

mmorelandmmoreland Posts: 89
edited 2012-01-16 21:29 in General Discussion
I'd like to build a device that measures and records temperatures in a number of places in a heat pump system. I have a number of DS18S20 sensors, and wonder if there is a sample schematic that I could use to begin building the electronics. If there is a better sensor, I don't need to use the DS18S20s; it's just that I already have a bunch of them, but I'm open to suggestions. I have a couple BS2s, but I'm not sure they will work with those sensors. Ultimately the controller will measure and compare temperatures and turn on and off circulators, but I'm just beginning the project.

Comments

  • $WMc%$WMc% Posts: 1,884
    edited 2012-01-13 18:23
    mmoreland
    '
    Take a look at the BS2pxx for the one wire commands
    '
    here's the data sheet
    '
    http://datasheets.maxim-ic.com/en/ds/DS18S20.pdf
  • kwinnkwinn Posts: 8,697
    edited 2012-01-13 18:24
    Not really much in the way of electronics required. They require only 3 connections - Ground, Power, and data. It communicates with the micro over the 1 wire bus. Multiple DS18S20's can co-exist on a single pin. All the required information is in the data sheet.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2012-01-13 21:10
    If the BS2 can't do everything you want to do, the Propeller chip is well equipped to work with these types of 1-wire sensors. But I would use JonnyMac's 1-wire object instead of other options available on the Propeller OBEX:

    http://forums.parallax.com/showthread.php?136782-There-is-something-wrong-with-Micah-Dowty-s-1-Wire-object-in-the-Obex.&p=1060896&viewfull=1#post1060896

    I have some other code posted on that same thread, but it's all built upon JonnyMac's better work. I know that JonnyMac's code works with both DS1822 and DS18B20. I'm guessing it also works with the DS18S20, but perhaps some slight modification might be necessary.
  • mmorelandmmoreland Posts: 89
    edited 2012-01-14 09:43
    Thanks, ElectricAye, but this looks to be far beyond my present abilities. I'll try reading the data sheets and spend a little more time in the books.
  • Tracy AllenTracy Allen Posts: 6,667
    edited 2012-01-14 10:52
    To use one-wire with the BASIC Stamp, you need one of the 'p series Stamps. BS2p, BS2pe or BS2px. They have a OWIN and OWOUT commands that make it relatively easy. There are other sensors you could use, but the nice thing about the OW sensors is that they can be strung out along one wire like Christmas tree lights. No need for separate wires to each sensor. There are however distance constraints, that people are always blissfully ignoring.

    The Stamp manual has descriptions of the commands and a summary of the OW protocol, which waxes rather technical. However, there is demo code there specifically for reading temperatures from the DS1820. Hmmm. The text says DS1820, but it looks like the demo code is actually for the DS1822. The difference is 8 bit (DS1820 and DS18S20) vs 12 bit (DS18B20 and DS1822) resolution. No matter. If you want to pursue it, there is code available you can use. The DS18S20 is the higher accuracy version of the 8-bit+sign DS1820. The nomenclature can be confusing!
  • mmorelandmmoreland Posts: 89
    edited 2012-01-16 21:29
    In the demo code near the end where the conversion to F is being finished, it states "IF (tsign) THEN tempF = 32 - tempF". Should the statement inside the parentheses be (tsign = 1), or what am I missing? In my manual, it clearly states that the demo code is for a DS1822 instead of DS1820, but won't the demo code work with either sensor?
Sign In or Register to comment.