There are a few issues however:
- I would very much like to only use one switch, instead of a switch and separate pushbutton. However using this configuration the ATTiny85 and RaspberryPi (in low power halt state) will always be powered therefore draw power (is this a problem?).
- How do I wake the RaspberryPi from the lower power mode? I've read somewhere that providing a signal to the SCL port can wake the Pi but I have no luck with this myself.
- ATTiny85 has limited flash memory, programming everything in such a small package will be a challenge.
Fritzing Sketch of the proposed setup.
Things I have learnt so far:
It is entirely possible and not that hard to get going with I2C communication between the Pi Zero and ATTiny85 (https://github.com/regnerus/Safe-Shutdo ... controller) however there are some limitations.
- It is possible to turn the Raspberry Pi in to a halted state where it consumes little power and power could be completely shutoff using a MOSFET, however using only I2C communication it is not possible to reliably know when the Pi has entered this halted state (for this you need one extra GPIO pin which is high when the Pi is on and low when it is turned off.
- It is not possible to use I2C to turn the Raspberry Pi back on, to achieve this you will need another GPIO pin.
- Although the flash memory will probably not prove to be a limit the amount of pins available on the ATTiny85 will be an issue. Currently looking at alternatives with more pins such as the ATTiny84 or ATTiny167.