CapacitiveSensor Arduino Library, Demo on Teensy 2.0

preview_player
Показать описание

Please note, the name of this library was changed due to trademark complaint from Cypress Semiconductor. Please disregard any mention of the former name.
Рекомендации по теме
Комментарии
Автор

paul i'd just like to thank you for your explanation! many of my projects have come to fruition because of your tutorials and posts on the forums. So great to see someone genuinely knowledgeable putting their ideas out there to help others understand.

also very clear and well explained!

kidrb
Автор

Hi paul. Great work!
I report what I found by doing some tests:
1)If you use the same output pin (4 as in the example) for multiple sensors it becomes very slow.
2) The same happens if you connect the serial port, for example 0->RX and TX->1 of Arduino UNO
3) If you put your bare feet on the ground or have damp shoes, the read value rises until it blocks the serial monitor.

For the rest everything seems OK! Great! 👍

antoniodevincentiis
Автор

1: Each electrode connects to 2 pins. The send pin needs a resistor. I used 4.7M in this video demo. The receive pin can connect directly, but I used a 1K resistor which helps protect the pin.
2: CapSense uses digital pins.
3: I did not use CapSense's AutoCal functions.

Please check the CapSense page on the Arduino Playground. If you google "capsense", it's the #1 link. It explains CapSense in much more detail than I can put into a 90 second video demo.

PaulStoffregen
Автор

I wired it up exactly as described in the comments of the example that comes with version 4. Open it from File > Examples > CapSense > CapSenseSketch. Yes, all three 4.7M resistors connect to pin 4. The receive pins are 2, 6 and 8. Of course, you can use any digital pins, but those are the pins used by the example program than comes with CapSense, and for this video demo I just used the example code.

PaulStoffregen
Автор

Higher resistance values (or 2 or more resistors in series) can improve sensitivity, but it will not solve the ground problem. That's a fundamental issue with capacitive sensing. Hand-held products with capacitive touch buttons and screens have metal housings so the user is grounded to the device, and free-standing equipment requires earth grounding to work.

PaulStoffregen
Автор

touchRead(pin) is in the Teensy3 core library, together with all the normal functions like analogRead, digitalWrite, pinMode, etc.

PaulStoffregen
Автор

You can use the same pin to drive multiple sensors, but each needs its own individual input. In fact, the example shown in this video uses 4 pins to interface 3 touch sensitive electrodes!

PaulStoffregen
Автор

It's the same copper tape that's sold for create stained glass art. It's meant to be soldered. Normally stained glass soldering is done with large/powerful irons. Just give it a little time to heat up and the solder will flow.

PaulStoffregen
Автор

@notbot Yes. There's a MIDI library you can use for regular (5 pin) MIDI out. It works on all Arduino compatible boards. Teensyduino (Teensy only) also has USB MIDI, which you can use from the Tools > USB Type menu. It should be pretty simple to use either to send MIDI messages when the sensors are touched.

PaulStoffregen
Автор

It seems this idea is not so popular with the Arduino for some reason. This seems to be the most recent and useful info on sensing touch directly on the Arduino pins. Maybe most people are buying off the shelf touch sensor boards? I tried your code and it work wonderfully (with 2Mohm resistor)! Thank you. I was initially experimenting with input on the analog pins with little success. This is the way to go.

boggynfld
Автор

I believe they are the same. Copper, Aliminum, Tin, Brass, or any non-ferrous metal (eg, magnet doesn't stick) should work identically. Ferrous metals probably also work fine too.

PaulStoffregen
Автор

Seems so funny to solder something to copper tape. Didn't realize that would work. Cool!

deltaray
Автор

CapSense might work, if you use many smaller metal pieces, but that's not really one long continuous metal strip. Probably not quite what you want.

I did see the ideal product (for your project) recently, and some used it successfully with Teensy a few weeks ago. The pin number defines may need to be edited, but I have 1 confirmation it does work. Since youtube doesn't allow links in these comments, google for "QT1106 breakout", and click on "7 Key Slider/Wheel".

Good luck & send me a photo

PaulStoffregen
Автор

Yes, it might be possible. The chip and extra wiring will add a little capacitance, but other than changing the readings slightly, I'd imagine that ought to work. Maybe you can give it a try and tell me if it works?

PaulStoffregen
Автор

On Teensy3, just connect to any of the touch-capable pins (see the pinout card or reference page) and then use touchRead(). It works like analogRead(), except the number you get is the capacitance in 1/50th pF units. Teensy3's touchRead() is much faster and more accurate than using this library!

PaulStoffregen
Автор

If the foil conducts electricity, odds are very good it will work.

It's so very easy to try... just connect it using a couple resistors to any 2 digital pins on any Arduino compatible board and run the CapSense example (edit the pin numbers to the pins you used!)

Maybe you can reply here after you've tried it, to let everyone know if it worked?

PaulStoffregen
Автор

Thank You.
It is rewarding to have an idea, and then find someone has already done it, and done it So Well. Old people find the strangest stuff interesting I suppose.
Thanks

robertblaylock
Автор

im trying to make a hatsune miku future tone arcade cabinet and it has a funky touch slider and i'd like to recreate that same effect with rgb leds as well. i know nothing about electronics and i cant really just dive into the rabbit hole because i have no idea where to start. but i think this gave me some insight on how touch sensing works, so thank you a lot

sillybnnuy
Автор

I got it working. It also works if you leave away the metal and simply touch the wire.

marian
Автор

it works! basically ... actually i thought i would have to modify the library but .. that would be out of my skillabilities ... but then i realized how simple it actually is ...

watch?v=5-Bq7ox3oOU

but i had to lower the preset samplerate to like 2 or so ... you can see more in the video and in the video description. have a short view on the sourcecode, i guess you get the idea how it works.
cheers!

papperlapappable
visit shbcf.ru