Capsense library and arduino - Page 1
Forum section: electronics / general

author: pyrohaz
author_rank: Regular Contributor
timestamp: December 21, 2013, 03:47:38 pm
content: Hey guys,So i've got my arduino and i've been using the capsense library quite a lot to detect human movement. I've found that it can be quite unreliable at times, depending no sensor placement (next to mains lines etc.) now i've been looking at commercial solutions and haven't been able to find anything that produces an output proportional to the distance of ones hand/body. I've found many products that can switch on or off with touch or proximity though. Can anyone aid me in my search for a capacitive sensor that produces a proportional output? Any info is useful!(For those who may now know the capsens library:http://playground.arduino.cc//Main/CapacitiveSensor?from=Main.CapSense)Thanks,Harris

author: imjosh
author_rank: Contributor
timestamp: December 25, 2013, 05:05:19 am
content: it's tricky business; good luck.http://www.atmel.com/Images/doc10760.pdfhttps://www.youtube.com/playlist?list=PLtQdQmNK_0DRkFhIq1d3QCcmyD2c71ghm

author: nctnico
author_rank: Super Contributor
timestamp: December 25, 2013, 02:07:18 pm
content: I'm not sure capacitive touch is the best way to go for distance sensing. I've used infrared distance sensors in a project and they could detect up to 50mm. The challenge is to determine a baseline due to ambient light and then detect changes which can be converted to a distance.

author: pyrohaz
author_rank: Regular Contributor
timestamp: December 25, 2013, 04:41:40 pm
content: Quote from: imjosh on December 25, 2013, 05:05:19 amThanks for the links. I've read through that PDF and they don't seem to say how you can get a continuously variable/quantized output of the distance from their chips which is annoying! Thank you anyway though.Quote from: nctnico on December 25, 2013, 02:07:18 pmIn this case, I do actually agree, I was hoping to design a musical product where a proximity sensor can be used to control parameters but unfortunately, Roland control all the rights on infrared/light based proximity detectors!Does anybody know of other methods of human distance detection?Thanks,Harris

author: nctnico
author_rank: Super Contributor
timestamp: December 25, 2013, 08:23:04 pm
content: What do you mean 'Roland controls all the rights'? You mean they have patents for music instruments?Another very good option is to use ultrasound. That probably works even better than infrared especially for short distances. You'd need some processing power though for filtering but with the modern ARM controllers that is no problem at all.

author: kony
author_rank: Regular Contributor
timestamp: December 25, 2013, 10:32:36 pm
content: Something you might be interested in:http://www.microchip.com/wwwproducts/Devices.aspx?product=MGC3130

author: pyrohaz
author_rank: Regular Contributor
timestamp: December 26, 2013, 04:01:22 am
content: Quote from: kony on December 25, 2013, 10:32:36 pmWahey! That is the kind of thing I was definitely looking for! I'll look into how I can obtain one of the dev boards. Quite amazing that it was fresh out last month.Quote from: nctnico on December 25, 2013, 08:23:04 pmThey have patents directly for an infrared/visible light sensor that can be used to control musical parametershttp://www.google.co.uk/patents/US6501012I've had a quick look at ultrasonic and after some of my own experimentation and purchasing a cheapo ultrasonic sensor on ebay, I got turned off a bit at the thought of using ultrasound. The ebay sensor produces pretty erratic results dependent on my hand position, even if the distance is the same - merely slanting my hand produced weird results. It was only a cheapo SRF04 sensor though.I had a go using an ultrasonic transducer and 40kHz source too. I attempted connecting the sensor to the 40kHz source through a small resistor (1k Ohm) and viewing the voltage across the transducer with my oscilloscope gave a really weird correlation between distance and voltage output.It seemed that as I moved my hand towards the transducer, the voltage decreased from a maximum in a proportional manner, to a certain minimum at which it started increasing to a maximum larger than the first, to which it then started decreasing to a minimum, smaller than the first, continuing in this fashion until my hand was on the sensor. The frequency of maximum to minimum also increased as my hand got closer. Its quite hard to explain this behaviour in words and if I had access to my oscilloscope at the moment, I'd show you a picture! My only guess so far is that as my hand enters in and out of the nodes, the transducer is consuming more and less energy(?), altering the peak voltage drop across the transducer though other effects might come into play, any ideas there? I would prefer to be able to use a single transducer ultrasonic sensor.

author: nctnico
author_rank: Super Contributor
timestamp: December 26, 2013, 11:15:19 pm
content: IMHO the best way would be to send short bursts (a few cycles) from an ultrasonic transducer and correlate the incoming signal with what was send. Its not trivial though. The Microchip solution seems much easier if it works reliably.