IPhone: Does the accelerometer accumulate with a quick update (60 Hz)?

I am making an accelerometer-based application using cocos2d and I noticed that you can set the accelerometer update interval.

[[UIAccelerometer sharedAccelerometer] setUpdateInterval: (1.0f / 60.0f)]; 

Is updating the accelerometer very often (60 times per second) a significant drain on the battery?

+7
objective-c iphone accelerometer
source share
4 answers

According to the LIS302DL data sheet of the accelerometer, it consumes ~ 0.75 mW of energy with a refresh rate of 100 Hz and 0.0025 mW of power when in standby mode (i.e. there is no indication).

So, the short answer is “Yes,” but from my head I can’t put these numbers in perspective to give you an idea of ​​“how many minutes of time” it drains from the battery.

My recommendation is to do some testing. Find the lowest refresh rate that provides satisfactory results.

+9
source share

Given the numbers in the accepted answer, the energy consumption of an actual accelerometer is trivial. Your real success will come from your application, which should process events and, thus, cause the processor to not sleep more often.

The 3GS has a 4.51W battery. Drain only the accelerometer when operating at a frequency of 100 Hz, kill the battery (approximately) for 6000 hours (provided that the value is 0.75 mW)

(In addition, the iPhone 4 has a 5.25 W-hour battery, 4S 5.3 W and 5.45 W, in case you are interested)

+15
source share

From Event Handling Guide for iPhone OS :

When setting the refresh interval for acceleration events, it’s best to choose an interval that minimizes the number of delivered events and meets the needs of your application. Some applications require acceleration events delivered 100 times per second. Using a lower frequency prevents the application from running as often as it can improve battery life.

Accordingly, the more expensive part of the high refresh rate may be the fact that your application should handle each of these accelerometer events, and not idle for a longer period.

Also from the iPhone Programming Guide :

If you use the UIAccelerometer class to receive a normal event accelerometer, disable the delivery of these when they do not need you. Similarly, set the frequency of the delivery event to the lowest value that suits your needs.

+2
source share
+1
source share

All Articles