Capacitive slider fails to work on 5v but works when using USB power

I've just built a two piece aluminium foil capacitive sensor for use as a touch slider.

The touch sensor is controlling an RGB LED strip, adjusting it's brightness.

While I am working in the Arduino IDE I have good values coming from the touch slider. However once I unplug my Nano and then apply 5v to the Vin pin the touch sensor no longer works.

Seeing I can't see the serial monitor while the Nano is not connected to the laptop, I am unsure how to go about debugging it. Any suggestions would be greatly appreciated.

Can anyone suggest what might be at play here?

How are you powering your sensor circuit? From the +5V pin?

Another troubleshooting idea might be to use an LCD and SoftwareSerial to print out debug messages.

What do you use for 5V power supply?

Improper grounding is a common problem with these sensors. The chassis of your laptop provides a pretty good ground (even better if connected to a grounded outlet); a battery source doesn't provide a proper ground - so your sensor doesn't have a stable reference.

dibs: and then apply 5v to the Vin pin the touch sensor no longer works.

The V-in (raw) pin is the input of the 5volt regulator, and needs at least 6volt to make a stable 5volt for the micro. If you have a reliable 5volt source, connect it to the 5volt pin. That might not be your problem though. Cap sensors need some ground plane around the sensor to work. Post pictures. Leo..

Thanks for the responses.

I power the Nano via a breadboard power supply with 5V.

I have got the sensor connected to the ground with a resistor of 1Mohm between ground and the recieve pins.

I might have to get a wee screen to dump out some serial data I guess.

How is it grounded? If no firm grounding (large ground plate at the very least0 that will cause problems.

Can you try to use at least 6V on Vin (its 6-20V as Wawa said) to determine that's not a problem?

UPDATE:

I2C LCD screen arrived and I began viewing the data. It was wild and random.

I managed to get things working once I tried grounding the circuit by either touching a gnd pin to the outer shell of the disconnected USB plug (so gnd via laptop) or even just by holding the ground pin myself.

Now I need to figure out how to create a nice ground for the project.

It's a lighting rig for my sons bunk beds which are tubular steel. Just now I've hooked it up at the bed and touched gnd to a bolt on the bed. This gave a good response while sliding my hand over the touch slider but once I let go of the touch panel randomness crept back in.

Should the bed be ok as a large ground plate as people have mentioned? I didn't attach the wire that well to the bolt so there may be room for improvement there.

I can't figure out how to gnd it to actual earth without hacking a mains plug, which I would like to avoid if possible.

I also don't have a 6v supply at the moment (amateur setup, I know..) so I can't test if the slightly higher voltage would be helpful.

Any more ideas/tips etc.. most welcome.

I would expect the bed is a good enough ground, as suggested by your testing.

You may try adding a small cap between sensor and the ground (40-400 pF or so), that may also stabilise things. Capacitive sensors are finicky things!