Please understand that the only things I (and anyone else here) knows about what you are doing is what you have written in this thread. We do not know anything else.
So trying to put together the tiny pieces of information that you are providing one by one, am I right with:
- You get the correct voltage reading always.
- When you connect the current sensor, you get the correct current reading.
- When you disconnect the current sensor and have no connection to A3, then you read something, when you expect to read zero.
If nos.1 & 2 are correct, then if no.3 is correct, it is because the ADC input voltage is not defined. It is a high impedance input and it can and will take up any voltage between zero and VCC. If you must read a true zero when no plug is inserted into the socket, you must connect a high value resistor between A3 (or better, pin 1 of the socket) & GND. “High” means large enough to not alter the reading when the transducer is connected and working. I would guess that a resistor > 50 kΩ should be large enough, while still being small enough to ensure an accurate zero reading.
Where is the transducer and its power supply on that ‘interfacing’ drawing? How does the transducer COM connect to the Arduino GND?
The problem is your hardware, nothing connected with the averaging software loop.