Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, an initiative of Stroud Water Research Center designed to help people advance knowledge and stewardship of fresh water.
New to EnviroDIY? Start here

MaximDS18 on I2C Hub

Home Forums Mayfly Data Logger MaximDS18 on I2C Hub

Tagged: , , , ,

Viewing 3 reply threads
  • Author
    • #14027

        How do I get my DS18 to work on an I2C Hub plugged into my I2C Grove port? It’s currently working on Pin 5 and I have the DeviceAddress but when I plug the DS18 into the I2C hub I can’t find a pin that will work.


      • #14029
        Sara Damiano

          If your goal is to have everything on that one 4-port splitter – it won’t work.

          The DS18 isn’t I2C – it’s OneWire.  If you really want to use it on that Grove port, you should be able to use it as either D16(SCL) or D17(SDA), but I strongly suspect that attempting to dual-use one of the I2C pins for OneWire would screw up communication with actual I2C devices (like the build in clock or ADC and your little display).  I’d be surprised if you could even get a sketch to run.  The I2C library (from Arduino core) has a bug (a while loop with no timeout) such that if either pin on the I2C bus is held low during any I2C communication the board will freeze in endless wait.  If you really have your heart set on that connection pattern, you can experiment with it, but I’d just just a different port if I were you.

        • #14030

            Sara, Thank you (sigh of relief of knowing why it wouldn’t work). That was my goal and now I know it shouldn’t be. That is very helpful. No wonder I couldn’t find an example anywhere.

          • #14032
            Anthony Aufdenkampe

              Brian, you can use that DS18 temperature sensor on any of the digital pins (labeled on the Mayfly as: D4, D5, D6, D7, D10, D11), and because it’s OneWire, you can connect many DS18 sensors to a single pin using the I2C Hub (which generically connects multiple Grove connections in parallel). It just won’t work using I2C protocols.

          Viewing 3 reply threads
          • You must be logged in to reply to this topic.