Sleep mode


I would like to put my openMV in sleep mode when there’s no object in its view for a while and wake it up once a new object enters the view. I, however, am not too sure what the sleep functions end up doing and which is the best way to go about it. The following are my concerns/questions:

**- I notice that there’s pyb.stop and sensor.sleep. If I only do pyb.stop, then does that leave the camera on with the ability to process images still? If so, using Frame Differencing, can I wake up the hardware from pyb.stop when an object is detected? Or, is the wakeup strictly with an external interrupt or RTC?

  • I could use a sensor to detect when an object is added in the system. If I put the camera to sleep using sensor.sleep(true) in addition to the pyb.stop, when the sensor triggers the external interrupt, will it also wake up the camera or do i need to add sensor.sleep(false) in my callback?**

Thank you,

Hi, the image sensor doesn’t do any image processing on its own, and the camera can’t process images while in sleep or low-power mode. The only way to wake up from sleep/low-power modes is with an interrupt (RTC, I/O, Systick etc…). The sensor.sleep() function just shuts down the sensor to save more power. I would just check once every few frames and then sleep for a while.


Thanks for the response!

So generally, if I do pyb.stop, I should just do sensor.sleep(True) as well? Because if I don’t, the camera will just be on but can’t process any images. Is there an advantage in keeping the camera on while the board is on sleep?

I’ll try it with an external interrupt because waking it up every x time could cause an issue with not processing a new object as soon as it arrives.

Thank you,

Yeah, you can sleep the camera too.

It takes some time to wake up the sensor (a few 100 milliseconds) and for the sensor auto functions to settle.

Great! Thank you for your response!

Hi there, I have follow-up questions:
When the main board is off (pyb.stop) and additionally the camera (sensor.sleep) is off:

  • is this the “deep sleep” mode I found in the examples?
  • what is the power consumption for both use cases?
  • Is any of these the “idle” power consumption figure of 140 mA @3.3V that is mentioned on the product page?
1 Like