I want to power a small project via a small solar cell, and a lithium battery with a boost circuit (from a re-purposed USB solar charger). A 16x2 character LCD consumes just 3mA max if it doesn't have a backlight connected so I'd like to include one. There is also a DS1307 real-time clock module. This will be an ATMega328P standalone, running at 8MHz to further reduce consumption and component count.
For much of the week this project will be in SLEEP_MODE_PWR_DOWN. It can awaken by either a button press, or a number scheduled events which is what the RTC is there for, and my intention is to use the watchdog timer with an 8 sec interval such that it wakes, and based on some multiple of a counter will check if a event should occur every 5 minutes or so, otherwise it will go back to sleep.
I was intending to switch the GND on the RTC and the 1602 LCD using two NPN transistors because most of the time the uC comes back to life neither of those needs to be powered. So far I'm hoping this approach is sound - please let me know if I'm charging toward any newbie blunders.
A couple of questions (presuming the concepts above are sound) :
- I was hoping to drive all the ATMega pins LOW before going to sleep. Will I need to do anything special with the Wire or LiquidCrystal instances? I do not see an end() method in the headers for either library so don't know if there's a clean way to get them to stop and then restart...or is that even necessary?
- The I2C bus has pull-up resistors so should I also be switching that off somehow too?