Help with DIY touch sensor through PLA plastic please!

Hi all,

I've been playing with the Capsense library and it works ok on a breadboard (I appreciate the wires are long and are also playing a part here).

I want to put the switches (4) behind some 3d printed PLA (1mm thick) which will also have some wood veneer on it.

I've been testing that today and it isn't working. Even if I increase the resistor (starting at 1M, I've tried 2M, 4M and 10M).

I've tried aluminium tape and aluminium tin foil. The button area is 1cm square.

What is the best option for material to make this work? 1mm plus veneer (thin, less than 1mm) shouldn't be an issue should it?

Is it the material I am using or the breadboard model with long cables?

Is a thicker metal better than a thinner one?

Thanks!

Lots of different possible problems - but what it is, is hard to say as you forgot to add a schematic of your setup, photos of your setup, and your code. All of these are potential problem sources.

For the sensor, you can also make it easy on yourself and incorporate TTP223 based sensors in your design.

Sorry, code is the capsense touch demo (GitHub - PaulStoffregen/CapacitiveSensor: Detect touch or proximity by capacitve sensing)

Wiring is simply a wire from pin 2 (send) to metal, then pin 2 and pin 5 (receiver) connected with a resistor.

Sorry, to answer the other point, the reason I choose not to use a ready-made sensor was because my local shop sells them at 5 euros each and I need 4 of them. 20 euros for this project is a lot. But I've just found these on Amazon (https://www.amazon.es/Ils-2-5-5-5V-Capacitive-Self-Lock-Arduino/dp/B0769DKZN5/ref=sr_1_2?__mk_es_ES=ÅMÅŽÕÑ&keywords=TTP223&qid=1563908367&refinements=p_85%3A831314031&rnid=831276031&rps=1&s=gateway&sr=8-2) - 10 for 7.71 euros, and they are nice and small too (the others are bigger). So maybe I will go for that instead - just thought it should be simple to do my own. Thanks

jago2:
But I've just found these on Amazon

It's much better if you make such huge links clickable! Use the URL icon in the complete editor (click "Preview") or manually add [url=...]text[/url] tags.

Anyway, that's the kind of sensor I was referring to. A few different models are out there, they work well. Long wires are a problem for capacitive sensing (they add lots of stray capacitance), another major one is improper grounding.

Yes, sorry about the link. I forgot to post it at first and wasn't sure of the edit ability/time so panicked a bit when adding it.

Wires will be incredibly short to the board when I put these in the enclosure. Hopefully they will do the trick.

Thanks for the push. If I hadn't looked and seen how cheap they are, I'd think they were still 5 euro each!

jago2:
I want to put the switches (4) behind some 3d printed PLA (1mm thick) which will also have some wood veneer on it.

Wood veneer will absorb sweat and moisture and become a conductor - use only good insulators.

1mm is thick, can you not use a thin film? The capacitance of two plates 1cm sq and 1mm apart is of the order of 1 to 3pF depending on the insulator's dlelectric constant. 0.1mm thick would be way way better...

The sensors as linked to above will happily read through a few mm of plastic.

Thanks MarkT and wvmarle - although seemingly contradictory advice.

Mark - the veneer will be lacquered so hopefully that will prevent any absorbtion. But the capsense library auto-calibrates on startup so even if there is a change hopefully it wouldn't be a problem.

The sensors are arriving today so I'll see if they will work.

I'd be open to another material for the top. Walnut veneer is fixed as the material for the sides of the eclosure so it would need to be something that complements it. Plain PLA is an option if smoothed well enough but colour wise I only (currently) have black, white and blue (plus a wood PLA but not given that a fair go yet). Painting is a possibility but ...

Ironically a metal would look good but that would interfere with the sensors even more!

The advice is not contradictory as we're talking about different sensors.
The TTP223 is a self contained one.

Ah sorry, so the one linked to on Amazon that I have coming today will be ok you think?

Is it the DIY one that was less likely to work?

Thanks

Very likely the Amazon sensor (with purpose built, self calibrating IC) is going to work better than your DIY. Capacitive sensors are very simple in principle, but often pretty tricky to get right. In part as by their nature parasitics are a major issue.

Thanks. Tracking showed them a few stops away before the driver decided to go a different way :wink: Should be here soon though!

Only had time for a quick test before I had to go out and will do more tomorrow but basically plug-and-play and work perfectly through the pla (in fact, a bit sensitive, so once I put the veneer on and test it with that, I'll look at increasing the gap to the surface if needed).

Thanks again for the suggestion, saved a lot of time and they seem to work beautifully (and I only need 4 for this project so I have 6 more for something else :wink: )