Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    I2C lines through Pytrack headers drawing current.

    Scheduled Pinned Locked Moved Expansion Board
    8 Posts 4 Posters 471 Views 4 Watching
    Loading More Posts
    • 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.
    • J Offline
      joelmarini
      last edited by

      I am using an external accelerometer running i2c on p10 and p11 of the pytrack external headers. I am experiencing a larger current draw from the accelerometer when my lopy4 is in deep sleep. I have found that the LoPy is drawing current back through the I2C lines when the lopy enters deep sleep. Is there a way to set the pins so that they wont draw current (fix them at 3.3v?) or something i can do electrically with the I2C line to stop this from happening?

      This is for an ultra low power operation so every uA counts

      Cheers

      robert-hhR J 2 Replies Last reply Reply Quote 0
      • robert-hhR Offline
        robert-hh @joelmarini
        last edited by

        @joelmarini Is it that
        a) the external accelerometer is powered during deep sleep? And
        b) at which side are the pull-up resistors located? LoPy or external sensor.

        J 1 Reply Last reply Reply Quote 0
        • J Offline
          joelmarini @robert-hh
          last edited by

          @robert-hh
          Yes the Accelerometer is powered during deep sleep, both VDD and OI_VDD are attached to the external power source on the pytrack. The Pull Up resistors are located in the evaluation board for the accelerometer, shown in the image below. I have attached some photos for reference, one is the circuitry for the evaluation board and the schematic for the diode in the eval board. The unwanted current is running from the accelerometer back into the two I2C pins of the LoPy4. I can confirm that the source of the current is IO_VDD just not sure why. I presume the issue is with the circuit, which isnt really a pycom issue. If anyone has any ideas about possible pin configurations with .hold() or if this needs to be resolved electrically.
          Eval Board Schematic.jpg Diode Schematic.JPG

          robert-hhR 2 Replies Last reply Reply Quote 0
          • robert-hhR Offline
            robert-hh @joelmarini
            last edited by

            @joelmarini You could try to de-init I2C and set the SDA and SCL pins to Input mode, before going to sleep. But I have doubts that this will work. I assume that the current flows through the ESD diodes of the GPIO pins into the ESP32 Vcc. You could test by measuring the voltage on SDA and SCL in deepsleep. If it is the diode, it should be around 0.7 V. The go_to_sleep() deep-sleep of the Pytrack board switches the ESP32 completely off. Machine.deepsleep() is different. It keeps the ESP32 powered, but the current consumption is much higher in this mode.

            1 Reply Last reply Reply Quote 1
            • robert-hhR Offline
              robert-hh @joelmarini
              last edited by

              @joelmarini Addtional note: Using a level shifter with the TXB0104 chip may be an option, even if you do not need that for level shifting. If I understand the data sheet right, the off state current (one side w/o power) is about 1 µA. I faintly recall to have such a unit here, but a trip through my drawers did not reveal it.

              J 1 Reply Last reply Reply Quote 1
              • J Offline
                joelmarini @robert-hh
                last edited by

                @robert-hh
                Thanks heaps Robert, ill try setting the pins as inputs and see if that gets me anywhere, if not then I might have to just have to look into some other options.
                I will let you know how the input option goes.

                Thanks again for the help.

                1 Reply Last reply Reply Quote 0
                • K Offline
                  KenM
                  last edited by

                  How much current did the I2C lines take in deepsleep?
                  And in which mode was the ULP processor?
                  I will try the same test with lopy4 on extension board with extra 4k7 pull-ups, I will do tests soon.

                  There isn't much documentation on I2C and the ULP.

                  1 Reply Last reply Reply Quote 0
                  • J Offline
                    jcaron @joelmarini
                    last edited by

                    @joelmarini I hadn't seen this discussion back then... What type of deep sleep are you using? The "native" machine.deepsleep or the Pytrack-controlled deep_sleep (go_to_sleep)?

                    Did you find a solution for your problem?

                    1 Reply Last reply Reply Quote 0

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better 💗

                    Register Login
                    • 1 / 1
                    • First post
                      Last post

                    Pycom on Twitter

                    Pycom