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

    Onewire DS18B20P

    Scheduled Pinned Locked Moved Guides
    tutorial onewir
    1 Posts 1 Posters 1.1k Views 1 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.
    • F Offline
      federico
      last edited by

      Wiring WiPy ver. 2.0 with DS18B20P

      1 - # DS18B20P data line connected to WiPy pin P10

      * DS18B20P - parasite mode wiring

      A - # * DS18B20P GND pin connected to DS18B20P Vin pin
      2 - # * DS18B20P GND pin connected to WiPy GND

      B - # * in series to DS18B20P/WiPy data line connection point
      3 - # * mount an 1 Kohm resistor that will be connected to WiPy 3V3

      In micropython example code I have divided by 100
      the reading value to obtain the right temperature value

               print(temp.read_temp_async()/100) # added /100
      

      ** see the attachment : WiPi2_DS18B20P_readings.jpg
      If I am right the tutorial example must be upgraded

      from :

      https://docs.pycom.io/pycom_esp32/pycom_esp32/tutorial/includes/onewire.html?highlight=onewire

      One-wire driver

      This tutorial explains how to connect and read data from a DS18x20 temperature sensor.

      Basic usage

      import time
      from machine import Pin
      from onewire import DS18X20
      from onewire import OneWire

      #DS18B20 data line connected to pin P10
      ow = OneWire(Pin('P10'))
      temp = DS18X20(ow)

      while True:
      print(temp.read_temp_async()/100) # added /100 to have Celsius degrees
      time.sleep(1)
      temp.start_convertion()
      time.sleep(1)

      1 Reply Last reply Reply Quote 0

      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