This is a prototype of my battery powered PIR motion sensor unit that I have on my front porch. It has run for several months on 3 AA batteries. Larry gave me the idea to use the PIR output to drive a MOSFET power switch.

ATMega328 battery powered motion sensor

ATMega328 battery powered motion sensor

The ATMega328 and NRF24 radio are powered up by motion detected by the PIR sensor. In the setup() routine it determines which of the four outdoor sensor locations it has been installed in (front porch, back yard, etc.) by the 2 position DIP switch, configures the NRF24 radio (DIP determines mesh network parent and pipe addresses), sends a message to a mesh NRF24 router unit and then enters a null loop until it looses power (PIR goes low). I’ve used an Adafruit proto-board to build a more permanent version:

ATMega328 Motion Sensor Project

ATMega328 Motion Sensor Project

I’ve run this device for more than 3 months and it works great. My next prototype will use the same idea but replace the ATMega328 and NRF24 with an ESP-1 Wi-Fi client.