Standby consumption

Discussion related to "under the hood" OpenMV topics.
User avatar
chrisPyres66
Posts: 46
Joined: Mon Jul 16, 2018 9:22 am
Location: France

Standby consumption

Postby chrisPyres66 » Wed Aug 29, 2018 6:17 am

Dear all,

I try to use the camera in lowest consumption mode but i cant get under 1.6mA with M7 or 2.5mA with M4.
I measured with a microamps DM3068.

My code is simple :

Code: Select all

import pyb, sensor, cpufreq

cpufreq.set_frequency(cpufreq.CPUFREQ_120MHZ)

sensor.sleep(True)             # Enable sensor sleep mode (saves about 40mA).
pyb.standby()			# Reduces power consumption to less than 50 uA.
I did it by loading the main.py on board without SDCard and USB cable.

Do you have an idea about what i did wrong ?

Thanks,
User avatar
kwagyeman
Posts: 2447
Joined: Sun May 24, 2015 2:10 pm

Re: Standby consumption

Postby kwagyeman » Wed Aug 29, 2018 12:32 pm

Mmm, let me ask Ibrahim.
Nyamekye,
User avatar
iabdalkader
Posts: 624
Joined: Sun May 24, 2015 3:53 pm

Re: Standby consumption

Postby iabdalkader » Thu Aug 30, 2018 9:01 pm

Hi,

The sensor draws about 1mA in standby mode (initiated by sensor.sleep) to keep the SSCB/I2C block powered. To get under 1mA, you need to power down the sensor but the FW doesn't have a function for that yet, I'll add it to the next release.
For now I attached a modified FW image with sensor.sleep pulling PWDN pin high (powering down the sensor), please give it a try and let us know the current consumption.

Not that example is outdated, we use machine module now (pyb.standby() == machine.deepsleep()). Also you don't need to lower the CPU frequency, in standby mode the CPU is shutdown.
Attachments
firmware.zip
(885.86 KiB) Downloaded 13 times
User avatar
chrisPyres66
Posts: 46
Joined: Mon Jul 16, 2018 9:22 am
Location: France

Re: Standby consumption

Postby chrisPyres66 » Mon Sep 03, 2018 5:28 am

Hi,

I loaded this new firmware in a M7 openmv camera without any consumption change.

My code is now :

Code: Select all

import sensor, machine

sensor.sleep(True)      	# Enable sensor sleep mode (saves about 40mA + 1mA).
machine.deepsleep()     	# Reduces power consumption to less than 50 uA
The current is around 1.84mA.

I also tried to directly activate the sensor power down pin in µPython code without succeeding to get a validated code.
I am not sure if the PB5 pin is reachable.

Any idea ?

Thanks,
User avatar
iabdalkader
Posts: 624
Joined: Sun May 24, 2015 3:53 pm

Re: Standby consumption

Postby iabdalkader » Mon Sep 03, 2018 9:37 am

I don't have an accurate meter, mine is limited to 1mA. When I use this firmware the current drops to 0 (so it's less than 1mA). Can you make sure you uploaded the modified fw ? Firmware Version should be 3.1.0
User avatar
chrisPyres66
Posts: 46
Joined: Mon Jul 16, 2018 9:22 am
Location: France

Re: Standby consumption

Postby chrisPyres66 » Tue Sep 04, 2018 5:07 am

I executed the bootloader from OpenMV IDE with the firmware you sended me.
At the bottom right of the OpenMV IDE, i have the firmware version equal to 3.1.0.
The consumption is still more than 1mA (1.6mA).

The code has not changed.

I should get something around 3.4uA for STM32 + 10-20uA for OV7725 + 260-510uA for BD33IA = 275-535uA
As you said there is 1mA for SCCB standby of the camera.

For information, i remaked the current consumption changes after using sensor.sleep():
for example :
  • Consumption after programmation BOOT0/NRST + Firmware 3.1.0 + connection with OpenMv IDE : 105mA
    Consumption during sensor.sleep + machine.deepsleep() : 1.6mA
    Camera is unplugged and replugged
    Consumption after connecting with openMV IDE : 85mA
It looks like the sensor is not started anymore ?
I tried sensor.sleep(False) without success.

Thanks,
User avatar
iabdalkader
Posts: 624
Joined: Sun May 24, 2015 3:53 pm

Re: Standby consumption

Postby iabdalkader » Tue Sep 04, 2018 5:00 pm

Hi,

Try adding this before sensor.sleep(True)

Code: Select all

sensor.__write_reg(0x4F, 0x18)
sensor.sleep(True)
This disables the internal core regulator, I know it doesn't make sense but it seems to work.

Note sensor.sleep pulls PWDN high regardless of the argument (True or False), so you shouldn't use it if you want the sensor working. It's all a hack for now I'll add functions for this in the next release.

I also noticed the power consumption varies (I think it depends on the temperature), so a longer RTC wake up time allows the temp to drop down and the consumption. So here's the full example I'm using, measured ~500uA with this:

Code: Select all

import pyb, machine, sensor

# Create and init RTC object.
rtc = pyb.RTC()

# (year, month, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]])
rtc.datetime((2014, 5, 1, 4, 13, 0, 0, 0))

# Print RTC info.
print(rtc.datetime())

sensor.reset()
# Bypass internal regulator
sensor.__write_reg(0x4F, 0x18)
# Shutdown the sensor.
sensor.sleep(True)

# Enable RTC interrupts every 30 seconds.
# Note the camera will RESET after wakeup from Deepsleep Mode.
rtc.wakeup(30000)

# Enter Deepsleep Mode.
machine.deepsleep()
User avatar
chrisPyres66
Posts: 46
Joined: Mon Jul 16, 2018 9:22 am
Location: France

Re: Standby consumption

Postby chrisPyres66 » Wed Sep 05, 2018 9:35 am

I am sorry, but i have still got 1.6mA...
User avatar
iabdalkader
Posts: 624
Joined: Sun May 24, 2015 3:53 pm

Re: Standby consumption

Postby iabdalkader » Wed Sep 05, 2018 1:48 pm

I'm attaching the latest firmware, there'a sensor.shutdown function now. And this is the script I used:

https://github.com/openmv/openmv/blob/m ... p_sleep.py

I'm not sure why you're getting higher current, I've asked Kwabena to test it as well.
Attachments
img_20180905_172339.jpg
firmware.zip
(886 KiB) Downloaded 14 times
User avatar
kwagyeman
Posts: 2447
Joined: Sun May 24, 2015 2:10 pm

Re: Standby consumption

Postby kwagyeman » Wed Sep 05, 2018 9:42 pm

I get 1.6mA.

Um, given the regulator, camera, and processor this number makes sense. I'll update our documentation about this (is there any?) on these numbers.
Nyamekye,
User avatar
chrisPyres66
Posts: 46
Joined: Mon Jul 16, 2018 9:22 am
Location: France

Re: Standby consumption

Postby chrisPyres66 » Mon Sep 10, 2018 8:54 am

Dear,

I used your last firmware with shutdown function (still with version name to 3.1) and your code :

Code: Select all

# Deep Sleep Mode Example
# This example demonstrates the low-power deep sleep mode plus sensor shutdown.
# Note the camera will reset after wake-up from deep sleep. To find out if the cause of reset
# is deep sleep, call the machine.reset_cause() function and test for machine.DEEPSLEEP_RESET
import pyb, machine, sensor

# Create and init RTC object.
rtc = pyb.RTC()

# (year, month, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]])
rtc.datetime((2014, 5, 1, 4, 13, 0, 0, 0))

# Print RTC info.
print(rtc.datetime())

sensor.reset()
# Optionally bypass the regulator on OV7725
# for the lowest possible power consumption.
if (sensor.get_id() == sensor.OV7725):
    # Bypass internal regulator
    sensor.__write_reg(0x4F, 0x18)

# Enable sensor softsleep
sensor.sleep(True)

# Shutdown the sensor (pulls PWDN high).
sensor.shutdown(True)

# Enable RTC interrupts every 30 seconds.
# Note the camera will RESET after wakeup from Deepsleep Mode.
rtc.wakeup(30000)

# Enter Deepsleep Mode.
machine.deepsleep()
I have got like Kwabena 1.6mA, sorry.

It looks like if the shutdown pin is not connected.
I have got an old camera pcb where there is :
- Openmv R1
- OV7725-M7
- 10/15/2016
marble33
Posts: 3
Joined: Tue Dec 04, 2018 6:19 am
Location: South Korea

Re: Standby consumption

Postby marble33 » Tue Dec 04, 2018 6:28 am

I found that there is no pull resistor on OV7725 PWDN pin.

I see 500uA by adding 4.7K Ohm pull up on OV7725 PWDN ( PCB pattern is covered. so need to scratch off printed ink )

If i replace LDO regulator to high efficient SMPS.
I see 10uA with RTC on by calling machine.deepsleep()

What a great MCU STM32. :D

Maybe next OPENMV should fix this small missing component(pull up resistor).
User avatar
iabdalkader
Posts: 624
Joined: Sun May 24, 2015 3:53 pm

Re: Standby consumption

Postby iabdalkader » Tue Dec 04, 2018 6:58 am

marble33 wrote:
Tue Dec 04, 2018 6:28 am
I found that there is no pull resistor on OV7725 PWDN pin.

I see 500uA by adding 4.7K Ohm pull up on OV7725 PWDN ( PCB pattern is covered. so need to scratch off printed ink )

If i replace LDO regulator to high efficient SMPS.
I see 10uA with RTC on by calling machine.deepsleep()

What a great MCU STM32. :D

Maybe next OPENMV should fix this small missing component(pull up resistor).
Note PWDN already has an internal pull-down.
marble33
Posts: 3
Joined: Tue Dec 04, 2018 6:19 am
Location: South Korea

Re: Standby consumption

Postby marble33 » Tue Dec 04, 2018 12:34 pm

iabdalkader wrote:
Tue Dec 04, 2018 6:58 am
marble33 wrote:
Tue Dec 04, 2018 6:28 am
I found that there is no pull resistor on OV7725 PWDN pin.

I see 500uA by adding 4.7K Ohm pull up on OV7725 PWDN ( PCB pattern is covered. so need to scratch off printed ink )

If i replace LDO regulator to high efficient SMPS.
I see 10uA with RTC on by calling machine.deepsleep()

What a great MCU STM32. :D

Maybe next OPENMV should fix this small missing component(pull up resistor).
Note PWDN already has an internal pull-down.
When STM32 enter deep sleep. Most of IO changed to high impedance state. So OV7725 PWDN pin cannot retain high level(shutdown state). So external pull up resistor is needed. Not internal pull down.
User avatar
iabdalkader
Posts: 624
Joined: Sun May 24, 2015 3:53 pm

Re: Standby consumption

Postby iabdalkader » Tue Dec 04, 2018 1:29 pm

marble33 wrote:
Tue Dec 04, 2018 12:34 pm
When STM32 enter deep sleep. Most of IO changed to high impedance state. So OV7725 PWDN pin cannot retain high level(shutdown state). So external pull up resistor is needed. Not internal pull down.
I think there's a mode that retains I/O state, anyway we could revise it for the next production run. That said, 1.6mA is not very bad :)
User avatar
chrisPyres66
Posts: 46
Joined: Mon Jul 16, 2018 9:22 am
Location: France

Re: Standby consumption

Postby chrisPyres66 » Wed Dec 05, 2018 2:28 am

Thanks for your answer
What kind of high efficient SMPS you use and have you replace the regulator of the M7 camera with it ?
marble33 wrote:
Tue Dec 04, 2018 6:28 am
I found that there is no pull resistor on OV7725 PWDN pin.

I see 500uA by adding 4.7K Ohm pull up on OV7725 PWDN ( PCB pattern is covered. so need to scratch off printed ink )

If i replace LDO regulator to high efficient SMPS.
I see 10uA with RTC on by calling machine.deepsleep()

What a great MCU STM32. :D

Maybe next OPENMV should fix this small missing component(pull up resistor).
marble33
Posts: 3
Joined: Tue Dec 04, 2018 6:19 am
Location: South Korea

Re: Standby consumption

Postby marble33 » Thu Dec 06, 2018 3:38 am

chrisPyres66 wrote:
Wed Dec 05, 2018 2:28 am
Thanks for your answer
What kind of high efficient SMPS you use and have you replace the regulator of the M7 camera with it ?
marble33 wrote:
Tue Dec 04, 2018 6:28 am
I found that there is no pull resistor on OV7725 PWDN pin.

I see 500uA by adding 4.7K Ohm pull up on OV7725 PWDN ( PCB pattern is covered. so need to scratch off printed ink )

If i replace LDO regulator to high efficient SMPS.
I see 10uA with RTC on by calling machine.deepsleep()

What a great MCU STM32. :D

Maybe next OPENMV should fix this small missing component(pull up resistor).
Texas Instruments TPS62745 Dual-cell Ultra Low IQ Step Down Converter for Low Power Wireless
Applications is enough.
But any Low IQ converter is possible.

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 4 guests