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 :
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.
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. firmware.zip (886 KB)
I loaded this new firmware in a M7 openmv camera without any consumption change.
My code is now :
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.
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
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.
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:
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()
I used your last firmware with shutdown function (still with version name to 3.1) and your code :
# 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 :
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.
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.