Close

Battery consumption optimization

A project log for Street-racing silencer

Silence those annoying noisy street-racers with a push of a button

traxtrax 06/27/2022 at 08:450 Comments

Even though I implemented everything in such a way so that ATmega328P is sleeping whenever it is not doing anything special, I forgot to put nRF24L01 to sleep as well. This resulted in constant current consumption of ~17mA which drained the battery from 4.2V to 4.0V over night.

The original idea was to wake-up the ATmega328P whenever nRF24L01 receives a valid packet via it's IRQ pin but this needed more work.

Now I implemented a mechanism where the device is in sleep mode, including the nRF24L01 for a predefined time-slot (4 seconds) after which the nRF24L01 is set to RX mode (listening for RF packet) for 1 second. In case it doesn't receive anything within that 1 second it goes back to sleep for next 4 seconds and so on. During that 1 second listening time, ATmega328P is actually sleeping - it will be woken up by the IRQ in case something is received.

This all means that the device is unavailable for 4 seconds maximum, which is just fine.

After the device is "woken up" it will remain in constant listening mode for 2 minutes. On every received valid command this time is reloaded for next 2 minutes. In case nothing is received it will go back to usual sleep mode (4 seconds sleep / 1 second listen).

Discussions