capacitive values flutuation with external power supply

Good morning,
I've been fighting with Arduino for several months with several projects that I'm implementing in an Escape Room that I'm putting together.
The case that most headaches is giving me is a 5-point "homemade" capacitive panel to introduce a combination.
Using the capacitivesensor library and 10M resistors I made a prototype that activated a relay when entering the appropriate combination in the capacitive panel.
The problem comes when I disconnect the Arduino Nano from the computer and feed it with an external power supply. The values ​​of the sensors multiply and fluctuate greatly.
While connected to the pc the maximum values ​​are 50 with a variation of + -4, when connected to this power supply the maximum values ​​are 650 with a variation of + -100.
This causes that if I put the low values ​​activate the sensors alone and if I put them very high does not detect the pulsation
The power is a pc power supply that I did not use and feed it directly to the input Vin and GND of the Nano.
I've searched for a thousand sites. In some comments it may be the grounding but I can not solve it.
Any help or ideas, please ?? I smashed the despair.
Thank you in advance.

risi61:
Any help or ideas, please ??

Without at the very least schematics and code, no chance.

What voltage are you suppling to Vin? Not 5V I hope.

Thanks for the answer.

MarkT:
What voltage are you suppling to Vin? Not 5V I hope.

Yes. I use an ATX power supplys with the 5v wire. Is it not correct??
Thanks

wvmarle:
Without at the very least schematics and code, no chance.

This is the schema I´m using:
https://cdn.instructables.com/FSY/YCCY/I6WDNM5U/FSYYCCYI6WDNM5U.LARGE.jpg

It´s easy. And the code too. I think there is no problem with the code, because I´m senior programmer. and it runs connected to pc. The problem comes with external power.

One more thing. I don´t touch the sensor wire. They go behing 2mm methacrylate sheet.
Thank you

risi61:
Thanks for the answer.Yes. I use an ATX power supplys with the 5v wire. Is it not correct??

Vin requires >6V, preferably >7V, for the regulator to do its job . See the Arduino manual (you can google it if you don't have it at hand). Use the 5V pin instead (but only if you're dead certain it's 5V as that pin is unregulated, so providing higher voltages WILL kill your Arduino).

wvmarle:
Vin requires >6V, preferably >7V, for the regulator to do its job . See the Arduino manual (you can google it if you don't have it at hand). Use the 5V pin instead (but only if you're dead certain it's 5V as that pin is unregulated, so providing higher voltages WILL kill your Arduino).

Thanks for the answer. It´s an Arduino Nano. I´m going to investigate about it because the Power supply only have 3V, 5V or 12 V.

I have also read that a small capacitor in the sensor could solve the problem. But I do not know where and how to put it. Do you know?

Thank you very much

That's probably 3.3V, not 3V. Just connect it to a multimeter to confirm your voltage is correct. Output of an ATX type power supply should be very stable.

No experience with capacitive touch sensors; never tried; but I do know there's tons of info out there from my searches for capacitive water (level) sensors.

wvmarle:
That's probably 3.3V, not 3V. Just connect it to a multimeter to confirm your voltage is correct. Output of an ATX type power supply should be very stable.

Yes, it's 3.3V. I will try to connect 12V to Vin.

wvmarle:
No experience with capacitive touch sensors; never tried; but I do know there's tons of info out there from my searches for capacitive water (level) sensors.

Yes. There's a lot of information about "home made" capacitive sensor like mine. But for this concret problem I have not found nothing that solve it. Or not wise to look good.

If you have a good 5V supply better use that; the 12V supply means your regulator has to dissipate a lot of power - more than the rest of the Arduino uses (12-5 = 7V difference, makes for a lot of heat to handle).

Your original supply - connecting 5V to Vin - meant that the Arduino itself was effectively supplied with a little under 4V (just over 1V minimum drop in the regulator). Then also your ADC references are off, and all kinds of other unexpected things happen.

If you have 5V power supply you may connect it to 5V pin (and connect grounds ofc).

wvmarle:
That's probably 3.3V, not 3V. Just connect it to a multimeter to confirm your voltage is correct. Output of an ATX type power supply should be very stable.

Stable? No, extremely noisy, too noisy for much analog circuitry in fact. Typical switch mode
supplies put out 100's of mV of wideband noise.

Analog circuitry likes microvolts of noise if possible for good clean signals, certainly a couple of orders of
magnitude lower noise that a SMPS.

The on-board regulator should generate a low noise 5V if Vin is fed 7 to 12V.

Thanks for the answer. I have tryed to conect the 12V to Vin and the result is quite good.

Next, I´m going to try to use 5V with the 5V in, if you say it´s better.
Tomorrow I wil tell you what is the result.
Thank you very much.

Hi,
I have done several tests with your advice and it goes much better. But it is not yet reliable.
Some times it detect pulsations that are not.

I´ve read somewhere that it could be “noises”. And it could be solved with a 1uF capacitor.
But my dubt is, where and how is it putted in my schema?

thanks

Can you please draw a circuit diagram?
Use pen&paper or KiCAD (free software) or another software... Fritzing diagrams are generally unreadable. Your is an excellent example of that.

Sorry I´ve no idea to draw a circuit diagram.
My only knowledge of electronics is the ones I have acquired with arduino now.

I put the basic circuit diagra that comes in the documentation of the capacitive library.

And another image with more quality and simplifyed with only the sensors.

Thanks a lot.

Still perfectly unreadable, that diagram. What are all those wires connected to? Which Arduino pins?

Though one thing I notice and that is that all sensors are connected to the same "send pin". That means all sensors are interconnected.

wvmarle:
Though one thing I notice and that is that all sensors are connected to the same “send pin”. That means all sensors are interconnected.

Yes. The capacitivesensor library uses a common pin for sending (in the diagram pin 4, the blue wire). From this,goes one wire to each sensor, wich have a 10M resistor and two wires after it. One wire goes to an Arduino´s pin (in the diagram pins 2, 6, 8,), and the other wire goes to an aluminium foil. When you close your hand to each foil increases the amount than enter the pin of that sensor.

Sorry if it isn´t so clear. It´s difficult for me in english because it´s so technical.

Thanks.