DS18B20 ID saving To and Reading From EEPROM


Closed Thread
Results 1 to 15 of 15

Hybrid View

  1. #1
    Join Date
    Dec 2010
    Posts
    409


    Did you find this post helpful? Yes | No

    Default Re: DS18B20 ID saving To and Reading From EEPROM

    So suppose I want to make indoor/ outdoor thermometers for all my family and friends as gifts. I'll have 2 DS18B20's on a bus in the design. How do I resolve which is the indoor one and which is the outdoor one?

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,170


    Did you find this post helpful? Yes | No

    Default Re: DS18B20 ID saving To and Reading From EEPROM

    Wouldn't it be obvious to them which temp was which? lol I don't know where your relatives live, but it's real easy to figure out here in Quebec.

    Why burden yourself with labelling the temps? (if that is the reason of the question)

    Robert

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default Re: DS18B20 ID saving To and Reading From EEPROM

    Quote Originally Posted by Charlie View Post
    So suppose I want to make indoor/ outdoor thermometers for all my family and friends as gifts. I'll have 2 DS18B20's on a bus in the design. How do I resolve which is the indoor one and which is the outdoor one?
    I do not see other method than reading the sensors ID and addressing them by their ID ...

    but have to reprogram the chips if you change the sensor

    the clever methods here are...

    1) to use two ports instead of only one !!!

    2) to have a routine that reads ONE sensor ID you have placed alone on the bus and makes it indoor one , then reads the second sensor you place later and make it the outdoor one ...

    and so-on if a sensor change should occur one day.

    3) use a normal sensor for outside and a ghost supply one for inside : it's possible to recognize them by software ...

    Alain
    Last edited by Acetronics2; - 8th December 2013 at 13:37.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  4. #4
    Join Date
    Dec 2010
    Posts
    409


    Did you find this post helpful? Yes | No

    Default Re: DS18B20 ID saving To and Reading From EEPROM

    I put up my hypothetical question because I'm trying understand why you would ever use the whole serial number. If you want to build something that does not require human intervention on every restart, with multiple sensors and with the ability to swap one out if it fails, you can't use the full serial number as the method. So why would you bother to read anything beyond the family code? (other than academic interest)

  5. #5
    Join Date
    Dec 2011
    Posts
    14


    Did you find this post helpful? Yes | No

    Default Re: DS18B20 ID saving To and Reading From EEPROM

    I'm back to try and resolve this. I can not assign each temp sensor (6 of them) a different pin as the motherboard is already produced, I am just trying to improve things a little. So all I need to figure out is how to get an array into the select case:
    I have tried:
    Code:
    SELECT CASE sensor
        CASE 1 :LOOKUP hexbyte,[STR sensor1\8], col
    but that does not work

    In my orginal code I have:
    Code:
    Select Case sensor
            Case 1 :LOOKUP hexbyte,[$28,$1E,$F5,$24,$03,$00,$00,$B8], col
    Lets say the array sensor1\8 is $28,$1E,$F5,$24,$03,$00,$00,$B8
    Hope this makes sense.

  6. #6
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: DS18B20 ID saving To and Reading From EEPROM

    Should lookup have a : before it?

Similar Threads

  1. Reading temperature using multi DS18B20
    By KVLV in forum Code Examples
    Replies: 16
    Last Post: - 3rd November 2017, 19:48
  2. Reading DS18S20 and DS18B20 In Same Program
    By Larryd in forum General
    Replies: 4
    Last Post: - 27th January 2013, 05:57
  3. ds18b20 not reading on 16f676
    By revelator in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd April 2009, 00:20
  4. DS18B20 error reading
    By Gaetano in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 29th August 2007, 16:21
  5. Reading 5 DS18B20 Problem
    By CocaColaKid in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th August 2005, 20:51

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts