It's pretty simple. When power is flowing through the line, the detector cable activates the timer which is set to 250 ms (if it's set too high, and the user uses too little power, the timer might not get to tick before it's deactivated again.) The counter in front of it is set to 9600 to give 40 minutes of power (total power. It doesn't count when the user isn't using any power.) When the counter hits the max, it shuts off the splitter cable, stopping the flow. It also activates the timer which causes the filter to pull an item out of the chest. I have it set to pull uranium. When the item passes through the item detector, it pulses the decrement side of the counter which is also set to 9600, restarting the whole thing. You could set it to cost any item (or items) in the game, and give however much power you want.
So far it seems to be working great.
Note that the repeater is just there because the splitter cable refuses to activate from redwire. It'd work a little better if that bug was fixed.