# Why won't this rpi UPS circuit work?

I was attempting to make a mini UPS for a raspberry pi. The (relevant) bill of materials goes as follows:

1. 250V/50Hz AC to 5V/5A cctv power supply
2. A 2-port mobile powerbank (i.e. it can charge two phones simultaneously)
3. A 5V DC sugar cube relay
4. A capacitor - 4700 micro farads

They are connected as per this schematic:

The working principle is as follows: When there is AC supply, the 5V DC will activate the relay. This closes the circuit wrt the cctv powersupply device; the rpi should boot properly; and the powerbank should charge. When the AC powersupply is offline, the relay deactivates (i.e. enters the NC state). In this state the circuit should be (theoretically) closed wrt the powerbank's output; the rpi should boot properly. During the "switch" there is a momentary dip in the rpi's powersupply. This is taken care of by the capacitor.

Somewhere during breadboard prototyping phase, I noticed that I didn't need to ground the output of the powerbank. In other words, the powerbank's output was grounded through the GND of the powerbank's charging port. At the time, this made me assume that this is the norm. I decided to design the circuit likewise, and, implemented on a stripboard.

However, on the stripboard, my experiment failed. I observed the powerbank wasn't supplying output to the target device. Since, the circuit wasn't closed like I thought it would. This could be because of the powerbank being used was a different one - not the same one used during the prototyping phase. Perhaps this could be a feature of powerbanks with passthrough charging feature.

Hence, moving on, I decided to make a connection between my target device's GND to the powerbank's output GND. I connected pin2 of j2 to pin2 of j4.

Now when the mains supply is offline. I am unable to observe the actual order - but the following happens:

1. The relay momentarily jumps to a NO state.
2. The rpi momentarily tries to power on, but as soon as I hear the relay's click the pi looses power supply.
3. Same is the case with the powerbank output.
4. The powersupply device, has, an indicator LED on it. In its normal operation (i.e. when it is supplying DC from the AC mains) it turns on. But in this case, there is not AC supply. But it turns on momentarily.
5. I am unable to discern whether the actual number of relay clicks. (one or two).

I am still unsure why this happens. Hoping someone can correct the defect.

• relay momentarily jumps to a NO state does not make sense because it means jumps to a normally open state ... do you mean that the relay momentarity energizes? Mar 14 '20 at 1:04