Capacitive Sensor use (with a battery)

I am working on a project that uses a capacitive sensor to detect skin contact between two humans. (It's not as perverted as it sounds :P) I have created a program that calibrates the sensor to ignore the capacitance of the human wearing the device. First, the person would attach the metal lead of the sensor to any part of their skin, and then turn it on. The program subtracts the value each time it gets a new reading, so that when somebody else is touching their skin, it can detect a change in the capacitance. I would post the code, but there is a lot of unnecessary information in it.

Anyway, the program works perfectly when connected to a computer, but when instead connected to one 9V battery, it only works about 10% of the time. My only two guesses about why it worked connected to the computer and not the battery would be that either the battery does not supply a high enough current to do capacitive sensing, or it has something to do with the computer being grounded.

I don't know to much about theoretical electronics, so I thought it would be a good idea to ask the community. Thanks

Just wondering if you figured out why this was happening with the 9v battery because I’m having the same problem and am unsure of a solution.
Thank you!

I’d be pleased to read about your solutions because now I am facing the same problem.
I am building a moisture sensor. With the laptop I got quite a nice sensitivity, but with the 9V battery, thet I got nothing.
Following another post, I have taken another piece of foil and connected it to GND of Arduino. Luckily, the sensitivity has turned back, but far less than the one I had with the laptop.
I was also consdireing using shielded wires for improving the readings, but after this issue with the battery, now my priority has changed.
Any other solutions are welcome!

Capacitive sensors require a common connection, to Gnd, earth, or some other "weight" like a computer or human body.

Consider the way the current has to travel, from the sensor through air to the second person, back through air to the first person and (how?) to the Gnd of the circuit. Perhaps it helps to connect Gnd to the person (skin) wearing the device?

When using your laptop does it make any difference whether its charger is connected (and switched on)?

Archibald: When using your laptop does it make any difference whether its charger is connected (and switched on)?

I don't really know, since my objective is to use the 9V battery, but having read other answer to similar questions I'd would say "yes". But in case this can give some light to this topic, I will test it soon. Thanks Archibald and thanks DrDietrich for your answers and ideas.