This is my first post so I'm not exactly sure where this should go. There's no dedicated hardware section and this doesn't really feel like a beginner thing, so I'm hoping this is the right place.
I've recently acquired a RPi 2B. A little old, but it does the job. I'm trying to implement a very, very basic shutdown on power loss circuit. My idea is to track the "mains" power by way of an optocoupler (a 4N25) fed from PP1 and PP5 with a ~470 resistor (value yet to be determined). When the optocoupler stops being active, a signal is sent to a GPIO pin, informing the Pi that it needs to shut down. This signal is little more than a straight line with a 10K resistor in the way, just as a precaution.
In order to make this useful, I've acquired a pair of 25f 2.5V supercapacitors, which I plan to run in series to allow for 5V. The intent is to plug these into 5V and ground on the GPIO so that they can both charge and discharge without any interaction from myself or anything else. But I'm left with one main concern: do I need to limit the current in this situation?
My initial thought was to plug the caps in directly and leave it at that. But that relies entirely on the ESR of the caps, could potentially overload my power supply (a buck converter I've already tested to have voltage sag when going past around 2.5A), and may give the Pi itself grief. My next thought is to include a current limiting resistor, but I'd need this to be at least a 5W (wire-wound from my supplier) in order to allow for just 1A (dis)charging, which starts getting big and hot.
Which leads me to my question: is current limiting required, does the Pi natively have some form of current limiting built in for the GPIO, or is the ESR likely to be sufficient restriction on its own?
Cheers.
