Author Topic: Don't want to be grounded? Don't be, and use this capacitive sensing hack!  (Read 41925 times)

KarinH

  • MaKey MaKer
  • Posts: 1
    • View Profile
Re: Don't want to be grounded? Don't be, and use this capacitive sensing hack!
« Reply #15 on: September 18, 2013, 01:04:21 PM »
 ;D Dear all

Thanks for this - I was rather afraid to change the code on my Makey - but after MUCH deliberation I took the plunge. First I used the original code resulting in some unresponsive keys, but when I used Makilja's code - JOY!

YAY!

Karin

Makilja

  • MaKey MaKer
  • Posts: 2
    • View Profile
Re: Don't want to be grounded? Don't be, and use this capacitive sensing hack!
« Reply #16 on: September 18, 2013, 01:21:13 PM »
Hey Karin,

I'm happy it works for you  ;)

Let me know if you further improve it.

Cheers

sEQuenz

  • MaKey MaKer
  • Posts: 3
    • View Profile
Re: Don't want to be grounded? Don't be, and use this capacitive sensing hack!
« Reply #17 on: October 05, 2013, 06:59:30 PM »
I'm also interested in how to make more use of the capacitive sensing (to try and get Makey Makey to send analog values to music software to change MIDI CC values based on distance of a hand from foil conductor). Although I've only spent a day trying things out I'd be interested in feedback.

I started with the makeymakey_capacitive script mentioned and added a few bits to get outputs to show up on Arduino's Serial Monitor:

Added to void setup: Serial.begin(9600);

Then changed one of the pins from Keyboard.Print (outputting a letter) to: Serial.println(readCapacitivePin(0));

This meant I could see the output as a number between 1 and 17. But sensitivity isn't great - if I touch Pin0 to earth it outputs "17". If I touch the Pin0 connector with a finger it outputs 1 or 2. If I connect Pin0 with Earth across my tongue it outputs 4 or 5.

So its obvious that pins 0 - 5 (haven't tested the others) are working as analog outputs. But maybe someone here might have suggestions as to how to refine this to get a more useful range? The front page says that pullup resistance to pins on MM is 22 MOhms. Checking on arduino.cc shows that higher pullup resistance increases capactive sensitivity (http://playground.arduino.cc//Main/CapacitiveSensor?from=Main.CapSense):
Quote
Here are some guidelines for resistors but be sure to experiment for a desired response.

    Use a 1 megohm resistor (or less maybe) for absolute touch to activate.
    With a 10 megohm resistor the sensor will start to respond 4-6 inches away.
    With a 40 megohm resistor the sensor will start to respond 12-24 inches away (dependent on the foil size). Common resistor sizes usually end at 10 megohm so you may have to solder four 10 megohm resistors end to end.


But I find the sensor (connected to a 6" square piece of kitchen foil) only responds at 1 inch or less. There are some other tricks mentioned on arduino.cc for reliable capacitive sensing - e.g., having laptop connected to mains to ensure its grounded to earth, and having a piece of foil underneath the sensor (separated by non-conductor such as paper) and connected to a water pipe etc). These tricks increase the output numbers a little. But not enough to get a useable reading in music software (or with maxuino or similar OSC converters) at any distance over 1 inch.

Any suggestions or pointers? Other Arduino boards can do it, but is there a reason why the Makey Makey isn't suitable for this kind of application due to its pullup resistance for example? Or is it possible to edit the "moving window averager" mentioned on the front page in the original MM sketch to increase sensitivity/distance? (Although its more likely I've made a schoolboy error :) )
« Last Edit: October 05, 2013, 07:20:15 PM by sEQuenz »

damstraversaz

  • MaKey MaKer
  • Posts: 4
    • View Profile
Re: Don't want to be grounded? Don't be, and use this capacitive sensing hack!
« Reply #18 on: November 12, 2013, 03:11:50 AM »
Hi ,
I'm new here, and just discover the capacitive sensing hack. My makey makey will arrive soon , and I have a little question about this hack:

It will be necessary to adjust it to the dielectric properties of the material it is placed on or near.
I'm using a lot capacitive sensors,  like these :
http://infusionsystems.com/catalog/product_info.php/products_id/131
 and this
http://www.interface-z.com/pronfiture/sans-contact/164-detecteur-capacitif.html
they need to be calibrate for the material.
Does it have a autolearn fonction to his environment ( based on time) or the possibility to set the treshold with hardware ? the dielectric properties of the material will depend each time ( fuits, metal...)

that's really a nice alternative to the traditionnal trigering !
best,
Damien

Jobius

  • MaKey MaKer
  • Posts: 3
    • View Profile
Re: Don't want to be grounded? Don't be, and use this capacitive sensing hack!
« Reply #19 on: January 04, 2014, 01:56:10 PM »
Hi everyone,

I am new to the forum, new to Makey Makey as I just got mine yesterday and new to Arduino as I've never owned or programmed one before last night.

I ordered a ESD bracelet but as it hasn't arrived yet, I thought I would give a try to this nice capacitive sensing trick. As it wouldn't work with http://www.freeinvaders.org/ I modified it to map the original keys in a way that it would work.

Here is the code: (Attachment Link)

Then I found out the it wasn't quite behaving like the original firmware and would become unresponsive at times, so I modified the original firmware to include the capacitive sensing trick.

Here is the code: (Attachment Link)

I found that code to work well except that it is maybe a bit slow, but I don't know how to fix it. Maybe some expert can help out. In any case it allows pressing "keys" continuously!

I found that it is pretty awesome what one can do so quickly with this platform, even as a newcomer!

I will post my projects when I have something  ;)



i would love to try out this code, because i need to be able to press more than 1 key at a time.
But i don't understand how you use/upload your program on the makeymakey, can somebody please help me out ?

Jobius

  • MaKey MaKer
  • Posts: 3
    • View Profile
Re: Don't want to be grounded? Don't be, and use this capacitive sensing hack!
« Reply #20 on: January 08, 2014, 02:50:24 PM »
nobody knows how to fix my problem that i posted above ?

listentoyoureyes

  • MaKey MaKer
  • Posts: 1
    • View Profile
Hi everyone,

I am new to the forum, new to Makey Makey as I just got mine yesterday and new to Arduino as I've never owned or programmed one before last night.

I ordered a ESD bracelet but as it hasn't arrived yet, I thought I would give a try to this nice capacitive sensing trick. As it wouldn't work with http://www.freeinvaders.org/ I modified it to map the original keys in a way that it would work.

Here is the code: (Attachment Link)

Then I found out the it wasn't quite behaving like the original firmware and would become unresponsive at times, so I modified the original firmware to include the capacitive sensing trick.

Here is the code: (Attachment Link)

I found that code to work well except that it is maybe a bit slow, but I don't know how to fix it. Maybe some expert can help out. In any case it allows pressing "keys" continuously!

I found that it is pretty awesome what one can do so quickly with this platform, even as a newcomer!

I will post my projects when I have something  ;)


I used the firmware code and it works well except that its slow. I fix would be appreciated.

Verveine

  • MaKey MaKer
  • Posts: 1
    • View Profile
Re: Don't want to be grounded? Don't be, and use this capacitive sensing hack!
« Reply #22 on: November 02, 2016, 09:23:41 AM »
Hey!

I tried the two codes but none of them worked.
The makeymakey just acted as usual, grounded :/

But finally, is it really possible NOW to tweak the code in order not to be grounded?

Thx again