I have an "U" shaped metal profile that is 2 meters long each side is 1.5 cm. It is sprayed with acrilic color. and i want to use it as indirect light profile/enclosure for a 12v Led strip.

While playng with the capacitve touch libs of the attiny85 i tried to connect
one sensing pin to the above mentioned profile getting really perfect results.

Altough the testing was made without powering the led strip, leaving so a all the working electronic circuitry outside of the "U" profile.

As i attached the ledstrip to the active circuit the touch did not work anymore.

Basically the sensing is disturbed by the ledstrip.

There is no way to get it to work if there is something elecronically active inside the profile.

Then i made another test.

I put two "U" shaped profiles side by side, paralell at 5cm distance. One of the profile contained the circuit & led strip and the second was connected to the Touch sensing pin with no electronics parts inside. this worked again.

Is there a way i could properly insulate the led strip & the circuit from not interferring with the enclosures capacitive abilities?

The plan is to use the whole enclosure as a big touch sensitive on/off switch.


  1. Video showing the working capacitive surface. https://youtu.be/I-JkjfGwqEo

  2. Video showing the same circuit but powering the leds inside the profile. https://youtu.be/Mz7KTxXNz5Q

As you can see in the videos avbove the circuit won't work if the leds are inside the the profile.. i made verious other tests and as soon i add the ledstrip stored inside the metal "U" the EM field is disturbed.


simulate this circuit – Schematic created using CircuitLab


I apologize for the quality of the following diagram. i'm not good at drawing diagrams.I also totally don't know what software i could use to draw a diagram. Here is how it should look like

enter image description here

  • \$\begingroup\$ You need to add a schematic. Use the button on the editor toolbar. You also need to add links to each item of your setup and, if possible, post the relevant bits in your question so we don't all have to look it up. A photo wouldn't do any harm either. \$\endgroup\$
    – Transistor
    Mar 17 '16 at 19:14
  • \$\begingroup\$ yes i'm adding a video pls wait \$\endgroup\$
    – cocco
    Mar 17 '16 at 20:16
  • \$\begingroup\$ Huh? Way too much hand waving. Show a diagram of your setup and a schematic of your circuit. Closing until then. \$\endgroup\$ Mar 17 '16 at 20:16
  • \$\begingroup\$ yes working on it right now \$\endgroup\$
    – cocco
    Mar 17 '16 at 20:16
  • \$\begingroup\$ Edited as requested in the minor time possible ... now explain downvotes... \$\endgroup\$
    – cocco
    Mar 17 '16 at 20:29

Your symptoms are not surprising at all. From the schematic, we know that the capacitive sense method is effectively measuring the change in capacitance to ground, not some other specific conductor for the purpose.

The real problem here is that you are just sticking blocks together without understanding how they work. You need to actually stop and understand capacitive touch sensors and what "PWM" means and the implications thereof. Blindly connecting subsystems at this level will get you into trouble, as this example shows.

The LED strip adds significant capacitance to ground, and even worse, adds significant noise due to the PWM drive. Basically, your capacitive sensor isn't going to work with the LED strip near it.

"Insulating" the LED strip from the sensor makes no sense either. Capacitors are already insulated between their plates. Shielding the sensor from the LED strip might help in that it will reduce the noise from the PWM. However, it will also add significant capacitance to ground so that the change in capacitance due to a touch is a smaller fraction of the whole. These signals are already small and noisy, so a shield may also keep the sensor from working.

A shield at a far enough distance would help, but ultimately using the wrong building blocks for the situation is not a good strategy. There are other types of capacitive sensing that are more appropriate, but that doesn't work if you're just blindly "playing with the capacitive touch libs".

  • \$\begingroup\$ If you actually would look at the photos and videos you requested you would notice that i made every single block i try to connect together. Another point why i'm here is that i'm trying to learn. Oh and yes i'm trying to combine some disturbing pwm frequency with a capacitive sensor. And again if you had read my question you should also have seen the part where i notice myself that everything works at 5cm without the need of any shield. Then you say insulating is useless but shielding the sensor could help. \$\endgroup\$
    – cocco
    Mar 18 '16 at 14:23
  • \$\begingroup\$ As you already stated in your answer , as i'm only trying to connect blocks together, it should be obvious for you, that by telling me that i need to shield something i wouldn't understand anything. So in my ignorance i ask you if you could be more specific. Shielding with what material or how, distance... can i calculate that distance? \$\endgroup\$
    – cocco
    Mar 18 '16 at 14:25
  • \$\begingroup\$ As you might have understood now, your answer tells me nothing. I didn't learn anything new. i just got insulted and called ignorant. Downvote and go to the next question if you don't like what i ask else try to help. \$\endgroup\$
    – cocco
    Mar 18 '16 at 14:28
  • \$\begingroup\$ I requested a diagram and a schematic. You supplied a schematic. No, I'm not going to follow a link and watch a video. A shield will isolate the PWM signals from the cap sensor, but also add capacitance to ground. Since you haven't really explained what this U "profile" thing is (that's what the diagram was supposed to be for), it's hard to say how/where a shield should be put. Another option is a actively driven shield, often called a "guard". But again, with the mechanicals being so vague, it's hard to give any recommendation on that. \$\endgroup\$ Mar 18 '16 at 14:47
  • \$\begingroup\$ ok, so be more specific... you need more info... you follow image links hosted on popular image sharing sites? \$\endgroup\$
    – cocco
    Mar 18 '16 at 14:48

Your circuit is a bit dodgy. You were using the human body as a big antenna / capacitor to pick up mains hum which you coupled directly to an input pin on the micro. The 1 kΩ resistor, I guess, is there to limit current into the chip if anything goes wrong, such as static discharge, etc. It seems a bit low for that but that's a separate issue.

Your circuit now has a bunch of LEDs inside the capacitive sensor with, I presume, a switched mode power supply merrily chopping the current waveform at a hundred kHz or so. This will generate a lot of electromagnetic radiation and coupling to the case which is your sensor.

I suspect the reason nobody else has dived in with an answer is that you still haven't supplied enough details.

  • Is the micro GND connected to mains earth?
  • What's the length of the wire to the sensor? If it's long it will make a super antenna to pick up the transmissions for the LED strip.
  • Again, a photo would help.

At the time of writing you have seven comments on your own post. Add the detail to your question rather than in the comments. That way everyone can see them.

  • \$\begingroup\$ 1. The powesupply has 3 cables , so yes the ground of the whole circuit is connected to the earth, but it worked also from a battery \$\endgroup\$
    – cocco
    Mar 17 '16 at 23:52
  • \$\begingroup\$ 2. short or inexistent as i could theoretically put the whole circuit inside the U shaped metal. below is the circuit i was thinking of. img3. \$\endgroup\$
    – cocco
    Mar 17 '16 at 23:54
  • \$\begingroup\$ 3. imgur.com/a/mGJpf \$\endgroup\$
    – cocco
    Mar 17 '16 at 23:54
  • \$\begingroup\$ img 1 you see the "final" circuit, which is not soldered for now. it would fit inside the profile, leaving some mm's for some isolated box.In that case the sense cable needs to be only max 1cm, if i put it on top for a specific reason the cable would be 2-3cm. but contrary if needed the cable could go trough the whole profile. \$\endgroup\$
    – cocco
    Mar 17 '16 at 23:57
  • \$\begingroup\$ in the 2nd img i made a drawing simplified. \$\endgroup\$
    – cocco
    Mar 17 '16 at 23:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.