I'm making an IoT project for a friend, but I need some tips: I want to use an old mouse sensor and convert it to a movement sensor (just for a door) and if it's activated, a second device (an esp8266) needs to be powered for just a minute (to send an alarm state to his phone). The problem is that the sensor provides just a few seconds and the second device won't be able to finish its work. So I need something that provides energy to the second device. What can I use?
Because it's an IoT project, I need something that doesn't consume power when it's not activated.