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

    gPY ADC consumes 50mA current??

    Scheduled Pinned Locked Moved GPy
    pycom adcgpycurrent consump
    7 Posts 2 Posters 1.1k Views 2 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.
    • T Offline
      tanmay07
      last edited by

      [link text](link url)Re: Pycom Gpy ADC pins consumes 250mA ???

      Hi all,

      I am still concerned about Pycom GPY ADC power consumption. Even after deint LTE, BLUETOOTH AND WIFI. It consumes about 50mA of current with just ADC. ps- I have to initialize the LTE,Bluetooth and wifi every-time when the chip starts and then de intialize it as I belive that is how it works.---Correct me if I am wrong.

      Please help me how can I reduce the current to uA when I just doing ADC.

      Below is my simple code:-

      from network import LTE
      from network import WLAN
      from network import Bluetooth
      import machine
      bluetooth = Bluetooth()
      bluetooth.deinit()
      wlan = WLAN(mode=WLAN.STA)
      lte = LTE()
      lte.deinit()
      wlan.deinit()
      machine.idle()
      ppm=0
      w=1

      for w in range(0,100000):#-------------------------------Just reading Pressure start

          adc = machine.ADC()             # create an ADC object
          apin = adc.channel(pin='P16')   # create an analog pin on P16
          val = apin()
      
          value = (val/34)
      
      
          print(value)#-------------------------------------Just reading Pressure stops
      

      machine.deepsleep(12000)

      J 1 Reply Last reply Reply Quote 0
      • J Offline
        jmarcelino @tanmay07
        last edited by

        @tanmay07
        Yes 50mA is a typical current when the just the processor is running (without WiFi, etc.)

        If you need μA level you'll have to code for the ULP, but that's only possible in C calling ULP assembler functions and requires source customisations

        https://esp-idf.readthedocs.io/en/latest/api-guides/ulp.html

        T 1 Reply Last reply Reply Quote 0
        • T Offline
          tanmay07 @jmarcelino
          last edited by

          @jmarcelino said in gPY ADC consumes 50mA current??:

          ng ULP as

          Can I compile this ULP program into the Gpy chip through ATOM?

          J 1 Reply Last reply Reply Quote 0
          • J Offline
            jmarcelino @tanmay07
            last edited by jmarcelino

            @tanmay07
            You can use Atom as a source code editor for sure, but to compile it you'll need the ULP toolchain. See the link I posted below.

            You'll also need to integrate it with the MicroPython source at https://github.com/pycom/pycom-micropython-sigfox, compile that as well and flash the result onto the board, it's not just like Python where you can upload code from Pymakr.

            There is also some ULP ADC example code at https://github.com/espressif/esp-idf/tree/master/examples/system/ulp_adc
            You will still need to integrate it, can't use that example directly with MicroPython

            1 Reply Last reply Reply Quote 0
            • T Offline
              tanmay07
              last edited by

              @tanmay07 said in gPY ADC consumes 50mA current??:

              ng ULP

              Is there any link or video which could explain how to program Pycom chips or ESP32 with ULP ???

              J T 2 Replies Last reply Reply Quote 0
              • J Offline
                jmarcelino @tanmay07
                last edited by

                @tanmay07
                No nothing yet, that is a very advanced and specialised topic. The example I linked to is the best help.

                1 Reply Last reply Reply Quote 0
                • T Offline
                  tanmay07 @tanmay07
                  last edited by

                  @tanmay07 Got it thanks a ton!
                  I was also looking for another scenario where I do not have to use this. Suppose I configure my device to be on a deepsleep it consumes about 25uA current. But I want it to wake up on certain levels of voltage from my sensors on analog pins. Is it possible to do this using:-
                  machine.pin_deepsleep_wakeup(pins, mode, enable_pull)

                  ?? Because I believe this function can only wakeup the decice from deep sleep if the specidied pins goes high or low.This can be used for specific voltage levels on analog pins right?

                  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