Skip to content
  • 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. General Discussion
  3. 3.3v sensors on i2c bus using Pro mini 5v
  • Getting Started
  • Controller
  • Build
  • Hardware
  • Download/API
  • Forum
  • Store

3.3v sensors on i2c bus using Pro mini 5v

Scheduled Pinned Locked Moved General Discussion
7 Posts 3 Posters 1.9k Views 2 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.
  • ร Offline
    ร Offline
    รอเรือ
    wrote on last edited by รอเรือ
    #1

    Hi there!

    I will build a weather station using a Arduino Pro mini 5V but I see now that one of the sensors GY-BME280 can be fed at a maximum of 3.6V.

    I thought I was going to use the 5V version instead of the 3.3V version of Arduino Pro Mini because my weather station will handle a handful of sensors and I thought maybe I was going to need the extra processing power that comes with 16Mhz.

    Anyway, my question is if I should rather go with a 3.3V version of Arduino Pro Mini or if it's possible the use the 5V version without too much trouble. (I don't know how it should be done) Any thoughts on that? (Power consumption is not an issue, I will feed it with regulated 5V on RAW input pin)

    Thanks for helping me choose!

    YveauxY 1 Reply Last reply
    0
    • ร รอเรือ

      Hi there!

      I will build a weather station using a Arduino Pro mini 5V but I see now that one of the sensors GY-BME280 can be fed at a maximum of 3.6V.

      I thought I was going to use the 5V version instead of the 3.3V version of Arduino Pro Mini because my weather station will handle a handful of sensors and I thought maybe I was going to need the extra processing power that comes with 16Mhz.

      Anyway, my question is if I should rather go with a 3.3V version of Arduino Pro Mini or if it's possible the use the 5V version without too much trouble. (I don't know how it should be done) Any thoughts on that? (Power consumption is not an issue, I will feed it with regulated 5V on RAW input pin)

      Thanks for helping me choose!

      YveauxY Offline
      YveauxY Offline
      Yveaux
      Mod
      wrote on last edited by Yveaux
      #2

      @รอเร-อ you could use an i2c level shifter, such as http://s.aliexpress.com/Mb2aEfiU

      It translates the 5v voltage levels of your arduino to the 3v3 of the sensor and vice versa.

      http://yveaux.blogspot.nl

      ร 1 Reply Last reply
      0
      • YveauxY Yveaux

        @รอเร-อ you could use an i2c level shifter, such as http://s.aliexpress.com/Mb2aEfiU

        It translates the 5v voltage levels of your arduino to the 3v3 of the sensor and vice versa.

        ร Offline
        ร Offline
        รอเรือ
        wrote on last edited by
        #3

        @yveaux
        Thanks for your reply. I don't have one of those at home so I think I will go for the 3.3V Arduino to start with. If things are moving to slow I'll consider your solution. Thanks again.

        1 Reply Last reply
        0
        • ร Offline
          ร Offline
          รอเรือ
          wrote on last edited by
          #4

          There is a guy on a different forum suggesting that

          Put pullup resistors on the SDA and SCL lines to 3.3V; the voltage levels will be valid for both 3.3V and 5V devices. Just make sure you don't set those pins on the Arduino as outputs and drive them high, as this could indeed damage the devices powered by 3.3V."

          https://forum.sparkfun.com/viewtopic.php?t=25433#p116548

          He also says that

          I2C is an open-drain bus, which means the devices don't actually drive the lines high (that is achieved with a pull-up resistor). Devices on the bus actively pull the lines low, but not high. As stated, pulling up the lines to 3.3V with a pull-up resistor will still be read as a valid logic “1” by devices powered with 5V.

          Usually you will use an inbuilt I2C module in the microcontroller, which takes most of the hassle out of bit-bashing it. If you do need to bit-bash, you need to be very careful what you do with the registers controlling the pins. You first need to write a logic “0” to the pins used for I2C, and then DO NOT CHANGE IT. To write a logic “1” to a pin, you change the Data Direction Register for that pin to make it an INPUT – the pull-up resistor will then pull the line high. To write a logic “0” to the pin, you change the Data Direction Register for that pin to make it an OUTPUT.

          Hopefully that’s not too confusing…

          What do you guys say about that? Can I write a logic “0” to the pins used for I2C and pull them high with a physical resistor connected to 3.3V or as we say in sweden "Am I out bicycling now?" :grinning:

          zboblamontZ 1 Reply Last reply
          0
          • ร รอเรือ

            There is a guy on a different forum suggesting that

            Put pullup resistors on the SDA and SCL lines to 3.3V; the voltage levels will be valid for both 3.3V and 5V devices. Just make sure you don't set those pins on the Arduino as outputs and drive them high, as this could indeed damage the devices powered by 3.3V."

            https://forum.sparkfun.com/viewtopic.php?t=25433#p116548

            He also says that

            I2C is an open-drain bus, which means the devices don't actually drive the lines high (that is achieved with a pull-up resistor). Devices on the bus actively pull the lines low, but not high. As stated, pulling up the lines to 3.3V with a pull-up resistor will still be read as a valid logic “1” by devices powered with 5V.

            Usually you will use an inbuilt I2C module in the microcontroller, which takes most of the hassle out of bit-bashing it. If you do need to bit-bash, you need to be very careful what you do with the registers controlling the pins. You first need to write a logic “0” to the pins used for I2C, and then DO NOT CHANGE IT. To write a logic “1” to a pin, you change the Data Direction Register for that pin to make it an INPUT – the pull-up resistor will then pull the line high. To write a logic “0” to the pin, you change the Data Direction Register for that pin to make it an OUTPUT.

            Hopefully that’s not too confusing…

            What do you guys say about that? Can I write a logic “0” to the pins used for I2C and pull them high with a physical resistor connected to 3.3V or as we say in sweden "Am I out bicycling now?" :grinning:

            zboblamontZ Offline
            zboblamontZ Offline
            zboblamont
            wrote on last edited by
            #5

            @รอเร-อ I looked at this problem also for a similar 5v/3v scenario, but the I2C voltage requirements for 5v are just outside the technical capability for the 3.3v Arduino (from memory 0.6 or 0.7 Vcc). If you intend running the Arduino on reduced voltage this further shifts the capability.

            Google will find what I am referring to....

            ร 1 Reply Last reply
            0
            • zboblamontZ zboblamont

              @รอเร-อ I looked at this problem also for a similar 5v/3v scenario, but the I2C voltage requirements for 5v are just outside the technical capability for the 3.3v Arduino (from memory 0.6 or 0.7 Vcc). If you intend running the Arduino on reduced voltage this further shifts the capability.

              Google will find what I am referring to....

              ร Offline
              ร Offline
              รอเรือ
              wrote on last edited by รอเรือ
              #6

              @zboblamont said in 3.3v sensors on i2c bus using Pro mini 5v:

              If you intend running the Arduino on reduced voltage this further shifts the capability.

              Thanks. I'm not planning to run my 5V Arduino on reduced voltage. It will be fed with 5V. I'm just looking to connect 3.3V devices to the i2c bus. (Only 3.3V devices)

              zboblamontZ 1 Reply Last reply
              0
              • ร รอเรือ

                @zboblamont said in 3.3v sensors on i2c bus using Pro mini 5v:

                If you intend running the Arduino on reduced voltage this further shifts the capability.

                Thanks. I'm not planning to run my 5V Arduino on reduced voltage. It will be fed with 5V. I'm just looking to connect 3.3V devices to the i2c bus. (Only 3.3V devices)

                zboblamontZ Offline
                zboblamontZ Offline
                zboblamont
                wrote on last edited by zboblamont
                #7

                @รอเร-อ Then I suggest you please re-READ, and as I suggested, Google, as Abraham Lincoln once said, "Never believe absolutely everything you read on the Internet".
                The 5v is irrelevant other than the threshold voltage which registers as a HIGH to it's I2C control.
                The 3v3 as Master dictates the HIGH as a factor of it's VCC on the I2C bus. THAT is the issue.
                As Vcc is never absolutely accurate you may strike lucky on a 3v3, there again you might not, your choice... ;)

                EDIT - To avoid any confusion, what I am referring to here is conventional I2C system. The input HIGH for a 5v is say 0.7 of Vcc, so 3.5v is required on the 5v I2C line to register as a HIGH. Even if a 3.3v Arduino were to put full Vcc on the I2C line it is just below the threshold for the 5v device. That is where the factor I referred to comes in, and I read elsewhere it can be 0.6 but cannot recall which device that referred to. Hopefully that clarifies what I was referring to.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                16

                Online

                11.7k

                Users

                11.2k

                Topics

                113.0k

                Posts


                Copyright 2019 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
                • OpenHardware.io
                • Categories
                • Recent
                • Tags
                • Popular