Author Topic: Capsense library and arduino  (Read 4839 times)

0 Members and 1 Guest are viewing this topic.

Offline pyrohaz

  • Regular Contributor
  • *
  • Posts: 186
  • Country: gb
    • Harris' Electronics!
Capsense library and arduino
« on: December 21, 2013, 03:47:38 pm »
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
 

Offline imjosh

  • Contributor
  • Posts: 10
  • Country: us
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 18879
  • Country: nl
    • NCT Developments
Re: Capsense library and arduino
« Reply #2 on: December 25, 2013, 02:07:18 pm »
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.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline pyrohaz

  • Regular Contributor
  • *
  • Posts: 186
  • Country: gb
    • Harris' Electronics!
Re: Capsense library and arduino
« Reply #3 on: December 25, 2013, 04:41:40 pm »
it's tricky business; good luck.

http://www.atmel.com/Images/doc10760.pdf
https://www.youtube.com/playlist?list=PLtQdQmNK_0DRkFhIq1d3QCcmyD2c71ghm

Thanks 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.

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.

In 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
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 18879
  • Country: nl
    • NCT Developments
Re: Capsense library and arduino
« Reply #4 on: December 25, 2013, 08:23:04 pm »
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.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline kony

  • Regular Contributor
  • *
  • Posts: 239
  • Country: cz
Re: Capsense library and arduino
« Reply #5 on: December 25, 2013, 10:32:36 pm »
 

Offline pyrohaz

  • Regular Contributor
  • *
  • Posts: 186
  • Country: gb
    • Harris' Electronics!
Re: Capsense library and arduino
« Reply #6 on: December 26, 2013, 04:01:22 am »
Something you might be interested in:

http://www.microchip.com/wwwproducts/Devices.aspx?product=MGC3130

Wahey! 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.

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.

They have patents directly for an infrared/visible light sensor that can be used to control musical parameters http://www.google.co.uk/patents/US6501012

I'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.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 18879
  • Country: nl
    • NCT Developments
Re: Capsense library and arduino
« Reply #7 on: December 26, 2013, 11:15:19 pm »
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.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf