I hope someone can illuminate me on some questions I can't find an answer for...
My project is composed of two barebone/breadboard atmega328p (using internal oscillator at 8mhz):
The main one is connected to sensors and a wireless antenna (HS-12 UART for long distances) to transmit data to a central unit. This one is powered by a step-up/down Pololu S7V8A set to about 3.3v output.
The second one is used to control the step-up/down converter enable pin, date and time (DS3231 - ZS-042) and battery charge. This is asleep most of the time (600 sec), but when it wakes up and power up the main one, I need it to communicate to the main 328p some (little) data and vice versa.
Everything is powered with a Panasonic 3.7v 3400mAh 18650 lithium battery (Model: NCR18650B).
The idea is to power up the main 328p, let it power up, read data and transmit to the central unit. When it finished, notify the second 328p that it can cut the power. The second 328p turns off the step-up/down, set an alarm to DS3231 and power itself down waiting for the next interrupt. Like this I have very little current used when in power down mode (estimated to be about 0.2mA).
The questions are:
What is the best method to establish a communication between the two 328p? I was thinking about using UART, but as per datasheet, the input voltage on any PIN can't exceed Vcc + 0.5 (page 365) and since one is operating at 3.3v and the other one can operate between (ideally) 4.2v and 2.8v isn't it a bit of a risk?
I can modify the project to use only one 328p, but is it safe (and stable) to have 328p operating between 4.2v and 2.8v (depending on battery charge) and sensors fixed to 3.3v thanks to step-up/down? I think some problem may occur when Vcc to 328p is below 3.3v.
Some additional info: - The Pololu S7V8A has an enable PIN that if driven low, will electrical disconnect the Vout. - I need to have the device running for at least 3-4 months with one 18650 (if possible). - For now, sensors are just a DS18B20 and a DHT22. In future I'll add "analog" sensors like rain detector and soil moisture.
Let me know if other information are needed!
Thanks a lot in advance!