You need much more than a software. You need to build the electronics as well, and you want to make sure that what you build is not deadly.
Go to some freelance site, I am sure there are plenty of people who can do that for you.
Or buy a UPS, if this is what you need. This way you and people around you will remain alive.