Please help with code for DS18B20


Closed Thread
Results 1 to 40 of 110

Hybrid View

  1. #1
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default

    Based on the book mentioned at post #21, I re-write the code for this project. I implement a new procedure for initializing the sensors. The results are verry good. Want somebody to improve this ? I wish You all the best !
    Thanks again for Your support !
    Attached Files Attached Files

  2. #2
    Join Date
    Mar 2006
    Location
    Hyderabad (India)
    Posts
    123


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by fratello View Post
    Based on the book mentioned at post #21, I re-write the code for this project. I implement a new procedure for initializing the sensors. The results are verry good. Want somebody to improve this ? I wish You all the best !
    Thanks again for Your support !
    @Fratello,
    is your latest software working in the range 0 to 100 deg Celsius at least?
    When I tried for that and with one sensor, it shows -0.06 Celsius. and the sensor would not respond for variation
    We have presently temperatures around 33.5 Celsius, as we entered summer season in India.
    Last edited by mvs_sarma; - 3rd April 2009 at 17:17.
    Regards,
    Sarma

  3. #3
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default

    The code is ok ! Check the DS18B20 serials numbers ! I don't know if the thermostat work with just one sensor ! Good luck !

  4. #4
    Join Date
    Mar 2006
    Location
    Hyderabad (India)
    Posts
    123


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by fratello View Post
    The code is ok ! Check the DS18B20 serials numbers ! I don't know if the thermostat work with just one sensor ! Good luck !
    as long as a working project of elektor is modded by adding another sensor, it should work for a single sensor also. I have just disabled all lines pertaining to sensor2.
    I am asking for practical test result, not the program being OK as per our assumption, please. whether you are able to read temperature like normal room and and a piece of ice ? with one of the sensors, with other sensor reading just room temp?
    Regards,
    Sarma

  5. #5
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default

    In my test I measure :
    - MINUS 15.20 ' C in the refrigerator
    - PLUS 24.15 ' C in the room.
    With one sensor and with two sensor too.

  6. #6
    Join Date
    Mar 2006
    Location
    Hyderabad (India)
    Posts
    123


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by fratello View Post
    In my test I measure :
    - MINUS 15.20 ' C in the refrigerator
    - PLUS 24.15 ' C in the room.
    With one sensor and with two sensor too.
    Can you upload the .bas file that you have used please !!
    Regards,
    Sarma

  7. #7
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default

    See post #35. Renamethe file .txt as .bas.

  8. #8
    Join Date
    Mar 2006
    Location
    Hyderabad (India)
    Posts
    123


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by fratello View Post
    In my test I measure :
    - MINUS 15.20 ' C in the refrigerator
    - PLUS 24.15 ' C in the room.
    With one sensor and with two sensor too.
    Thanks Fratello !!
    Regards,
    Sarma

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


    Did you find this post helpful? Yes | No

    Default

    When I tried for that and with one sensor, it shows -0.06 Celsius. and the sensor would not respond for variation
    Some ( wrong ! ) values have a typical meaning :

    0.06 as a "measure " shows a connecting ( or sensor ) problem ... Check your DQ line ...
    85 shows conversion not completed ...

    Alain
    ************************************************** ***********************
    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 " !!!
    *****************************************

  10. #10
    Join Date
    Mar 2006
    Location
    Hyderabad (India)
    Posts
    123


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Some ( wrong ! ) values have a typical meaning :

    0.06 as a "measure " shows a connecting ( or sensor ) problem ... Check your DQ line ...
    85 shows conversion not completed ...

    Alain
    Fratello's code has definite mistakes, and need attention. With the mistakes How it was working for him is a wonder.The suspected line numbers, i shall be indicating for consideration / possible correction.

    I suspect that the code posted by him at #35 is not what he might be using.
    Regards,
    Sarma

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


    Did you find this post helpful? Yes | No

    Default ???

    Hi, Sarma

    What are you talking about ???

    Fratello's code can of course bear some little improvements but WORKS FINE !!!

    ( I just translated it to a 16F877A aboard an Easy Pic 5 ... and it's nice.)

    Alain

    PS: do not tell me you are waiting for custom code or you do not have something personnal working since the 8th of April ... please ...
    ************************************************** ***********************
    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 " !!!
    *****************************************

Similar Threads

  1. Reading in Manchester code
    By brid0030 in forum Code Examples
    Replies: 0
    Last Post: - 10th March 2009, 21:55
  2. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  3. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  5. Re-Writing IF-THEN-AND-ENDIF code?
    By jessey in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 18th August 2006, 17:23

Members who have read this thread : 2

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