Does enabling i2c cause the processor not to sleep?


In the documentation it states that using certain peripherals such as the Uart or PWM will cause the CPU to always be awake. Does the same apply to i2c? If so, what is the best practice for low battery consumption? Is there ever a reason to call .end() and then .begin() the next time you want to query a sensor for data?


It’s generally good practice to shut down any peripheral when not in use. I2C doesn’t draw a lot of current, and it also doesn’t force the 16MHz clock to run, which UART and PWM do. That is a major current draw, about 1mA, so shutting those off is most important.

So keeping I2C off is a good idea, but it isn’t nearly as much of a current draw as the ones listed in the tutorial.