Sleep mode

General discussion about topics related to OpenMV.
ngattuso
Posts: 42
Joined: Thu Dec 27, 2018 8:29 pm

Sleep mode

Postby ngattuso » Sat Jan 12, 2019 4:50 pm

Hello,

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,
Nicholas
User avatar
iabdalkader
Posts: 732
Joined: Sun May 24, 2015 3:53 pm

Re: Sleep mode

Postby iabdalkader » Sat Jan 12, 2019 7:22 pm

ngattuso wrote:
Sat Jan 12, 2019 4:50 pm
Hello,

- 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,
Nicholas
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.
ngattuso
Posts: 42
Joined: Thu Dec 27, 2018 8:29 pm

Re: Sleep mode

Postby ngattuso » Sun Jan 13, 2019 4:21 pm

Hello,

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,
Nicholas
User avatar
kwagyeman
Posts: 2895
Joined: Sun May 24, 2015 2:10 pm

Re: Sleep mode

Postby kwagyeman » Sun Jan 13, 2019 5:28 pm

Yeah, you can sleep the camera too.
Nyamekye,
User avatar
iabdalkader
Posts: 732
Joined: Sun May 24, 2015 3:53 pm

Re: Sleep mode

Postby iabdalkader » Sun Jan 13, 2019 7:17 pm

ngattuso wrote:
Sun Jan 13, 2019 4:21 pm
Is there an advantage in keeping the camera on while the board is on sleep?
It takes some time to wake up the sensor (a few 100 milliseconds) and for the sensor auto functions to settle.
ngattuso
Posts: 42
Joined: Thu Dec 27, 2018 8:29 pm

Re: Sleep mode

Postby ngattuso » Wed Jan 30, 2019 8:34 pm

Great! Thank you for your response!

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 3 guests