Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. Dallas18B20 begin causes reset [solved]

Dallas18B20 begin causes reset [solved]

Scheduled Pinned Locked Moved Troubleshooting
4 Posts 3 Posters 1.1k Views 4 Watching
  • 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.
  • mfalkviddM Offline
    mfalkviddM Offline
    mfalkvidd
    Mod
    wrote on last edited by mfalkvidd
    #1

    I have connected a single DS18B20 as described on https://www.mysensors.org/build/temp (including the 4.7kohm pullup)

    When I call sensor.begin, the Pro Mini resets.

    With a before function looking like this I get "proof" that the node dies on begin:

    void before()
    {
      // Startup up the OneWire library
      Serial.println("Calling begin");
      Serial.flush();
      sensors.begin();
      Serial.println("Begin was OK");
      sensors.requestTemperatures();
      Serial.println("request returned");
      Serial.println(sensors.getTempCByIndex(0));
    }
    

    Debug:

    0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
    4 MCO:BGN:BFR
    Calling begin
    0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
    4 MCO:BGN:BFR
    Calling begin
    0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
    4 MCO:BGN:BFR
    Calling begin
    0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
    4 MCO:BGN:BFR
    Calling begin
    0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
    4 MCO:BGN:BFR
    Calling begin
    0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
    
    • I have tried two different DS18B20 sensors. No difference.
    • If I disconnect the data pin, begin returns and all temperature readings return -127.00C, as expected.
    • If I disconnect the GND pin (and re-connect the data pin), begin returns and all temperature readings return -127.00C, as expected.
    • I have tried using the bare DS18B20 library (without MySensors) and get the same result.

    Any idea what could be wrong or what I could do to troubleshoot this?

    1 Reply Last reply
    0
    • R Offline
      R Offline
      robosensor
      wrote on last edited by
      #2

      Try to call Serial.flush(); after each print line, this ensures that all data sent to serial port before next line executed.
      Can you post image with connection wires to DS18B20 sensor? Could the problem be that this chip is a fake?

      mfalkviddM 1 Reply Last reply
      0
      • R robosensor

        Try to call Serial.flush(); after each print line, this ensures that all data sent to serial port before next line executed.
        Can you post image with connection wires to DS18B20 sensor? Could the problem be that this chip is a fake?

        mfalkviddM Offline
        mfalkviddM Offline
        mfalkvidd
        Mod
        wrote on last edited by
        #3

        Thanks @robosensor

        I decided to re-do all wiring to make a clear photo. When I did that I realized that I had connected GND on the DS18B20 to the reset pin on the Pro Mini.

        No wonder the mcu was reset when communication occurred on the onewire bus.

        1 Reply Last reply
        1
        • rejoe2R Offline
          rejoe2R Offline
          rejoe2
          wrote on last edited by
          #4
          This post is deleted!
          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          23

          Online

          11.7k

          Users

          11.2k

          Topics

          113.1k

          Posts


          Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • MySensors
          • OpenHardware.io
          • Categories
          • Recent
          • Tags
          • Popular