Temperature sensor DS 18B20

Advert

Temperature sensor DS 18B20

Home Forums Electronics in the Workshop Temperature sensor DS 18B20

Viewing 5 posts - 26 through 30 (of 30 total)
  • Author
    Posts
  • #627535
    David Jupp
    Participant
      @davidjupp51506

      I found this article which covers many aspects of getting reliable one-wire communication – not sure how many of the points covered are relevant to the OP's application.

      Advert
      #627541
      Speedy Builder5
      Participant
        @speedybuilder5

        just as an update, something is making the Arduino re-boot (I think). The field xxx is just a record counter and would range from 1 to 720 for this sample (number of days per month x 24).

        Time is taken from the RTC using the function rtc.now() and now.hour(). The record counter is reset on change of the month where a new file is written to the memory card and the record count is re-set back to 1. The only other time it is re-set back to 1 is when the program starts.

        I am now inclined to be thinking about the power supply and noise ??

        DDHh,xxx,YYYYMMDD,Hh,,t1,t2

        2007,348,20220920,07,,7,17,
        2008,349,20220920,08,,8,16,
        2009,350,20220920,09,,8,16,
        2010,351,20220920,10,,12,16,
        2011,352,20220920,11,,16,16, This is the record for 20/09/2022 at 11:00. Record counter should be 480 + 11
        2011,1,20220920,11,,16,38, False
        2011,1,20220920,11,,16,37, False
        2012,2,20220920,12,,20,16,
        2013,3,20220920,13,,23,16,
        2014,4,20220920,14,,25,16,

        #627555
        An Other
        Participant
          @another21905

          To Versaboss,

          You guessed it, Hans. I only had 4-wire telephone cable available, so I simply used 2 wires as ground, one as +5v and one as the signal connection. If I remember correctly, the cable had White, Brown, Green and Yellow wires, so I used Brown for +5v, White for signal and Green and Yellow as ground – I mention this, because I didn't even check for twisted pairs, I was more interested in getting it working. I never did try it in 2-wire 'parasitic' mode, so I don't know if you can use 2-wire telephone cable for that. Incidentally, not a good thing to do, but the DS18B20 seems very robust – I managed to connect it incorrectly a couple of times but apparently did no damage.

          I did try parasitic mode with a short length of co-axial cable (from an old microphone), and it also would not work – which is partly why I dropped the idea of using parasitic mode.

          Referring to my earlier post, about getting it to work with a 25 metre length of cable – I had a 25 metre telephone extension cable (I sort of hoard stuff!), and I simply cut the connectors off it, and used that, because it was available. Its possible that it would work over a longer distance, but I never got that far.

          I was using the waterproof version of the sensor, like a metal slug with a cable attached, not the 'separate' integrated chip version, but the connections are the same.

          edited to add chip version used.

          Edited By An Other on 04/01/2023 14:45:57

          #627557
          SillyOldDuffer
          Moderator
            @sillyoldduffer
            Posted by Speedy Builder5 on 04/01/2023 12:19:06:

            just as an update, something is making the Arduino re-boot (I think). …

            I am now inclined to be thinking about the power supply and noise ??

            2011,352,20220920,11,,16,16, This is the record for 20/09/2022 at 11:00. Record counter should be 480 + 11

            I still think this is more likely to be software than PSU and noise, though they are both possibilities.

            Resetting the CPU coupled with data corruption is characteristic of a buffer overrun, incorrect pointer, or stack overflow. They're difficult to spot because the logic of the program is OK, but the machine malfunctions due to a timing or memory allocation issue. The cause is usually obvious once identified, but tricky to see in the first place.

            Happy to look at the code if Speedy is comfy with sharing it. PM me if the offer is useful.

            Dave

            #627558
            Speedy Builder5
            Participant
              @speedybuilder5

              Dave – PM sent

              Bob

            Viewing 5 posts - 26 through 30 (of 30 total)
            • Please log in to reply to this topic. Registering is free and easy using the links on the menu at the top of this page.

            Advert

            Latest Replies

            Viewing 25 topics - 1 through 25 (of 25 total)
            Viewing 25 topics - 1 through 25 (of 25 total)

            View full reply list.

            Advert

            Newsletter Sign-up