orgua / OneWireHub

OneWire slave device emulator
GNU General Public License v3.0
343 stars 86 forks source link

Instability when connected with several real slaves #127

Closed kbfifi closed 1 year ago

kbfifi commented 1 year ago
          what you observed is normal behaviour for MCUs. Every digital pin can source or drain a certain amount of current. The 328p is between 20 to 25mA per Pin, enough to power itself. While "booting" / coming out of reset-state the Pin-State is probably undefined, so it can pull down or up. It is also possible to be in high-impedance-mode. You should try to work with the analogue-pins! And depending on your Pull-up a simple series resistor in front of the MCU-Dataline-Input could be enough to stop it from getting to much current. The MAX9940 is total overkill for that.

Originally posted by @orgua in https://github.com/orgua/OneWireHub/issues/58#issuecomment-406996092

kbfifi commented 1 year ago

Thank you for a great library. Very well done. Nice architecture! I like to chime into this discussion. I think I have a slighly different issue but related to your comment. In short I created a DS1992 device based on this library. Works well with a dedicted master and only my Arduino Uno connected to pin 2 with the 1-wire bus master. Howeber when I moved my project to the target enviroment with several slaves I see that it disturbed the bus and almost all slaves disappear when using owdir.

Some questions related to this discussion:

  1. So you mentioned that an analog pin should be used. Would that provide extra high impedance? To be clear my project is always powered on so no power snooping issue here.
  2. You also mentioned a resistor in series What value?
  3. I read something about presence signal not being send by this library? Can that be the issue here?

Thanks in advance!

kbfifi commented 1 year ago

Got everything working. To answer my own questions:

  1. Yes analog pins have much higher impedance compared to digital inputs. However when the arduino pro mini is not powered it it still draws substantial power from the 1-wire bus. Not an issue in my case
  2. Did not work for me. Tried several values (500, 1k, 2k)
  3. Apeared not to be isuue

The real issue was a faulty power supply :-( Cost me 2 Arduino pro minis. Enfin all works now. I'm happy. The bus contains 6 real 18B20's 2 DS1992's based OnwireSlave project and 1 DS1992 based on this project