I'm developing a CCTV system out of a pi 2 modal b and everything is on track using noIR camera and stuff. Since a CCTV should work for few hours without power, I'm in need of a backup power source when the mains are off.
Is there any circuit where I could plugin my regular power source an if that is out, a backup battery would get activated. I've seen USB batteries which is usable in this scenario but, that would need manually to switch the power source.