Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    DS1820 issues with prototype board

    Scheduled Pinned Locked Moved GPy
    8 Posts 5 Posters 254 Views 5 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Don-iotD Offline
      Don-iot
      last edited by

      Hi,

      I have some issues with DS1820 sensor. We are using the GPY on our own prototype board with a lot of other sensors. This was the first sensor we tested and it was successful. Now when going back to the final testing everything rocks and works, but the DS1820 sensor is no success story. The value of the sensor is around +0.125 degrees or minus 2 C. Tried various sensors, and various board iterrations (of our own design) but the problem remains. The wiring for that part is as follows.

      My suspicions are that

      a) we should feed the sensor with 5 V and not 3V3
      b) the 3V3 and ground wires are shared with other sensors. However even with everything removed from the board, we get the same data reading
      c) I have not wired everything correctly

      Any advice and suggestions welcome. We ran a test with the same basic setup for a few months with huge success, so this one is bothering me. However on that test we just realised that we had the resistor between ground and data PIN instead, it worked perfectly though. Has anyone else tested this with success? The wiring is as follows:

      ds1820.png

      robert-hhR A 2 Replies Last reply Reply Quote 0
      • robert-hhR Offline
        robert-hh @Don-iot
        last edited by robert-hh

        @Don-iot Did you have a look at the signals on the data line with an oscilloscope, whether they look properly?
        3.3V is fine for the DS18B20.

        Don-iotD 1 Reply Last reply Reply Quote 1
        • Don-iotD Offline
          Don-iot @robert-hh
          last edited by

          @robert-hh Thanks. After further investigation it seems like output current of 3V3 is not enough to supply all sensors on the board or the chinese prototype circuit board is just so thin that it is limiting the current. We moved the 5V to be supplied the battery directly and now it works, so clearly hardware related.

          1 Reply Last reply Reply Quote 0
          • A Offline
            andreas
            last edited by

            Dear @Don-iot,

            we had many troubles with 1-Wire and reading the DS18B20 sensors by using the pure-Python driver included with Pycom [1], so we finally unlocked the native C-level driver coming from Genuine MicroPython through [2].

            So, as soon as you got everything right on the electrical aspects, you might want to use one of our custom builds available from [3,4] in order to use the improved driver.

            @robert-hh was so kind to adapt a version of the pure-Python driver [5] to be API-compatible with the Python interface of the native one [6].

            With kind regards,
            Andreas.

            [1] https://community.hiveeyes.org/t/untersuchung-und-verbesserung-des-timings-bei-der-ansteuerung-der-ds18b20-sensoren-unter-micropython/2309
            [2] https://github.com/pycom/pycom-micropython-sigfox/pull/356
            [3] https://community.hiveeyes.org/t/squirrel-firmware-for-pycom-esp32/2960
            [4] https://packages.hiveeyes.org/hiveeyes/foss/pycom/
            [5] https://github.com/robert-hh/Onewire_DS18X20
            [6] https://github.com/micropython/micropython/tree/master/drivers/onewire

            Don-iotD 1 Reply Last reply Reply Quote 0
            • Don-iotD Offline
              Don-iot @andreas
              last edited by

              Thanks a bunch @andreas we will defintely take a look and evaluate!

              ShanevanJS 1 Reply Last reply Reply Quote 0
              • ShanevanJS Offline
                ShanevanJ @Don-iot
                last edited by

                @Don-iot Another alternative to make it rock solid - is to use the DS2482-100
                Single-Channel 1-Wire Master.

                Design | Develop | Deploy

                1 Reply Last reply Reply Quote 1
                • A Offline
                  agotsis @Don-iot
                  last edited by

                  @Don-iot We have been using the OneWire library from Pycom's Github repository (https://github.com/pycom/pycom-libraries/blob/master/examples/DS18X20/onewire.py) without any problem for a long-time both with LoPy4 and GPy.
                  As far as the circuit implementation we use a pull-up resistor, i.e. put the 4.7k resistor between VCC and DATA pins. For VCCwe even don't use the 3V3 rail, but a GPIO pin (P8), which we set to HIGH just before getting the measurement and for DATA we use pin P10.
                  So something like this (assuming you have also loaded the OneWire module):

                  import machine
                  from machine import Pin
                  import utime
                  
                  VCC_PIN  = 'P8'
                  DATA_PIN = 'P10'
                  
                  # enable supply to sensor
                  tpin=Pin(VCC_PIN,Pin.OUT)
                  tpin.value(1)
                  
                  # initialize DS18X20
                  ow = OneWire(machine.Pin(DATA_PIN))
                  tempObj = DS18X20(ow)
                  
                  # sensor reading
                  tempObj.start_conversion()
                  utime.sleep(1)
                  temp = tempObj.read_temp_async()
                  
                  # disable supply to sensor
                  tpin.value(0)
                  
                  Don-iotD 1 Reply Last reply Reply Quote 2
                  • Don-iotD Offline
                    Don-iot @agotsis
                    last edited by

                    @agotsis Thanks, that one was smart and also, I guess, power optimised. Will try that!

                    1 Reply Last reply Reply Quote 1

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better 💗

                    Register Login
                    • 1 / 1
                    • First post
                      Last post

                    Pycom on Twitter

                    Pycom