Hey everyone, I'm currently designing a catfeeder that will work while my household is away. We have inconsistent schedules and can't keep them on a scheduled feeding routine easily, so hence Arduino dispenser!
I am using an Arduino Nano for this project, which will be plugged in via usb to the wall at all times.
My issue however is designing a circuit to be able to temporarily hold the backup power on just long enough to turn the servo for the cat food open. After that, wait for me to reset it when the power comes on. I'm using two capacitors and a resistor in my code to check for power loss just like this video: Arduino Power Loss Detection with 2 Components - Saving State to EEPROM - YouTube My original plan was this circuit Imgur: The magic of the Internet using two relays. (NO=Normally Open, NC = Normally Closed, C=Coil). Allowing me to use one as a backup relay, and the other as a kill switch relay. The issue becomes that the capacitor I have between the +5v and ground only keeps it powered for about a fifth of a second. Not driving enough current through the Digital Pin to trigger the coil on the relay closest to the battery before the arduino dies.
The idea behind the circuit is upon detecting power loss, it turns on "DPin1" to high on power loss, allowing 9v to flow into the Vin Pin, running it off battery. Then using "Dpin2" to cut off the ground connection, killing itself.
So I'm curious if anyone has other ideas for being able to instigate a backup power, and kill itself method once the jobs done?
My idea currently which will cost me some money is using a rechargable battery charged off a second wallsocket. Turn the servo and just let the battery die.
Thank you in advance for any help!