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

Reply To: Mayfly SCL and SDA voltage level

Home Forums Mayfly Data Logger Mayfly SCL and SDA voltage level Reply To: Mayfly SCL and SDA voltage level

#14454
Matt Barney
Participant

    I’m not an expert, but based on the Mayfly schematic (see pins 19 and 20 on the ATMega1284P, upper left), it looks like SDA and SCL are pulled high via external resistors on the board, so there is no way to disable them in code.

    Reading a tutorial at Adafruit, it looks like that is an inherent part of the design of the I2C protocol:

    The I2C clock and data lines need pull-up resistors to prevent from floating to random values. Since many different devices can share these lines the I2C protocol requires that each device ‘give up’ or stop driving the lines when not in use. If no device is driving the lines then the pull-up resistors ensure they go up to a high logic level instead of floating at random values.

    Matt