gPY ADC consumes 50mA current??
-
[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=1for 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)
-
@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?
-
@tanmay07
No nothing yet, that is a very advanced and specialised topic. The example I linked to is the best help.
-
@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 ???
-
@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
-
@jmarcelino said in gPY ADC consumes 50mA current??:
ng ULP as
Can I compile this ULP program into the Gpy chip through ATOM?
-
@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