I'm making a touch lamp with an arduino and LED strip by sensing the capacitance of it's base, a 6' stainless steel pipe.
With USB power from my mac, the capacitance of the pole/pipe is relatively stable, and my code works to cycle the lamp state from low, medium, to high brightness, then off, with each touch. (24V to LEDs switched on/off by relay, brightness controlled with PWM and mosfet, the strip is not powered at this stage)
However, when the lamp is plugged in (110V AC), the voltage reading from the pole fluctuates much more with occasional spikes, giving many false triggers and cycling the lamp without external touch.
Any ideas why? or how do I better isolate the microcontroller's 5v circuit from the AC power?
The 5V buck is physically close to the AC in, is this enough for "leakage"?
i haven't used that type of buck converter before but it does look noisy. Ive had good success with ac/dc adapters and linear regulators. cut the end off of any wall adapter with suitable ratings or try adding more uF to your decoupling capacitor.
...I've never played around with capacitive touch sensing.
The 5V is already isolated (hopefully). It's a safety requirement. You can share a house/earth ground but since you only show 2 connections, presumably you're properly connected to hot & neutral.
If you are using a desktop/tower computer you might have an earth ground through the USB but laptops are isolated.
The DIY capacitive sensors I've seen are all wired like this. You seem to have a voltage divider thing going on there. How did you arrive at that circuit?
Needs to be better than hope -almost all converters of that type do not provide isolation , despite having a transformer and often saying they are isolating - there is usually a Capacitor between input and output circuits which could fail . ( if you put a voltmeter from the output side to the supply neutral you will most likely find an AC voltage , typically 60-80volts )
I would want a “conventional “ psu with proper isolation to stop involuntary pole dancing