Common ground do i need it for my setup

I have 5v out (uninterruptable power supply (UPS) ) connected to as input to 18650 battery and 5v power supply.
I have ESP32 project with a Touch button. The touch button works fine if there is no battery in UPS. But, if the battery is connected in the UPS, then touch doesn't respond.
if I common the ground of UPS. (battery and UPS output ground) then the touch starts to work.
I think that this two grounds are by design. ( i am not sure).
Should I connect/common these two grounds?

Could you take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

No diagram of connections. :roll_eyes:

No complete photograph of setup taken in daylight. :roll_eyes:

No idea! :grinning:

In general, an electrical circuit must have a "return" connection, generally ground, to make a complete "circuit", which means the ground has to be connected as well as power and signals.

A simple way to look at the ground issue is normally it is the reference point. You typically connect one end of your measuring device to ground the other to measure voltages. All the reference points must be the same hence all grounds must be connected. Any current through the ground wire will cause voltage drops so be careful when the circuits consume power.

The touch button works fine if there is no battery in UPS. But, if the battery is connected in the UPS, then touch doesn't respond.

Sounds like the touch buttons are wired up wrong. That should be wired between input and ground with the input pull up resistor enabled or fitted.

Any other way is wrong.